Commit Graph
152 Commits
Author SHA1 Message Date
Mike Auty 4d7701be66 Fix the config printer to sort the values. 2016-08-24 01:13:38 +01:00
Mike Auty 6b47b992a7 Ensure splice requirement perpetuates down the HierarchicalDict. 2016-08-24 01:13:20 +01:00
Mike Auty 341ae950b8 Ensure configurations do not include any generated values (ie TranslationLayer/SymbolLayer names) 2016-08-24 01:12:43 +01:00
Mike Auty 3a07d6810b Add in a reminder for additional work required. 2016-08-22 02:27:13 +01:00
Mike Auty 3dc161f9b4 Rework Translation Layers to tie more closely to configurations
This change is quite signficant, and requires that TranslationLayers
get all additional parameters that they need through their requirements.

These are now automatically enumerated and populated on object
construction based on the requirements, so should not require lots of
repetitive filling out of fields.

It does come with the downside that TranslationLayers can only be
contructed with a context (and appropiate config), but TLs in particular
always require a context (to contain the base layer) and blank configs
can be constructed relatively easily (convenience functions can be added
if necessary).

This allows configuration trees to be built up, and their configs
spliced into an existing config (as if it were being loaded from a
file).

Not all ConstructableRequirements use this method, since SymbolTables
(for example) do not have access to the context or config_path in order
to get to any parameters stored in the context's config.  They therefore
are still passed their requirement values as __init__ parameters
instead.
2016-08-22 02:20:10 +01:00
Mike Auty d3e63fbc1a Rename update_configuration to build_configuration and return a standalone config. 2016-08-22 02:18:23 +01:00
Mike Auty a1b9be74c7 Refactor several configuration/requirement structures to avoid import loops. 2016-08-22 02:15:54 +01:00
Mike Auty c5139ba568 Stop exposing the config_path for now, and fix the version that's passed in the construction phase. 2016-08-22 00:36:58 +01:00
Mike Auty 7648c94083 Add in the intial works at a stacking plugin to emulate volatility 2 address space stacking. 2016-08-22 00:00:21 +01:00
Mike Auty dc16d93b77 Alter the config.path_join function to remove empty sections. 2016-08-21 21:47:45 +01:00
Mike Auty e54505701f Refactor Memory into an interface. 2016-08-21 21:26:21 +01:00
Mike Auty 386e8a34c7 Minor clean-up. 2016-08-21 21:23:29 +01:00
Mike Auty 0fd0fa0d55 Fix up the comment to match the acceptance of returning objects other than just offsets. 2016-08-17 20:05:23 +01:00
Mike Auty db21d4628c Rework importing of interfaces, a little more verbose in the code, but a little less complex to import and name. 2016-08-16 10:54:57 +01:00
Mike Auty ca61cf10b9 Refactor the context back into the ConfigurableInterface.
This also adds support for manually constructed configurables to
populate the config tree in the current context.

I'm still toying around with this though, I need to figure out
what to do with optional values and think the whole thing through
to make sure it's worthwhile.
2016-08-14 21:28:43 +01:00
Mike Auty 9111f13a8a Get rid of obsolete fulfillment method (now handled by _construct_class in ConstructableRequirementInterface). 2016-08-14 11:44:18 +01:00
Mike Auty e02feed16e Python 3 has a sane super() implementation (no arguments), so convert to using that. 2016-08-14 00:55:02 +01:00
Mike Auty 523e159047 Add in convenience functions for working with the configuration and context. 2016-08-14 00:32:22 +01:00
Mike Auty 43aba96e3f Minor pylint (alphabetical imports) and refactoring the construct class to work for symbols. 2016-07-30 01:58:29 +01:00
Mike Auty d3a226d7a8 Remove constraints as a thing, they'll need to come back, but in a different form. 2016-07-30 01:52:44 +01:00
Mike Auty 7661d2ce52 Remove errant debugging statements. 2016-07-30 00:42:46 +01:00
Mike Auty 8db3adae05 Update the scanner interface to return all kind of objects.
This one's slightly contencious, in that scanner now don't all return a
uniform value, and therefore nothing can simply run through scanners.

