Commit Graph

162 Commits

Author SHA1 Message Date
Daniel Bradburn
ca1679e636 Added support for support for Python 3.6 CALL_FUNCTION_KW 2017-05-10 21:49:42 +02:00
rocky
4f2ae2f603 More accurate ranges of try blocks in 3.x 2017-03-05 00:05:52 -05:00
Daniel Bradburn
cb3c5e7119 validation now uses xdis for python2 support 2017-03-04 20:23:39 +01:00
Daniel Bradburn
d1e118afa3 marked all function call tests as failing until they pass across all python versions 2017-03-04 13:04:31 +01:00
Daniel Bradburn
f7da8fd8ab added minimal examples for various function call opcodes 2017-03-04 12:44:11 +01:00
Daniel Bradburn
3b1dd9d1c4 added property based test for verifying uncompylation of function calls. A number of minimal examples for the various function call opcodes have been generated with the majority marked as expected failure until python 3.6 opcode support is complete. I'm hoping this will make it easier to figure out what needs to be done to support the new opcodes and changed semntics for function calls 2017-03-04 12:43:12 +01:00
Daniel Bradburn
91fd1ce732 reduced errors when generating function call instances 2017-03-03 21:38:53 +01:00
Daniel Bradburn
a46e7cbfa4 added test file for function calls 2017-03-03 21:06:31 +01:00
Daniel Bradburn
b0493d1984 fixed typo 2017-01-18 22:34:12 +01:00
Daniel Bradburn
7f37c60c42 added some more test cases for BUILD_CONST_KEY_MAP 2017-01-18 22:33:44 +01:00
Daniel Bradburn
e2fd308928 simplified test cases for test_build_const_key_map 2017-01-17 23:07:27 +01:00
Daniel Bradburn
6d7cec002a added validation code for checking decompilation of an expression 2017-01-17 22:40:31 +01:00
rocky
c7c0a98982 Python 2.5 mistaken try/else 2016-12-18 00:56:07 -05:00
rocky
65858a4c74 Grammar check: ELSE on RHS is ok. 2016-12-09 22:22:01 -05:00
rocky
cbcfd53dae Python 2.6 grammary bug and..
__pkginfo.py__: Bump spark_parser version for parse_flags 'dups'
2016-11-23 21:44:53 -05:00
rocky
f8917aaf88 Remove redundant 2.7 (and 2.x) grammar rules 2016-11-22 17:31:36 -05:00
rocky
c8550d5c9e Split out print_docstring
move from pysource.py to new helper.py
2016-11-22 05:29:50 -05:00
rocky
2bc316d6f0 more 2.7 control flow bug fixing 2016-11-20 06:55:08 -05:00
rocky
f2a3721d7d Start to improve detect_structure for 2.7 and 2.x
Add debug flag to find_jump_targets to show the structure we found.
When there are control-flow bugs, it's often reflected here.

scanner3.py: make code make more similar to 2.x code
2016-11-20 02:38:59 -05:00
rocky
63e4c9343f Clean up annotation grammar a little 2016-11-01 15:50:19 -04:00
rocky
ccdd37611c More complete annotate handling
Still have a bit of work to do though.
2016-10-28 19:55:17 -04:00
rocky
2e355b6245 Expand annotate return to Python 3.4 2016-10-28 11:33:54 -04:00
rocky
9849f06ff6 Expand annotate handling to 3.3
(and possibly 3.2)

- DRY Python 3.1-3.3 grammar a little
2016-10-28 09:01:41 -04:00
rocky
9b7d978944 Move fstring rules inside a 3.6+ check 2016-10-22 11:48:52 -04:00
moagstar
cec80e696c further work on supporting single and multiple fstring decompilation 2016-10-20 20:44:27 +02:00
moagstar
7beaa9f36c urther work on fstrings for python 3.6 - there is a new opcode build_string which is used to improve fstring performance, but broke the fstring support in uncompyle 2016-10-19 23:32:15 +02:00
rocky
051efb80f5 PY3: COME_FROM -> COME_FROM_FINALLY as appropriate
We now have all WITH_ op jumps associated in the grammar

