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
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
753d42d94a
Simplify string object printing to reduce code duplication
2023-06-09 09:09:03 -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
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 ca30277743
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 14:55:26 2023 -0400
Test
commit 1764514e1d
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 14:46:49 2023 -0400
Semi-Support
commit 104fa62355
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 14:46:30 2023 -0400
Semi-Support
commit 0809a71c72
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 14:46:11 2023 -0400
Semi-Support
commit bdf1695a57
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 00:06:34 2023 -0400
Updated Test
commit ea69a0b3be
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 00:06:23 2023 -0400
Updated Test
commit ecde214620
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Thu Jun 1 00:06:12 2023 -0400
Updated Test
commit d5bbbe6224
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 f8d2299d14
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 3fa8691f4c
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 6af17f0cff
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 c7c76097fc
Author: TheHellTower <thehelltower@tuta.io>
Date: Wed May 31 16:55:20 2023 -0400
Remove `iostream`
commit 2edaec022f
Author: TheHellTower <thehelltower@tuta.io>
Date: Wed May 31 16:54:48 2023 -0400
Mistake
commit a36d4c5e62
Author: TheHellTower <thehelltower@tuta.io>
Date: Wed May 31 16:52:12 2023 -0400
Remove `iostream`
commit 1c3a5b02c9
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Wed May 31 16:43:30 2023 -0400
Should be a bit better
commit 11603f1bb2
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Wed May 31 04:07:47 2023 -0400
Update
commit 689b544fc1
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Wed May 31 04:07:38 2023 -0400
Update
commit 20bc5b820f
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Wed May 31 04:07:24 2023 -0400
Update
commit c01e8251fa
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Wed May 31 04:05:28 2023 -0400
Format problem ?
commit f35c494dd0
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Wed May 31 04:02:03 2023 -0400
Fix
commit 7f3265e419
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:57:01 2023 -0400
BINARY_OP | Simplified
commit 045a6041f7
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:56:53 2023 -0400
BINARY_OP | Simplified
commit 0bfb76280e
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:56:41 2023 -0400
BINARY_OP | Simplified
commit 31159d69e8
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:50:19 2023 -0400
Fix Matching...
commit e4a978aead
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:50:06 2023 -0400
Fix Matching...
commit d7a1b25b8f
Author: TheHellTower <thehelltower@tuta.io>
Date: Mon May 29 00:41:43 2023 -0400
Add `BINARY_OP` support
commit 6527299a67
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:40:32 2023 -0400
Add `BINARY_OP` test tokenized
commit c053cab789
Author: TheHellTower <dontbeshybuddy@gmail.com>
Date: Mon May 29 00:40:11 2023 -0400
Add `BINARY_OP` test
commit e32f006f90
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
0710ea07f1
Fix missing includes, which fixes build on GCC 13+
2023-05-07 13:28:10 -07: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
Akash Munagala
f00921d3d3
Use deque instead of set
2023-02-13 19:25:45 -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
TheHellTower
a3e5ebd481
Add GET_YIELD_FROM_ITER support ( #312 )
2023-01-19 10:51:08 -08:00
Michael Hansen
ffeabc3d3f
Make cast() checked by default and add try_cast() for cases where a cast
...
is not required to be successful.
2022-12-01 16:13:31 -08:00
Michael Hansen
305494c4b2
Fix unintentional method shadowing in ASTAnnotatedVar
2022-12-01 16:03:09 -08:00
Michael Hansen
e623e9ac56
For String Refs, inherit the type of the reffed string object.
2022-12-01 11:42:31 -08:00
Michael Hansen
747921a761
Adjust to reduce duplication
2022-10-04 15:19:15 -07:00
Michael Hansen
e2db195b85
Merge from #267
2022-10-04 15:18:35 -07:00
Michael Hansen
4951905f83
Remove dead code from a previous version of this block.
...
Fixes #282
2022-09-30 10:07:44 -07:00
Adrian Haensler
462260991e
fix for loops in 3.8
2022-07-08 20:25:13 -05:00
Adrian Haensler
882571c599
some fixes for 3.9
2022-07-08 17:45:07 -05:00
TrollerOfHolland
25497aabb3
ASTree.cpp bugfix on line 1757, preventing error 'front called on empty vector'
2022-06-23 01:16:41 +02:00
Michael Hansen
b0fa45840f
Minor code style cleanups for consistency
2022-04-26 12:56:19 -07:00
Nenad Čaklović
38a1ee59c3
Support for conditonal expression (if-expression) - review findings
2022-04-02 13:57:10 +02:00
Nenad Čaklović
46affe279c
Support for conditonal expression (if-expression)
2022-03-29 12:30:06 +02:00
Nenad Čaklović
7160cf796c
Changes in 3.10 under BPO-27129: Use instruction offset, rather than bytecode offset
2022-03-24 20:59:15 +01:00
John Richards
25f44aa079
Adds support for CONTAINS_OP opcode
...
Mentioned in:
- #190
- #191
- #195
2021-10-10 00:40:39 -04:00
John Richards
9fcf5bcb9d
Addresses code review comment
2021-10-09 22:35:33 -04:00
John Richards
588f24c872
Adds support for IS_OP opcode
...
Mentioned in:
- #190
- #191
- #195
2021-10-07 20:29:18 -04:00
John Richards
a504452b7b
Adds support for LIST_EXTEND opcode
...
Addresses #199
2021-10-07 01:51:53 -04:00
Michael Hansen
ac189cc916
Support LOAD_METHOD and CALL_METHOD from Python 3.7+
...
Fixes #163
2021-04-12 09:55:52 -07:00
Aralox
bd7439485f
CRA
2020-10-26 15:18:43 +11:00
Aralox
23beda48d7
CRAs
2020-10-26 15:15:45 +11:00
Aralox
7a89b72260
Support chained assignment statements, e.g. a = b = c.
...
We know when we have begun a chained assignment when we process a DUP_TOP with non-null on the stack. Push a NODE_CHAINSTORE onto the stack when this happens, and keep it 'floating' on top of the stack for all STORE_X operations until the stack is empty.
To support versions of Python <= 2.5 which use DUP_TOP in more places, I modified ROT_TWO, ROT_THREE and ROT_FOUR to get rid of NODE_CHAINSTORE on the stack if it is present.
2020-10-23 21:19:01 +11:00
Aralox
8e8bb95592
Support unpacking empty list.
...
If UNPACK_SEQUENCE with operand 0 is encountered, treat it like a STORE_X and either assign the TOS to it or set it as the for-loop index.
Issue #183 .
2020-10-23 11:23:46 +11:00
Michael Hansen
8eb18de269
Update tests to show that #39 is resolved, and add dummy support for
...
STORE_LOCALS used in Python 3.0-3.3.
Closes #39
Closes #63
2020-10-22 09:06:57 -07:00
Michael Hansen
0540b3991c
Merge pull request #181 from Aralox/Issue-124-handle-async-for-GET_AITER_GET_ANEXT
...
Add support for `async for`
2020-10-22 08:24:56 -07:00
John Richards
7ba44361fe
Addresses code review comments
2020-10-21 23:45:51 -04:00
John Richards
345035b544
Adds support for SETUP_ANNOTATION op and variable annotations
...
Tests have also been added.
Fixes #169
2020-10-21 21:42:13 -04:00
Aralox
abf8501ccf
CRAs
2020-10-22 10:57:49 +11:00
Aralox
e80aa996fa
Only initialize the async for once.
2020-10-22 09:11:51 +11:00
Aralox
5bdc0b5baf
Merge remote-tracking branch 'upstream/master' into Issue-124-handle-async-for-GET_AITER_GET_ANEXT
...
Conflicts:
ASTree.cpp
2020-10-21 19:34:37 +11:00
Aralox
91a23f914d
Implement better handling for async for.
...
Instead of ignoring boilerplate when decompiling `async for`, build the loop semantically by deconstructing the BLK_WHILE -> BLK_CONTAINER -> BLK_TRY that python generates when compiling an `async for` (see https://www.python.org/dev/peps/pep-0492/#asynchronous-iterators-and-async-for ).
When reading GET_AITER, convert the BLK_WHILE into a BLK_ASYNCFOR in the same way as a `for` loop.
Ignore GET_ANEXT.
Use END_FINALLY as the trigger to finish building the BLK_ASYNCFOR:
-> Extract the loop variable from the contents of the BLK_TRY.
-> Throw away the BLK_TRY and BLK_CONTAINER, leave the BLK_ASYNCFOR on top of the stack.
2020-10-21 19:32:20 +11:00
Michael Hansen
d3a46f711f
Merge remote-tracking branch 'dotjrich/issue-172' into master
2020-10-20 21:10:55 -07:00
Michael Hansen
568867c80a
Minor style adjustments
2020-10-20 21:08:02 -07:00