-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported opcode: SWAP #417
Comments
attach your sample for the beginning :) |
unfortunately for the sake of my friend's privacy, I don't think I can do so, sucks. |
well, then the only option is to sit and wait... |
Source Generated with Decompyle++File: test.pyc (Python 3.11)def a(): WARNING: Decompyle incompleteSWAP demo |
def a(): 26 0 RESUME 0 27 2 LOAD_CONST 1 ('') 28 10 LOAD_FAST 0 (dir) 29 14 LOAD_FAST 1 (path) 30 >> 22 LOAD_CONST 0 (None) SWAP demo |
I solved it myself and modified the source code to support the directive |
great news! |
Let swap press the stack, I've fixed about 10 py3.11 commands myself so far. try: |
Hmm the standard python doc says something else about how exactly SWAP opcode behaves: |
I tried to write according to the document, and found that it did not show the expected results, so I gave up, and directly pressed into the empty stack to parse normally. |
OK, your impl looks valid one could agree with pushing NULL when the opcode is COPY (similar to SWAP)... |
I'm still working on the parsing of try, try: |
Python 3.11 uses totally different scheme known as "zero-cost" exception handling. I guess you have to start parsing/using the exception table present in pyc structure |
I guess it is good idea to read some theory - it is inside Python sources in teh following path: |
I saw in other posts that you have solved the problem, can you tell me how to solve it? Share the code def a(): |
Please help me to solve this PR - #411 |
Duplicate #452 |
Hi, I tried using this tool to help a friend with a .pyc file that was written in Python 3.11.4 and I got an error that about the SWAP opcode being unsupported.
I found a suggestion here to try and comment out a line in ASTree.cpp to make the decompiler not stop the moment it sees an unsupported opcode, but that gives me a "bad cast" error instead.
What can I do?
The text was updated successfully, but these errors were encountered: