Commit Graph
81 Commits
Author SHA1 Message Date
Mike Auty 8e420cbe62 Core: Multiple typing fixes across the tree 2020-08-16 22:22:24 +01:00
Mike Auty c1f6c224d7 Symbols: Resolve symbols returned from symbol_space.get_symbol
This ensures that ReferenceTemplates are not returned from a call to
symbol_space.get_symbol.  This is in keeping with the get_type method.

The symbol_space containing all symbol tables has visibility of all
tables and can cross-resolve amongst them.  Asking a specific table
for a type may result in a ReferenceTemplate.  This feels like a
better solution than having individual tables ask their parent space
to fill in the details of sibling tables.

Fixes #279.
2020-08-12 20:39:33 +01:00
Hanno Heinrichsandikelos deb2b78312 Clear symbol cache after ASLR computation on Linux. 2020-06-23 16:45:22 +01:00
Mike Auty d11ffa1f23 SymbolTable: Remove the no longer necessary mask_symbol_table method 2020-06-10 19:39:20 +01:00
Mike Auty ad8fa0e934 Automagic: Improve mask/shift documentation 2020-06-10 19:39:20 +01:00
Mike Auty a6cd344e22 Automagic: Refactor ASLR finding for all symbol_finder using OSes 2020-06-10 19:39:20 +01:00
Mike Auty d9ac5300fa Move from using deepcopy to a clone method. 2020-06-10 19:39:20 +01:00
Mike Auty 2748ce32d8 Initial attempts at cloning a symbol table 2020-06-10 19:39:20 +01:00
Mike Auty fabb4f4924 Store and re-store the original get_symbol method masking 2020-06-10 19:39:20 +01:00
Mike Auty b99ace86fb Tidy up exceptions to be more accurate. 2019-11-13 19:58:14 +00:00
Mike Auty 40fcdf9469 exceptions: SymbolErrors now contain specific information 2019-11-13 19:27:00 +00:00
Mike Auty 3b656e337a Update windows extensions to ensure they're documented. 2019-10-02 20:25:54 +01:00
Mike Auty e0b9d72c84 Update the license URL and LICENSE.txt 2019-09-25 21:44:05 +01:00
Mike Auty 72567e1c50 Yapf-0.28.0 rerun across the whole codebase. 2019-09-21 21:08:23 +01:00
Mike Auty e922cef316 Improve docstrings for all plugins, and reformat all docstrings. 2019-09-07 22:59:54 +01:00
Mike Auty 9cde94bceb Change the license blurb on all files. 2019-08-27 23:11:00 +01:00
Mike Auty 18283ab410 Move to an object_from_symbol model
Note: creation of enumerations can be done using Context.object, which
should allow reference of enumeration members by normal type objects.

If it turns out enumerations are never referenced from types, we can
easily remove the try/except in the Module.object method.
2019-08-14 20:50:42 +01:00
Mike Auty 5362e2094e Initial attempt at cleaning up the API
Context.object accepts a template or a string name (and now a type
flag).  Module.object only accepts a string (because a template already
has most of the stuff built in and might as well be passed to the
Context.object constructor).

The gotcha here is the absolute flag, which must now be set
appropriately in all cases *except* where the module is constructed
with an offset of 0 (whereby it will have no impact).
2019-08-14 20:50:42 +01:00
Mike Auty e503c3667f Improve enumeration support. 2019-06-30 14:12:43 +01:00
Mike Auty c85430c28e More typing fixes. 2019-04-05 14:24:08 +01:00
Mike Auty c64ed6a8dd Remove validity checking in favour of static-type checking.
This removes the assertions that checked plugin devs didn't do anything
overly bad in favour of using mypy to ensure appropriate type-checking.

It also moves the ProgressCallback typing information to constants in
order to avoid circular imports (since constants doesn't import
anything).
2019-01-20 02:35:49 +00:00
Mike Auty fdc6efc4ad Add in the LICENSE and the README. 2018-12-19 23:55:03 +00:00
Mike Auty af8719d299 Keep a separate list of resolve symbols, in case they share the name of a type. 2018-12-19 19:43:27 +00:00
Mike Auty 19572b6e1e Reformat all python files using yapf with custom volatility style. 2018-12-16 16:50:17 +00:00
Mike Auty 29d41470a4 Mass reformat of typing imports
Relented on the strict import of direct objects/classes for the typing
module only.  Typing module components can be directly imported because
it makes the code really painful to read and write otherwise.

