Commit Graph

42 Commits

Author SHA1 Message Date
rocky
71e7120501 JUMP_BACK and CONTINUE need to be treated more similar...
fixes 148
2018-01-22 23:08:20 -05:00
rocky
1392b18bd7 Adjust for spark-parser 2.7.0 incompatabilities 2017-10-10 14:14:26 -04:00
rocky
7b38d2f1f8 Adjust for xdis opcode JUMP_OPS. release 2.12.0 2017-09-25 20:01:31 -04:00
rocky
41343c27b7 Misc bugs
parse2.py: restore accidently-removed while1stmt rule
scanner27.py: grammar typo
check_ast: add while1else to list of looping constructs
pysource.py: CALL_FUNCTION_VAR_KW_ARGS with positional args rule is different?
2017-04-10 07:57:56 -04:00
rocky
056f600da1 Start Python 2.1 bytecode decompile 2016-10-07 22:42:30 -04:00
rocky
c7788e4545 disassemble -> ingest where appropriate
As part of tokenization for (de)parsing, we need to do something like a
disassembly, but is is really a little different.

Disassembly, strictly speaking, is done by the xdis module now.
What "ingestion" does is massage the instruction tokens to a form that is
more amenable for parsing.

In sum, ingestion is different than disassembly, although disassembly is
generally the first part of ingestion.
2016-09-04 11:43:02 -04:00
rocky
3a78332d59 tok.format -> tok.__str__; simplify pypy code 2016-07-27 09:26:39 -04:00
rocky
a3e10db8dc Handle PyPy CALL_METHOD op more correctly
Start testing pypy2.7 and 3.2 bytecodes
2016-07-25 13:05:54 -04:00
rocky
ca9888ace4 Another 2.7 'continue' detection bug 2016-07-23 17:44:42 -04:00
rocky
7c4316d4fb Start handling pypy 2.7
Need to understand whether we care compiling pypy.
Pypy 2.7 list comprehensions are different and use
its own opcode.
2016-07-21 02:58:50 -04:00
rocky
44dba42a40 Remove JA. Use standard JUMP_ABSOLUTE instead 2016-07-10 08:21:17 -04:00
rocky
480e6a125f Add Python 3.5 yield from and ...
* fragments.py: Handle pass stmt sometimes
* scanners: regularize Python 2 scanners some
* test/test_pyenvlib.py: add python 3.5.1 option
2016-06-22 13:08:11 -04:00
rocky
5c268ee2a6 2.7 and 3.x bug in dict comprehensions 2016-06-19 13:45:07 -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
bb2e9c0d31 bang on scanner2{5,6} 2016-05-29 18:44:07 -04:00
rocky
58fd0f7fe5 Start to DRY 2.6 scanner
Note: can't use xdis 2.6 opcode until another xdis release.
2016-05-29 05:05:48 -04:00
rocky
e70e7bfc16 Start to DRY Python 2 scanners...
Get 2.7 opcodes from xdis.
2016-05-28 19:34:12 -04:00
rocky
4398b5b2e0 Use xdis for code, magics, and marshal 2016-05-27 19:18:06 -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
d42f84a59c Go over disassembly routine...
* tok.py:
  - add arg value when it is an integer
* pydisassemble.py:
  - add option -U --uncomplyle for which flavor of disassembly
  - remove -o option
* scanner27.py:
  - allow for native (non-uncompyle6) output
2016-05-17 22:52:16 -04:00
rocky
bdd7df6040 Python 2 loop scanner detection in Python 3
scanner*.py: Make scanner27 and scanner3 more aligned
Makefile: we can run py.test on Python 3.5
HISTORY.md: grammar changes
2016-05-16 13:40:55 -04:00
rocky
134b67d952 Misc small changes
Go over history yet again
code cleanups.
2016-05-16 10:15:55 -04:00
rocky
37406557bc More small changes 2016-05-12 12:59:31 -04:00
rocky
8b9e0eca42 Some grammar cleanup 2016-05-09 11:58:05 -04:00
rocky
4a79082872 Fix 3.5 if..pass bug
Update HISTORY.MD to include Dan Pascu. Some minor doc corrections
2016-05-08 10:32:11 -04:00
rocky
62f6220082 DRY Python 2.7 scanner more 2016-05-03 03:29:56 -04:00
rocky
52da6f4a8f Make ScannerXX() initialization the same on Python 2.x and 3.x 2016-01-02 07:54:21 -05:00
rocky
2e91de8355 Start using our replacement for inspect.iscode 2015-12-30 18:44:27 -05:00
rocky
657eeb7de8 Towards Python3 getting try/except working more often. 2015-12-30 09:46:52 -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
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
347219a009 Python3 postional arguments. Clean up code more along the lines of uncompyle3. 2015-12-18 17:07:35 -05:00
rocky
2fc2d6c699 Python 2.6 compatability via ericfrederich's patch. DRY version-checking code 2015-12-17 20:48:54 -05:00
rocky
a309a77ea7 Python3: remove "return None" at end of main for uncompyle. Fix up verify for Python3. First automated Python 3.4 tests via "makecheck-3.4" in test directory. 2015-12-17 18:53:30 -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
06653a6163 On Python3.4 decompiling Python 3.4 instructions, use its
built-in disassembler routines. In contrast to what was here,
they most likely work!
2015-12-16 09:13:14 -05:00
rocky
9fecb48744 Tidy a little bit 2015-12-16 01:52:11 -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
b5797dfa0f Move scanners in its own directory. Dir base-tests -> base_tests so we
can import from that.
2015-12-14 09:38:46 -05:00