Also, some COME_FROM_LOOP grammar fixes
2016-09-27 03:27:41 -04:00
rocky
c87710dd4b Python 3 COME_FROM -> COME_FROM_WITH appropriately 2016-09-26 08:09:05 -04:00
rocky
760532b218 Add COME_FROM_LOOP
Note: we have regressed in --verify and some tests,
but I believe that's because we are producing more equivalant
(if uglier) programs. That's a separate problem though.
2016-09-22 08:24:02 -04:00
rocky
88f2ad1f5a Merge branch 'master' into controlflow 2016-09-22 01:33:29 -04:00
rocky
b6dee24289 First step towards managing control flow decoding 2016-09-21 21:30:57 -04:00
moagstar
bae3d2e361 merge fstring changes from moagstar 2016-09-21 22:04:46 +02:00
moagstar
5ab3e52c9c disable test_format_specifiers on python < 3.6 since this is only required for the fstring tests and was causing failures on 2.7 2016-08-16 08:38:38 +02:00
DanielBradburn
004ce5c491 Fixed bug with FORMAT_VALUE where a sub expression would not be correctly interpreted 2016-08-16 08:24:06 +02:00
DanielBradburn
2bd850f297 added examples for known failures 2016-08-14 20:44:23 +02:00
DanielBradburn
7fba24198f small formatting change 2016-08-10 22:29:02 +02:00
DanielBradburn
e06a90ed27 added hypothesis to requirements-dev 2016-08-10 22:27:54 +02:00
DanielBradburn
d030a04c1a added hypothesis test (currently failing due to limited support) for testing fstring uncompyling 2016-08-10 22:20:43 +02:00
DanielBradburn
5d27832d6f resolve merge conflicts from pull request 2016-08-10 08:20:51 +02:00
rocky
4a3a62d01b Align disassembly output with xdis
align number of offset fields with xdis.
Show None type when we mean None, not ''
2016-07-17 14:00:00 -04:00
rocky
63ec3f934a Adjust test data for changed disasm output 2016-07-17 12:13:19 -04:00
rocky
0adf70b4d9 fragment test update for expanded offsets 2016-07-03 22:59:33 -04:00
rocky
8943167e96 Alight instructions
Merge recent changes with master
2016-06-19 03:01:10 -04:00
rocky
e9c8c11071 Set comprehension code is not in 2.6
So we need more care in test programs.
2016-06-06 18:06:44 -04:00
rocky
70d4841a6a Fix python 3 set comprehension and ...
Add a few set/list comprehension offsets for Python 3
2016-06-06 17:04:59 -04:00
rocky
3e5876dd03 Back of some of the last disasm changes
Was failing test_disasm and I don't want to deal with that now.

Add more 2.7 bytecode tests
2016-05-30 00:23:51 -04:00
rocky
4398b5b2e0 Use xdis for code, magics, and marshal 2016-05-27 19:18:06 -04:00
rocky
1121ff2456 Handle marshal frozenset 2016-05-18 17:01:40 -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
a3dd61c981 Fix marshal bug in handling complex numbers 2016-05-17 19:25:34 -04:00
rocky
bb384bc0b3 pytest for last commit 2016-05-16 19:44:35 -04:00
rocky
8ae7e22f2e Add simgle-mode compilation 2016-04-18 05:14:47 -04:00
rocky
7e0526d627 Towards single compilation 2016-04-17 22:47:03 -04:00
rocky
223b028393 Port deparse test from python-deparse to py.test 2015-12-25 00:02:17 -05:00
rocky
e3a5d487eb Show embeded timestamp of byte-decompiled file 2015-12-24 11:30:57 -05:00
rocky
4f0fe90eef Add spark option to show grammer. Revise uncompyle options. Start to reorganize
tests more
2015-12-22 03:56:50 -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
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
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
dafca53022 Add some disassemble tests using pytest. 2015-12-15 17:58:38 -05:00