Worst case scenario we make a separate stricter interface that says it
only returns offsets which will then allow things that need it to
dynamically find them, but it's probably too useful to be able to return
arbitrary objects of a type (as long as the objects returned are always
of that type).
2016-07-30 00:38:53 +01:00
Mike Auty 32b0b073ce Remove unnecessary components after all the refactoring. 2016-07-30 00:37:24 +01:00
Mike Auty f8c3019165 Refactor requirements to expose the name ordering for quicker lookups. 2016-07-29 03:28:02 +01:00
Mike Auty 14c0cc262c Significantly rework the configuration system.
So this is where I ripped out the guts of the dependency tree
and made it a little better defined in some ways, and delayed
populating it in others.  The validate function signature has
changed and I'm still up in the air whether to validate with
True/False or throw/catch exceptions.

So now, configurables have a list of requirements, these are
then bundled into a single requirement and can be passed to
automagic.  Automagic runs a set of things over the deptree
to help build/manage it.  These run in order of priority.

The tree is still built from the top down, but now automagic
can build branch from the bottom up and try and splice them
into the tree where appropriate.  Hopefully this will make it
easier to see follow.
2016-07-29 03:24:52 +01:00
Mike Auty bb2dd859d5 Refactor the get_schema call to make more sense. 2016-07-29 02:56:20 +01:00
Mike Auty 8c6354e013 Document the ScannerInterface to make its use clearer. 2016-07-05 17:09:36 +01:00
Mike Auty 90fa5574b4 Add in the initial scanning framework. 2016-07-02 15:49:00 +01:00
Mike Auty c626bebb59 Convert mapping to a generator rather than a list. It must still return in sorted order. 2016-07-02 15:48:09 +01:00
Mike Auty fc34850345 Implement mapping with ignore_errors to get a (sorted) list of valid chunks in a layer. 2016-07-02 15:39:36 +01:00
Mike Auty 46190e37a9 Fix padding error in base read function. 2016-07-02 15:30:40 +01:00
Mike Auty 8c6e7918ee Fix up one missing exception change. 2016-07-02 14:53:41 +01:00
Mike Auty 5290baf73d Make InvalidAddress exceptions more useful. 2016-07-02 13:31:36 +01:00
Mike Auty e0b7f0b5f0 Add in helper functions for symbolspaces/symboltables to locate specific symbols. 2016-05-22 15:57:48 +01:00
Mike Auty fea6e0820a Convert to using a BANG variable for the symbol name delimiter.
Whilst it's easy to do now (because we don't yet use it many places)
convert the ! delimiter into a variable.
2016-05-22 15:26:31 +01:00
Mike Auty 659bfc1670 Add in Symbol class to properly represent programming symbols. 2016-05-22 11:54:44 +01:00
Mike Auty 2d23c93def Completely refactor constants and structures to symbols and types. 2016-05-22 11:51:06 +01:00
Mike Auty 7a62e74996 Refactor the translation method out of the TranslationLayer, since it's not always applicable/useful. Contemplate a rename of the TranslationLayer now it doesn't actually translate. 5;) 2016-04-10 11:54:32 +01:00
Mike Auty bacc8c5539 Move to a HierarchicalVisitor pattern. 2016-02-22 01:02:29 +00:00
Mike Auty a9ff081da5 Fix a few bugs and re-add a visitor pattern for traversing the tree. 2016-02-20 23:01:41 +00:00
Mike Auty ba2083fc7c Refactor the RequirementTreeNode to put it in the interfaces file. 2016-02-20 21:35:05 +00:00
Mike Auty 9c9183feb2 API change: Alter cast to accept object parameters rather than inheriting (which usually will be wrong). 2016-02-14 01:40:25 +00:00
Mike Auty 03cb131260 Add a priority ordering for testing layers (high priority trumps lower priority). 2016-01-21 00:06:39 +01:00
Mike Auty a3d685c93a Ensure layers aren't provided more parameters than they need (in case the parameters were meant for a different potential provider. 2016-01-16 22:20:42 +00:00
Mike Auty 78cd3c84c0 Add in a NativeSymbolTable validator. 2016-01-16 21:38:00 +00:00
Mike Auty 00660f2a2b Refactor requirements to their own file. 2016-01-16 21:04:41 +00:00
Mike Auty 7db739279f Refactor configuration interfaces. 2016-01-16 13:24:25 +00:00
Mike Auty 8e1602c02e Refactor constrained to constraint. 2016-01-15 01:53:08 +00:00
Mike Auty b36d84ab0d Move metadata to providers variable, and genericize the rudimentary resolver. 2016-01-15 01:50:02 +00:00
Mike Auty 3a8decd57c Add in the interfaces for constraints/providers. 2016-01-15 01:49:18 +00:00