Commit Graph

47 Commits

Author SHA1 Message Date
rocky
e3369edaed DRY using version_info_to_str 2021-10-23 08:24:35 -04:00
rocky
e8e006bb8c More Python version comparison conversions 2021-10-16 11:33:03 -04:00
rocky
5a83c7c643 Simplify imports again using xdis 4.6.0 2020-05-19 00:53:53 -04:00
rocky
3fb8d90407 Revise for xdis 3.6.0 ...
Simplify xdis imports where we can.
Blacken (most) of those buffers too
2020-05-18 21:49:16 -04:00
rocky
1d7e8f1617 Update to use xdis 4.4.0 ...
with more correct SipHash and other needed bug fixes.
2020-04-20 10:47:34 -04:00
rocky
869e48877c Convert to use xdis 4.3.0 or greater 2020-04-16 08:41:53 -04:00
rocky
1c0c54991e Backend some buffers 2019-11-09 18:49:40 -05:00
rocky
dcad6cf6ce Fix if return boundary in 3.6+
Fixes #209
2019-03-10 05:59:15 -04:00
rocky
61fa4fe391 Some Python 3.0 fixes...
Needs more in this direction though.
2018-06-09 10:05:23 -04:00
rocky
c43c9a19aa Move to GPL3 license 2018-02-27 06:40:36 -05:00
rocky
0d32ec028c Add deparse_code_with_fragments_and_map and simplify 2018-01-24 04:23:14 -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
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
f33f425692 Add is_pypy parameter to places that need it 2016-07-27 16:08:40 -04:00
rocky
3a78332d59 tok.format -> tok.__str__; simplify pypy code 2016-07-27 09:26:39 -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
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
08790ab0ab Make use of xdis routines in disassembly 2016-05-29 23:02:31 -04:00
rocky
4398b5b2e0 Use xdis for code, magics, and marshal 2016-05-27 19:18:06 -04:00
rocky
fbcdc7a181 Allow PyPy 2.7 opcodes and magic and ...
disas.py:
  * more aggressive code checking
magics.py:
  * Add PYPY magic
opcodes_27.py:
  * Add PYPY opcodes
2016-05-18 15:04: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
bb31629c35 pydisassemble disassemble without grammar mangling
Some other small cleanups as well
2016-05-15 13:55:21 -04:00
rocky
b82a8b90d5 Allow Python 3.5 to decomplyle other versions. No Python 3.5
bytecode support just yet though.
2015-12-30 23:46:29 -05:00
rocky
2e91de8355 Start using our replacement for inspect.iscode 2015-12-30 18:44:27 -05:00
rocky
6f0a252693 Add Python3 marshal codes and start to handle cross-version Python code
object types, introducing scan.Code3
2015-12-28 14:17:28 -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
ba5a6e790b dissasemble_file output is needed for pytest 2015-12-20 12:18:13 -05:00
rocky
7880e0d7b1 Go over makefiles to make "make check" work. walker, deparser: use zip_longest 2015-12-20 12:07:49 -05:00
rocky
f70641da5d disas.py: track load_module API change
opcode_23.py: make it more like opcode_27.py
2015-12-18 23:03:47 -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
e5f58e8ecb disas.py: Do better for finding/turning a .py file into a .pyc file
across supported versions of Python. Add for else list comprehension test
2015-12-18 08:47:30 -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
29f02edf79 Add spark grammar debugging. Start to comment grammer construct covered
by simple tests.
2015-12-17 12:44:40 -05:00
rocky
a362b47b15 Add LICENSE. Add demo programs and DRY code a little 2015-12-16 16:23:18 -05:00
rocky
9fecb48744 Tidy a little bit 2015-12-16 01:52:11 -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
3e31f41552 Closer to being able to handle Python 3.4 bytecode. Loading of Python
Python bytecode now works. magics from 3.3 to Python 3.4 has been added.
Some Python 3.4 scanner issues have been fixed.
2015-12-14 14:55:32 -05:00
rocky
f595f659ad Python3 compatibility: (disas, scanner*)
Reduce useless verbiage in status messages and DRY code a little;
__init__, uncompyle6
2015-12-14 08:38:51 -05:00
rocky
501060f87f need disas.py for cross version Python compiling
fixup MANIFEST.in
pythonlib.py: store expected python version and don't compile if it
mismatches. Work files now go in temp directory. Start masrhal load in
Python for Python3.
2015-12-13 10:31:05 -05:00
rocky
0af587064a Make uncompyle6 run on Python3.4 and Python 2.7
We don't need our own disassembler. Python's will do fine
2015-12-13 01:59:32 -05:00
rocky
003d485814 More Python3 compatability. Remove duplicate disassembly code and
get it from Python's standard library instead.
2015-12-12 08:37:20 -05:00
rocky
39842cef1f Lint stuff 2015-12-11 18:49:23 -05:00
rocky
d3c732298c Start process of making python3 compatible 2015-12-11 13:44:23 -05:00