Commit Graph
143 Commits
Author SHA1 Message Date
Mike Auty 9b488f89fd Make the default python-type for Chars an int rather than a bytes. 2019-02-06 21:06:12 +00: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 b13fcb186c Improve typing issues. 2019-01-03 01:13:53 +00:00
Mike Auty 6bb927ebfa Fix up terminology to ensure we only refer to layers not spaces. 2019-01-03 00:40:13 +00:00
Mike Auty fdc6efc4ad Add in the LICENSE and the README. 2018-12-19 23:55:03 +00:00
Andrew Caseandikelos 8f213a95d7 vol_class -> CPPObject 2018-12-19 00:54:51 +00:00
Mike Auty c5ebf91915 Yapf reformat of the patches. 2018-12-19 00:54:51 +00:00
Andrew Caseandikelos 6aac0571e6 add support for objective C classes in OSX and json format 2018-12-19 00:54:51 +00:00
Mike Auty e65a00894a Minor style tweaks and mass changes across the codebase because of it. 2018-12-17 12:46:14 +00:00
Mike Auty b61ac3bd47 Many more typing fixes. 2018-12-17 01:17:06 +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 9824538bd9 Numerous pycharm warnings resolved
This includes:

* Better ways of checking empty lists
* Not shadowing builtin functions like filter
* Preventing invalid slash warnings by marking strings as regexps
* Removing unnecessary brackets
* Lowercase variable names
* Adding/updating parameters in docstrings
* Removing unused code (lines not chunks)
* Change in not a member tests
* Changing some methods to static
* Shorting range membership checks
* Missing parameters
* Make some exception handlers more specific
* Don't define a lambda to a variable
* A few more instance checks to help type checkers
2018-12-16 13:21:06 +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 f41e3e0453 Completely rework the primitive data format system. 2018-12-13 18:33:42 +00:00
Mike Auty 9949809198 Fix a minor typo. 2018-12-13 18:33:42 +00:00
Mike Auty b533d19f83 Refactor the data extraction for primitive types. 2018-12-13 18:33:42 +00:00
Mike Auty a78452e361 Fix up ugly int128 hack with a slightly nicer hack. 2018-12-13 15:56:24 +00:00
Mike Auty 8acbe8bba3 Refactor conversion code from objects.utility to a conversion module in renderers. 2018-12-12 23:39:10 +00:00
Mike Auty cf95f6e73e Minor typing fix. 2018-12-08 18:41:13 +00:00
Andrew Caseandikelos 3ab654847e Change NotApplicableValue -> UnparsableValue 2018-12-08 17:34:48 +00:00
Andrew Caseandikelos c6e9763e5a Linux - add bash plugin 2018-12-08 17:34:48 +00:00
Mike Auty 90c964905a Fix up a circular import issue. 2018-11-08 00:25:26 +00:00
Mike Auty db7320e426 Bulk lint and a couple of typos fixed. 2018-11-08 00:19:17 +00:00
Mike Auty 001d53e768 Rework some code to help with typing. 2018-11-01 11:17:15 +00:00
Mike Auty 9c101aee91 Ensure pointers are masked based on their native_layer not their instantiated layer. 2018-10-04 02:44:26 +01:00
Mike Auty fa552aa3b0 Add in the native_layer_name concept to ObjectInformation. 2018-09-12 22:45:34 +01:00
Mike Auty 059be517fc Fix up minor typing issues. 2018-08-29 23:29:00 +01:00
Mike Auty 3a6b4ad35c Add in the has_member method for objects and templates. 2018-08-29 22:54:56 +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 b1d46f843b Convert documentation to napoleon/Google format docstrings. 2018-08-05 15:52:12 +01:00
Mike Auty 7fc19ef110 Updating typing information. 2018-08-05 15:02:11 +01:00
Mike Auty bca972f28a Remove the python implementation of __getattribute__ for speed.
The __getattribute__ method is called for *all* attribute lookups, and
the python implementation is likely slow.  The only function the python
implementation provided was to check that properties started with
helper_.  Since this only provided a log message, we could add it back
in only if the log level is high enough?  Either way, it's not
significant enough to warrant costing extra time in every attribute
lookup on every object.
2018-07-30 23:58:02 +01:00
Mike Auty 552101b593 Attempt to reduce the amount of time taken in calling templates. 2018-07-30 23:53:00 +01:00
Mike Auty 79d2bab44d A few additional typing fixes. 2018-07-22 13:29:43 +01:00
Mike Auty 4897b7ab81 Fix up some typing errors. 2018-07-22 13:19:20 +01:00
Mike Auty 106a0cb6fd Rework the array_of_pointers utility function.
It now makes use of the original array's symbol table to get the pointer
template, such that the size of the pointer is correct according to the
original table.  Resolves "pointer.size" attribute errors (firing inside
a property and thus throwing off unusual exceptions).
2018-07-18 22:35:13 +01:00
Mike Auty d9ed86bcc5 Ensure we return the correct values for dir(). 2018-06-16 14:29:51 +01:00
Michael LighandMike Auty fb57e2c5f2 wininfo, procdump, dlldump, and json for pe & kdbg 2018-06-12 08:40:21 +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 623180ddbd Make many typing fixes, based on mypy-0.590. 2018-04-22 20:45:59 +01:00
Mike Auty 6fdf577058 Fix up another typing warning. 2018-04-12 14:57:10 +01:00
Mike Auty 66af2f16de Fix more typing issues. 2018-04-12 14:09:11 +01:00
Mike Auty c758c249d0 Fix classing issue introduced by recent pickling work. 2018-04-11 20:54:48 +01:00
Mike Auty 8ac434ade9 Merge branch 'master' of github.com:volatilityfoundation/volatility3 2018-04-11 15:39:38 +01:00
Mike Auty 133eb916cf Handle bad unix timestamps. 2018-04-11 15:39:32 +01:00
Mike Auty 470b8e1bea More typing updates to allow for string subtypes. 2018-04-11 09:34:09 +01:00
Mike Auty 3fc17f16bd Change the type for array of pointers to accept any object. 2018-04-11 09:25:47 +01:00
Mike Auty 1f733e7dc4 Make sure we don't get in a getattr loop.
This appears to get in a loop when it's been unpickled by
multiprocessing.  My guess is that it's trying to set _concrete_members
without it being done in __init__ and there gets in a loop.

We ensure then when doing a look-up inside __getattr__, it happens using
__getattribute__.
2018-04-08 23:28:14 +01:00
Mike Auty d8f497eb71 Allow unpickling of PrimitiveObjects. 2018-04-08 22:25:46 +01:00
Mike Auty d8cdd79843 Add in pointer is_readable method to check if the pointer would translate properly. 2018-03-24 11:00:22 +00:00