Commit Graph

20 Commits

Author SHA1 Message Date
rocky
ebcb1d08f4 Limited support for Python 2.3 2016-06-03 10:20:52 -04:00
rocky
eefbc40eef option to show asm and DRY.
Get ready for some 2.3 support
2016-06-03 09:25:20 -04:00
rocky
20768266b4 use totally xdis's opcodes
Needs xdis 1.1.0 or greater
2016-05-31 19:53:17 -04:00
rocky
90741148ad DRY scanners more 2016-05-28 17:07:43 -04:00
rocky
b18b3e5d47 xdis for Python 3 opcodes 2016-05-28 01:14:18 -04:00
rocky
a08ece371e pydisassemble improvements; DRY scannners
disas.py:
 - disassembles *all* code objects found

scanner*.py:
 - no longer need to pass in version numbers; this
   is obtained from the class name
 - no longer pass in opcodes; this is done at
   initialization from the scanner name
 - all Pythoin 3 scanners support native disassembly
2016-05-18 10:58:48 -04:00
rocky
a65a8bb68e Fix 3.2 for/if loopback bug
problem was handling in Python 3.2

 for ...
    if ...
    else:
      ....
      jump for
    come from if
    jump for

In later Python 3's a "come from" is removed.

Also, start to DRY parser{,2,3} grammar rules.
2016-05-08 12:09:50 -04:00
rocky
31ebe88b38 Start to DRY opcode code. Limited support for decopyling Python 3.5 2016-01-02 22:59:02 -05:00
rocky
34841abe14 scanner3: Python 2.6 compatibility: change set initializations. Get rid
of * import
opcode_*: only a little of the much-needed larger cleanup
Makefile: remove 3.x bytecode checking from Python 2.x for now. DRY
Makefile a little bit (but more is needed)
2015-12-29 08:30:49 -05:00
rocky
820fdb4771 Fix up Python 2.x's ability to get code from Python 3.x's bytecode 2015-12-27 19:36:02 -05:00
rocky
44cd349cc7 DRY Python3 scanner code. Some cross version handling fixed.
Some Python 3.2 and 3.3 deparse fixes.
2015-12-27 04:43:35 -05:00
rocky
008bd79719 Fix up Python 3.2, 3.3, and 3.4 cross-version scanners
Try travis 2.6 and 3.3
2015-12-26 10:19:26 -05:00
rocky
7a2703634f Fix up looping by reinstating JUMP_ABSOLUTE -> JUMP_BACK or CONTINUE
get jump offsets into jump attributes. Fix up 3.2 scanner paritally
and use that in 3.4 for in cross version disassembly.
2015-12-26 03:06:03 -05:00
rocky
6910e1b1b4 Python 3 decompilation from Python2 2015-12-20 18:18:40 -05:00
rocky
6bc425b45e marshal.py: Python2 marshal code shouldn't try to turn a code object
into a string. parse3.py: handle both keyword and positional function
calls. scanner34.py: Remove extra level of quoting in LOAD_CONST.
Keyward handling now works cross Python 2/3. Some other spelling and doc fixes.
2015-12-18 21:20:12 -05:00
rocky
2dc8375ed0 Supoer multiple parsers, specifically for Python2 and Python3. In the
process some OO cleanup and some global variable hacks removed.
2015-12-16 22:08:29 -05:00
rocky
8c94acfca0 Start 3.4 more stringent disassembly testing. Disassembly format has
changed slightly. misc small bugs.
2015-12-16 00:40:28 -05:00
rocky
683c75d37e Split out marhsal and disassemble code and spell disassemble correctly.
Fix some lint issues
2015-12-15 12:10:03 -05:00
rocky
34ecd54e2c README.rst: note addition of pydisassemble
Remove duplicate disassembly printing from scanners and
put common code in caller(s). Show source-code line numbers in disassembly output
and fix alignment of byte offsets.
disas.py: workaround Python 2/3 different layouts before we get to
bytecodes in a code object.
2015-12-15 01:42:07 -05:00
rocky
a7455a3801 Start to move deparser from python-deparse here. Start Python 3.2 tolerance 2015-12-14 16:18:56 -05:00