Commit Graph

59 Commits

Author SHA1 Message Date
rocky
c43c9a19aa Move to GPL3 license 2018-02-27 06:40:36 -05:00
rocky
cb27f244dc Go over verification routines again
Add meager verify-run tests for those versions. More tests will follow
2018-01-24 06:20:38 -05:00
rocky
8e2f78ceba Add Python 2.4 importmultiple rule 2017-12-02 14:19:32 -05:00
rocky
95268cb14e In verify, JUMP_BACK is the same as CONTINUE...
at least for now. See FIXME in verify
2017-10-29 21:34:34 -04: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
b35546157f LOAD_ASSERT can also be an expr
This may have the undesirable property that assert statements might get
tagged with equivalant low-level Python code that uses "raise
AssertionError", but so be it.

Fixes #103
2017-04-22 20:03:21 -04:00
rocky
160ec0d9cc COME_FROM for 3.x POP_EXCEPT, DRY with op_name() ...
Start adding COME_FROMs for POP_EXCEPT in preparation for
getting tryelse blocks correct.

Simpler opname access functions:
  - self.op_name(op) is self.opc.opname[op]
  - self.op_name_from_offset(offset) is self.opc.opname[self.code[offset]]

verify.py: not all offsets are ints
2017-03-01 05:50:31 -05:00
rocky
597d51951e Improve Python 2.6 & 2.7 verification 2017-01-23 02:32:09 -05:00
rocky
cc2321f49e Fix up Python 3.0 handling 2017-01-22 03:45:40 -05:00
rocky
a92e6c9688 Bugs in Python 2.6- "and" and "lambda" handling ..
and clean up verify output
2016-12-28 04:54:11 -05:00
rocky
2f51067a9d Scanner call fixes. NAME_MODULE removal for <=2.4 2016-12-25 09:20:57 -05:00
rocky
92166452c1 two misc changes
- track print_docstring move to help (used in python 3.1)
- verify: allow RETURN_VALUE to match RETURN_END_IF
2016-12-11 08:22:26 -05:00
rocky
263c63e009 Back of some of the verification changes 2016-12-09 21:43:22 -05:00
rocky
813bce4697 Merge branch 'master' of github.com:rocky/python-uncompyle6 2016-12-09 21:13:31 -05:00
rocky
a5d2237435 Python 3.x else clause detection and..
- Strengthen verify check.
- weak verification on Python 3.5 for now
2016-12-09 21:10:10 -05:00
rocky
d22931cb49 Get ready for release 2.9.7
Some of the many lint things. Linting is kind of stupid though.
2016-12-04 09:36:30 -05:00
rocky
76ae1592d0 verify scanner2 vs scanner3 small changes...
verify.py: allow LOAD_CONST None to make LOAD_NAME 'None'
scanner{2,3}.py: make them look more alike
2016-11-17 03:43:39 -05:00
rocky
b6e53205dd Handle verify syntax errors...
Update README.rst stats
2016-11-13 18:55:23 -05:00
rocky
8b240a80e7 Get ready for release 2.9.0 ...
- Use xdis 3.0.0 protocol load_module. Needs bump in requirements.txt
  and _pkg_info_.py
- Start Python 1.5 decompiling - another round of work is needed to remove
  bugs
- small cleanups
2016-10-10 09:33:49 -04:00
rocky
ccd129b377 Try stronger verification
verify.py: add check in verification that magic is the same.
Otherwise we go for weak verification.
2016-09-25 17:48:33 -04:00
rocky
dd661bc94a Start accepting Python 3.1 bytecode 2016-09-09 15:32:46 -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
6189ce3c04 Bug in 3.x detecting "if" structure and ...
scanner3.py: bug in 3.x detecting "if" structure
Make scanner2.py look more like scanner3.py
verify.py: add weak-verify which tests Pytyon syntax, but not code
2016-08-31 04:07:42 -04:00
rocky
da458bdce7 Correct PYPY bit logic in previous commit 2016-08-27 20:19:12 -04:00
rocky
f47aecae9f PYPY bugs and inspired changes ...
verify.py: Show co_flags when different.
pysource.py: PYPY also generates normal tryfinallystmt code
test_pyenvlib.py: allow pypy-5.3.1
2016-08-27 19:32:42 -04:00
rocky
65a16327ce Moagstar's 3.6 wordcode + formattedValue rules 2016-08-01 03:16:26 -04:00
rocky
5e801b5d74 Python 2.7 set comprehension bug 2016-07-27 08:36:33 -04:00
rocky
74f440bd0b Usuability fixes
* try using format for __str__
* Explicitly nuke self.attr and self.pattr when no arg
* Sync pysource and format wrt make_function
2016-07-26 20:49:41 -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
7b7a9fa4cf Python 3.4 assertion handling. Improve verify
3.4 has jump optimization like 3.5.
verify.py: show mismatch on verification mismatch
2016-07-14 05:20:30 -04:00
rocky
4398b5b2e0 Use xdis for code, magics, and marshal 2016-05-27 19:18:06 -04:00
rocky
68ff878b3e Small pyflakes stuff 2016-05-20 21:37:46 -04:00
rocky
b629a0c5df Add 3.5 to verify 2016-05-18 10:59:57 -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
134b67d952 Misc small changes
Go over history yet again
code cleanups.
2016-05-16 10:15:55 -04:00
rocky
54a0af733b Verify 3.4 bytecode. verify API call bug fixed. 2016-01-02 07:50:09 -05:00
rocky
2e91de8355 Start using our replacement for inspect.iscode 2015-12-30 18:44:27 -05:00
rocky
116263dd8c inspect.iscode -> hasattr for now until we write a cross-version iscode 2015-12-29 17:05:48 -05:00
rocky
4640e7dece Running native on Python 3.3 needs more work 2015-12-26 19:32:32 -05:00
rocky
d2406e9d57 One more place for API change 2015-12-24 11:50:08 -05:00
rocky
e3a5d487eb Show embeded timestamp of byte-decompiled file 2015-12-24 11:30:57 -05:00
rocky
9cdcdfd305 Part of a much needed cleanup. Move semantics routines into its own
directory. Move out lots of stuff from __init__ to their own files.
Add file loading tests. Document AST handling a tad more complete.
2015-12-20 23:03:35 -05:00
rocky
93ab1f0281 Python 3.4: MAKE_FUNCTION starts to work. 2015-12-19 11:17:17 -05:00
rocky
0a49c7a15b verify.py: Don't try to verify bytecode against compiled code if
magics of running interpreter mismatch bytecode to be compared.
load_module() now returns the magic found in the code object file.
2015-12-18 22:04:50 -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
9fecb48744 Tidy a little bit 2015-12-16 01:52:11 -05:00
rocky
dafca53022 Add some disassemble tests using pytest. 2015-12-15 17:58:38 -05:00
rocky
ae42f61ef0 Add a standalone disassemble utility. __init__.py: Shun using 0, 1 for booleans 2015-12-14 22:01:58 -05:00