Commit Graph
63 Commits
Author SHA1 Message Date
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
Mike Auty 282eaa7f00 Improve/remove unnecessary imports. 2016-11-07 12:26:06 +00:00
Mike Auty 667014a1fd Attempt to standardize error message display. 2016-10-30 17:51:45 +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 0b447b6958 Initial implementation of the Intermediate Format, breaks the vtypes format and needs a lot of tidying. 2016-10-26 01:09:29 +01:00
Mike Auty 16bed2aa94 Allow specifying a table_name for get_symbols_by_location. 2016-05-22 16:02:30 +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 2d23c93def Completely refactor constants and structures to symbols and types. 2016-05-22 11:51:06 +01:00
Mike Auty 00660f2a2b Refactor requirements to their own file. 2016-01-16 21:04:41 +00:00
Mike Auty d258c56991 Rerun pylint with pycharm-5 and fix pep8 issues as well. 2015-11-21 13:12:00 +00:00
Mike Auty 143335402d Use a default value to allow instantiation of contexts, rather than allowing None and checking all the time. 2015-04-09 16:30:01 -05:00
Mike Auty 180db2e23d Minor neatening of iter. 2015-04-09 16:25:21 -05:00
Mike Auty 5493617727 Fix up minor typo in the recent SymbolSpace changes. 2015-04-09 16:24:04 -05:00
Mike Auty 35506bb7d3 Allow SymbolSpaces to be uninitialized, and move context from framework to framework.contexts. 2015-04-09 16:22:25 -05:00
Mike Auty 3a28d7ae41 Refactor the context work, to use composable objects rather than inheritable classes. 2015-01-19 23:57:49 +00:00
Mike Auty 87967853f7 Convert volinfo namespace to vol namespace. 2015-01-05 15:04:40 +00:00
Mike Auty 73bd451759 Minor pylinting across the whole project. 2015-01-04 21:14:17 +00:00