Commit Graph

453 Commits

Author SHA1 Message Date
Michael Hansen
4ecdd1f81b Remove unused python_NN_unmap() functions 2023-11-16 11:27:31 -08:00
Michael Hansen
0c6128a895 Add missing ACCESS_MODE opcode from Python 1.0-1.4 2023-11-16 11:16:46 -08:00
Michael Hansen
57e16d19d1 Refactor bc_next to more clearly split pre- and post-3.6 behavior 2023-11-16 11:16:46 -08:00
asas1asas200
9ab04e2c0b Fix CMP0148 warning in CMakeLists.txt (#400)
* Fix CMP0148 warning in CMakeLists.txt

* bump cmake minimum required to 3.12

* Fix var name to match  new Find module
2023-11-16 08:07:00 -08:00
Jack
5936412a6f fix #396 Unsupported Node type: 27 (#397)
* fix #396 Unsupported Node type: 27

* Add test file

* Modify a little comment

* Modify the test pyc file name

* Delete redundant pyc files

* retest

* Add newline at EOF

---------

Co-authored-by: Michael Hansen <zrax0111@gmail.com>
2023-11-11 10:22:49 -08:00
Michael Hansen
c7d3315156 Clarify prefix check on interned string type 2023-11-09 15:45:43 -08:00
Michael Hansen
21c35b2f4c Simplify PycDict key/value storage a bit 2023-11-09 15:05:55 -08:00
Michael Hansen
e27faa1e88 Remove unnecessary sequence interface on PycDict 2023-11-09 14:20:15 -08:00
Michael Hansen
9b384ad1fa Add basic bytecode and disassembly support for Python 3.12 2023-11-09 12:17:03 -08:00
TheHellTower
b32f231e33 Add GEN_START support (#392)
* Apparently should be enough ?

* Add `GEN_START` test

* Add `GEN_START` test compiled

* Add `GEN_START` test tokenized

* Smaller test since only POP is needed.

* Smaller test since only POP is needed.

* Smaller test since only POP is needed.

* dos2unix
2023-10-20 13:43:14 -07:00
Michael Hansen
d62c8adf89 Merge branch '3_11-support-for-new-opcodes' of https://github.com/TiZCrocodile/pycdc 2023-08-26 10:58:37 -07:00
Michael Hansen
b1a8563126 Merge pull request #378 from LNSSPsd/master
Fix the pointer's behavior on getting buffer from `PycBuffer`
2023-08-26 10:52:26 -07:00
Ruphane
9711a4abe5 Fix the pointer's behavior on getting buffer 2023-08-25 18:00:26 -07:00
Michael Hansen
f5c1d4262b Move comment closer to where it applies, plus some formatting consistency 2023-08-19 21:24:03 -07:00
Roman Avdeenko
916103179c Fix LOAD_GLOBAL_A operand printing for versions prior to 3.11 2023-08-19 17:43:04 +03:00
MrDakik
da859f5a2b Added support for opcodes: (in DESC)
`KW_NAMES`
`POP_JUMP_FORWARD_IF_FALSE`
`POP_JUMP_FORWARD_IF_TRUE`
`LOAD_GLOBAL`
2023-07-18 18:33:03 +03:00
Michael Hansen
bb54b27cd1 Move cmake_minimum_required to the top of CMakeLists, so it correctly affects everything else below it 2023-06-20 13:28:10 -07:00
Michael Hansen
753d42d94a Simplify string object printing to reduce code duplication 2023-06-09 09:09:03 -07:00
Michael Hansen
4b4f9f8edb Fix impossible condition in pycdas Code dump 2023-06-08 14:30:09 -07:00
Michael Hansen
32a0aec535 Use raw string literals to improve readability in OutputString 2023-06-06 11:20:32 -07:00
Michael Hansen
bf3599c87a Move some output stream parameters forward.
This allows us to avoid removing parameter defaults for these functions.
2023-06-05 13:56:25 -07:00
Michael Hansen
46ea76c0e9 Clean up file handling in main()s, and remove a leak 2023-06-05 13:54:26 -07:00
Michael Hansen
8bb8386764 Fix some issues with formatted_print:
* Add a va_list version which can be correctly used by ivprintf (fixes pycdas output)
* Use a `const char*` format parameter to avoid the need for clang warning workarounds
* Make better use of return values.
2023-06-05 13:49:04 -07:00
Michael Hansen
482c32d84e Merge commit 'c4c35fc5318b904d5141a7f3c4a70d80576c30da' 2023-06-05 11:18:20 -07:00
Michael Hansen
72c5f87793 Fix range of supported versions for marshalled files 2023-06-04 09:16:31 -07:00
Perceval Wajsbürt
c4c35fc531 Use C++ streams over C style IO 2023-06-02 01:12:59 +02:00
Michael Hansen
409f175827 Reduce code duplication for pre-3.11 binary ops, based on #348 2023-06-01 13:55:17 -07:00
Michael Hansen
90815b47ca Squash merge of #348
(Plus some whitespace cleanup)

commit ca302777438a6ac0ff00b9dbc87d2cf9e816b807
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 14:55:26 2023 -0400

    Test

commit 1764514e1dc4018abf050e2e2c3378b6ebaca2a2
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 14:46:49 2023 -0400

    Semi-Support

commit 104fa62355a18a071dae2d09db00af3b2fd22b6c
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 14:46:30 2023 -0400

    Semi-Support

commit 0809a71c725e3a92ece9348265f26f72fdb6664d
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 14:46:11 2023 -0400

    Semi-Support

commit bdf1695a57d2ad9eb1505a92ff4fa46c6f5ea90f
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 00:06:34 2023 -0400

    Updated Test

commit ea69a0b3be10568b70d02d744174e3bfc1d3546a
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 00:06:23 2023 -0400

    Updated Test

commit ecde2146208ea7a533267ace7293a49ce7a132bb
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Thu Jun 1 00:06:12 2023 -0400

    Updated Test

commit d5bbbe6224fc0aa8c5c3bc39b4f8845c8f941c7f
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 23:59:46 2023 -0400

    Feat: @zrax

    Co-authored-by: Michael Hansen <zrax0111@gmail.com>

commit f8d2299d14a3a0f69b40486006d629ccc5c719df
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 23:59:03 2023 -0400

    Feat: @zrax

    Co-authored-by: Michael Hansen <zrax0111@gmail.com>

commit 3fa8691f4c379dd10026227778ac60587fd07e68
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 23:58:53 2023 -0400

    Feat: @zrax

    Co-authored-by: Michael Hansen <zrax0111@gmail.com>

commit 6af17f0cffee31bc03ed8151e82b1720119d6a8d
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 23:58:45 2023 -0400

    Feat: @zrax

    Co-authored-by: Michael Hansen <zrax0111@gmail.com>

commit c7c76097fce1f45da0308b9f5e9cfffb5a323fd9
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 16:55:20 2023 -0400

    Remove `iostream`

commit 2edaec022f8cbcb36bffd7ec86b5f71b391fb372
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 16:54:48 2023 -0400

    Mistake

commit a36d4c5e62afe24691701f6d0b7c758b4113db91
Author: TheHellTower <thehelltower@tuta.io>
Date:   Wed May 31 16:52:12 2023 -0400

    Remove `iostream`

commit 1c3a5b02c95352a8e90247757df17d1563698fb6
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Wed May 31 16:43:30 2023 -0400

    Should be a bit better

commit 11603f1bb244c4d60ec34b675e1cd9c10945abf5
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Wed May 31 04:07:47 2023 -0400

    Update

commit 689b544fc1023ec60e4df257f3448064fdf84c2b
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Wed May 31 04:07:38 2023 -0400

    Update

commit 20bc5b820fb2ef6fd9199546e11ac02d78e5b6da
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Wed May 31 04:07:24 2023 -0400

    Update

commit c01e8251fac1577d25ab440ade4bfe2b42eb1860
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Wed May 31 04:05:28 2023 -0400

    Format problem ?

commit f35c494dd0d943323ec899cd8b2a236d11de67fc
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Wed May 31 04:02:03 2023 -0400

    Fix

commit 7f3265e4192e2b6eec81dc30a630691cead59694
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:57:01 2023 -0400

    BINARY_OP | Simplified

commit 045a6041f7a5abb7b5cdeaa4882b2620462e1927
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:56:53 2023 -0400

    BINARY_OP | Simplified

commit 0bfb76280e466e15c32ef42851d9981b9df57059
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:56:41 2023 -0400

    BINARY_OP | Simplified

commit 31159d69e8f802d7955244b258795563018c3eda
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:50:19 2023 -0400

    Fix Matching...

commit e4a978aeadebe9c574856c30928ec58da9e32639
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:50:06 2023 -0400

    Fix Matching...

commit d7a1b25b8f85886fcdc0a7c10c885e7e9e011281
Author: TheHellTower <thehelltower@tuta.io>
Date:   Mon May 29 00:41:43 2023 -0400

    Add `BINARY_OP` support

commit 6527299a67f043eb2b63e13ae43c4e9f060456e2
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:40:32 2023 -0400

    Add `BINARY_OP` test tokenized

commit c053cab7895f49a085a0797a98e28e87f4874d39
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:40:11 2023 -0400

    Add `BINARY_OP` test

commit e32f006f90a4e450099edd7d2f0bdbb0f1bbc612
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date:   Mon May 29 00:39:53 2023 -0400

    Add `BINARY_OP` test compiled

Closes #333
Closes #348

Co-authored-by: TheHellTower <dontbeshybuddy@gmail.com>
2023-06-01 13:21:23 -07:00
Michael Hansen
ee934a1e99 Show binary ops from Python 3.11 in disassembly 2023-05-30 14:45:22 -07:00
Michael Hansen
0710ea07f1 Fix missing includes, which fixes build on GCC 13+ 2023-05-07 13:28:10 -07:00
Michael Hansen
c8156739f1 Merge pull request #344 from seashell11234455/master
Fix unicode string display bug
2023-04-27 08:51:58 -07:00
FeO3
006b3e4bbc Fix unicode string display bug 2023-04-27 20:40:06 +08:00
Michael Hansen
2e76e56420 Fixup unrelated changes from PR 2023-02-28 15:49:12 -08:00
TheHellTower
4d81a16638 Add PUSH_NULL, PRECALL_A, CALL_A support (#324)
* Add `PUSH_NULL`, `PRECALL_A`, `CALL_A` support

* feat: @zrax

Co-authored-by: Michael Hansen <zrax0111@gmail.com>

* Good suggested change to make the code shorter

* Add `PUSH_NULL`, `PRECALL`, `CALL` test tokenized

* Add `PUSH_NULL`, `PRECALL`, `CALL` test

* Add `PUSH_NULL`, `PRECALL`, `CALL` test compiled

* Delete push_null-precall-call.3.11.pyc

* Delete push_null-precall-call.py

* Delete push_null-precall-call.txt

* Update README.markdown

Blank commit to re-run the tests.

* Join all no-ops/"fake"-ops together

* Update ASTree.cpp

https://github.com/zrax/pycdc/pull/324#issuecomment-1449049283

* Add compiled test for #324

---------

Co-authored-by: Michael Hansen <zrax0111@gmail.com>
2023-02-28 15:48:33 -08:00
Michael Hansen
f4db6a7cf6 Update CodeQL configuration 2023-02-27 13:12:11 -08:00
Michael Hansen
e922c1c224 Merge pull request #325 from zrax/test_calls
Add unit test for basic function calls (py3)
2023-02-27 12:04:36 -08:00
Michael Hansen
9f747e188c Add unit test for basic function calls (py3) 2023-02-27 11:59:01 -08:00
Michael Hansen
00d436f87d Reduce code duplication between PycSet/PycTuple/PycList 2023-02-16 22:10:44 -08:00
Michael Hansen
1fcbf4cd4b Keep PycSet objects marshalled from files in order too 2023-02-16 22:01:31 -08:00
Michael Hansen
ded8adfba2 Merge pull request #319 from Ace314159/add-set-ops
Implement BUILD_SET and SET_UPDATE
2023-02-16 21:52:42 -08:00
Akash Munagala
ca73f05830 Print out frozenset in disasm too 2023-02-13 19:33:25 -08:00
Akash Munagala
80e835e197 Properly output frozenset object in pycdas 2023-02-13 19:26:30 -08:00
Akash Munagala
f00921d3d3 Use deque instead of set 2023-02-13 19:25:45 -08:00
Akash Munagala
66c46661d9 Add test 2023-02-12 17:01:37 -08:00
Akash Munagala
aaad868445 Implement BUILD_SET and SET_UPDATE 2023-02-12 16:21:20 -08:00
Michael Hansen
a6de2209fc Add simple_const tests for Python 3.8-3.11, and handle Python 3.11 RESUME opcode 2023-01-24 10:25:10 -08:00
Michael Hansen
60e4eb6316 Handle CACHE instructions in decompyle, and suppress them in disassembly by default.
Showing CACHE instructions and the extra PyCode fields in pycdas is now
controlled by command-line arguments.
2023-01-19 14:50:55 -08:00
Michael Hansen
5d855f0bd2 Fix LOAD_GLOBAL and cell var references in Python 3.11+ 2023-01-19 13:05:06 -08:00
Michael Hansen
379c0c94d0 Merge <3.11 VarNames and >=3.11 Locals+Names into a single variable for simplicity.
Also cleans up some extra verbose output by making extra PyCode fields optional
2023-01-19 11:32:07 -08:00
Michael Hansen
dfb0a976c5 Add additional Code object fields to disassembly output. 2023-01-19 11:32:07 -08:00