This is still in-line with the python style guide adopted from Google at
http://google.github.io/styleguide/pyguide.html section 2.2.
2018-12-16 13:04:22 +00:00
Mike Auty 0abaa3af2f Don't load all symbols when we ask to import symbols. 2018-12-14 00:27:46 +00:00
Mike Auty 1a5c9d3af8 Roll symbols.utility into symbols file until we get enough functions we need to split them out again. 2018-12-12 23:38:01 +00:00
Mike Auty ac0f1a2cd0 Fix up a remaining typo, and two typing questions. 2018-11-08 00:19:17 +00:00
Mike Auty 0f08432aa5 Refactor Symbol interface to SymbolInterface. 2018-08-09 14:28:08 +01:00
Mike Auty d08c29ffab Improve style to use default iterators rather than explicit ones. 2018-08-05 16:18:53 +01:00
Mike Auty 4897b7ab81 Fix up some typing errors. 2018-07-22 13:19:20 +01:00
Mike Auty 2f3f291e53 Fix up missing parameter in symbol_space. 2018-07-19 09:54:56 +01:00
Mike Auty 7a52ac9deb Fix a large number of typing issues.
There are several instances where mypy didn't detect

if blah is not None:
    blah = thing

and so were rewritten as:

blah = blah or thing
2018-06-04 01:25:02 +01:00
Mike Auty e133509ea8 Fix broken type resolution
The introduction of symbol resolution required subresolving "unnamed"
(symbol named) types.  The resolution system was changed to pass
constructed objects rather than names, which prevented the referencing
from working properly.  This commit changes that bit back and creates a
temporary *type* in the _resolved list for the symbol, then restores
whatever was there before.

We restore it so that people don't get used to looking up symbols using
get_type (we may revisit this decision).
2018-03-21 15:32:09 +00:00
Mike Auty 66b64e5dfa Ensure symbol types are recursively resolved. 2018-03-20 23:53:13 +00:00
Mike Auty ee12b81f4a Add in type-annotations for renderers and start on symbols. 2017-12-13 20:48:52 +00:00
Mike Auty e90b4e2d02 Add and make use of free_table_name for symbol_spaces. 2017-09-03 22:54:42 +01:00
Nick L. Petroni, Jr 8fcbf988b5 initial linux.pslist.PsList plugin 2017-05-14 22:24:05 -04:00
Mike Auty 5e15d522bd Remove automatic IDE-inserted attributions.
They weren't consistent and they show just remind me how slowly
I've been getting vol 3 written!  5:S

There's git commits to track all of that stuff if we need it.
2017-05-14 11:40:49 +01:00
Mike Auty fdb386d714 Return more information when particular types cannot be looked up. 2017-04-29 15:03:20 +01:00
Mike Auty 6603e503c5 Rework enumeration access in symbol tables. 2017-02-04 14:46:46 +00:00
Mike Auty b745f41c6c Move the interface fo rthe SymbolSpace over to the interfaces module. 2016-12-28 22:50:52 +00:00
Mike Auty b54cb86c89 Allow automagics to use natives without a set of global natives.
This allows NativeSymbolTables to be appended to symbol_spaces and
uses this to let automagic modules (which have no existing symbol table
to rely on) to load natives for reading format data.
2016-12-26 22:49:51 +00:00
Mike Auty 8e334ca086 Remove fallthrough/default natives from symbol_spaces. 2016-12-25 18:37:54 +00:00
Mike Auty c5cd3595de Fix up minor typo and hard depend on >= python 3.4. 2016-12-25 13:44:03 +00:00
Mike Auty 65ef2927a3 Refactor the enumeration_choices code into the existing weak_resolve code. 2016-12-18 02:53:07 +00:00
Mike Auty cf4ac3a7f6 Allow enumeration dictionaries to be accessed through the SymbolSpace directly. 2016-12-18 02:48:23 +00:00
Mike Auty e2d5f51ad5 Remove old and rotten code. 2016-12-12 00:25:03 +00:00
Mike Auty 770a8ee42a Improve error handling to prevent endless recursion in template.__call__ 2016-12-04 11:17:48 +00:00
Mike Auty e27a444068 Very minimally fix up the docstring for a function. 2016-12-04 01:01:46 +00:00