Commit Graph
165 Commits
Author SHA1 Message Date
Mike Auty 2c60747355 Minor fix, small but might as well fix it. 2016-12-14 00:27:41 +00:00
Mike Auty ed716ca12a Convert SymbolTableInterfaces to descend from ConfigurableInterface
This allows SymbolTables to hold actual requirements (which
IntermedSymbolTable already did, but without pulling in the right
interface).  It means that values like kernel_virtual_offset get saved.

We still need to figure out how to allow plugins to demand optional
configuration values in other places (such as the kvo) but for now the
plugin will barf if it doesn't get it.
2016-12-12 02:08:32 +00:00
Mike Auty d43b294f36 Ensure we store all relevant config values rather than just those stores as variables. 2016-12-12 02:07:48 +00:00
Mike Auty 555f587b15 Ensure the progress value for translation layer scanning is correct. 2016-12-08 12:08:42 +00:00
Mike Auty 797e51608e Move the masking code into the data layer. 2016-12-07 09:50:59 +00:00
Mike Auty 6cb5d06d6d Ensure all offsets are normalized to fall within their layer's address range. 2016-12-07 00:07:57 +00:00
Mike Auty 88f1166c6d Add in a helper function that will likely be useful in the future. 2016-12-04 01:01:13 +00:00
Mike Auty 667014a1fd Attempt to standardize error message display. 2016-10-30 17:51:45 +00:00
Mike Auty f771de3703 Tidy up error messages. 2016-10-30 17:07:48 +00:00
Mike Auty d1b58143fe Add in UnresolvedTemplate type.
This template type allows objects that have not been able to be resolved
to exist within the symbol system.  It emits a debug message on creation
so that intermediate format developers can identify potential issues,
but does not raise an exception so as to allow partial tables to be
used.

If the UnresolvedTemplate is called (to create an object) before the
symbol has been added to the symbolspace, it will fail with a
SymbolError (as thrown by the individual SymbolTable).  For this reason,
the class has been made private to the SymbolSpace class to prevent
unexpected use.
2016-10-30 16:54:12 +00:00
Mike Auty 6f1bdcb6cb Refactor symbol.offset to symbol.address. 2016-10-26 01:42:37 +01:00
Mike Auty 9959697ba5 Move where the rescursion into TranslationLayers happens. 2016-08-24 01:29:11 +01:00
Mike Auty f3bc1d30b3 Refactor the build_configuration in Layers so that even data layers get their requirements populated. 2016-08-24 01:14:34 +01:00
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