Closed sinoST closed 8 months ago
thank you very much! how to using new opcode?
Can you make a pull request to support new opcode?
yeah, but 1st need to solve existing pending PR - https://github.com/zrax/pycdc/pull/411 if you have time & desire - please invest some time into it as well!
i wonder where i can put that bytecode (JUMP_BACKWARD
) in ASTree.cpp
?
I've got 2 ideas:
1) in the same case as Pyc::JUMP_ABSOLUTE_A
2) nearby the JUMP_FORWARD_A
- in the same case as
Pyc::JUMP_ABSOLUTE_A
- nearby the
JUMP_FORWARD_A
change in bytecode.cpp
and bytecode_ops.inl
too?
well, AFAIK pycdc already knows all the opcodes up to version 3.12 inclusive so those 2 mentioned modules should be already fine are you using the last master branch?
are you using the last master branch?
Yes, i'm using the last master branch.
- in the same case as
Pyc::JUMP_ABSOLUTE_A
Here,
/...
ifblk->init(popped);
blocks.push(ifblk.cast<ASTBlock>());
curblock = blocks.top();
}
break;
case Pyc::JUMP_BACKWARD:
case Pyc::JUMP_ABSOLUTE_A:
{
int offs = operand;
if (mod->verCompare(3, 10) >= 0)
offs *= sizeof(uint16_t); // // BPO-27129
if (offs < pos) {
/...
When i compiling:
ASTree.cpp
C:\Users\Admin\pycdc\ASTree.cpp(1172,13): error C2039: 'JUMP_BACKWARD': is not a member of 'Pyc' [C:\Users\Admin\pycdc\
pycdc.vcxproj]
C:\Users\Admin\pycdc\bytecode.h(5,11): message : see declaration of 'Pyc' [C:\Users\Admin\pycdc\pycdc.vcxproj]
C:\Users\Admin\pycdc\ASTree.cpp(1172,13): error C2065: 'JUMP_BACKWARD': undeclared identifier [C:\Users\Admin\pycdc\pyc
dc.vcxproj]
C:\Users\Admin\pycdc\ASTree.cpp(1172,3): error C2051: case expression not constant [C:\Users\Admin\pycdc\pycdc.vcxproj]
Done Building Project "C:\Users\Admin\pycdc\pycdc.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Admin\pycdc\pycdc.vcxproj" (default target) (1) ->
(ClCompile target) ->
C:\Users\Admin\pycdc\ASTree.cpp(1172,13): error C2039: 'JUMP_BACKWARD': is not a member of 'Pyc' [C:\Users\Admin\pycd
c\pycdc.vcxproj]
C:\Users\Admin\pycdc\ASTree.cpp(1172,13): error C2065: 'JUMP_BACKWARD': undeclared identifier [C:\Users\Admin\pycdc\p
ycdc.vcxproj]
C:\Users\Admin\pycdc\ASTree.cpp(1172,3): error C2051: case expression not constant [C:\Users\Admin\pycdc\pycdc.vcxpro
j]
0 Warning(s)
3 Error(s)
Time Elapsed 00:00:10.20
Now I add JUMP_BACKWARD
to bytecode_ops.inl
OPCODE(RETURN_GENERATOR) // Python 3.11 ->
OPCODE(ASYNC_GEN_WRAP) // Python 3.11
OPCODE(PREP_RERAISE_STAR) // Python 3.11
OPCODE(JUMP_BACKWARD) // Python 3.11, the one that missing.
OPCODE(INTERPRETER_EXIT) // Python 3.12 ->
OPCODE(END_FOR) // Python 3.12 ->
OPCODE(END_SEND) // Python 3.12 ->
Recompile pycdc
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:43.75
I tried with this pyc file
>pycdc.exe main.pyc
# Source Generated with Decompyle++
# File: main.pyc (Python 3.11)
Unsupported opcode: JUMP_BACKWARD
from keyauth import api
import sys
import time
import platform
import os
import hashlib
from time import sleep
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException, ElementNotInteractableException
from time import sleep
from colorama import Fore, Style, init
import ctypes
def clear():
Error decompyling main.pyc: invalid vector subscript
Am I missing something?
'JUMP_BACKWARD': is not a member of 'Pyc' -->> JUMP_BACKWARD_A
'JUMP_BACKWARD': is not a member of 'Pyc' -->> JUMP_BACKWARD_A
okay thank my bad, i'll try again
'JUMP_BACKWARD': is not a member of 'Pyc' -->> JUMP_BACKWARD_A
UPDATE:
- in the same case as
Pyc::JUMP_ABSOLUTE_A
pycdc.exe main.pyc # Source Generated with Decompyle++ # File: main.pyc (Python 3.11)
Warning: block stack is not empty! from keyauth import api import sys import time import platform import os import hashlib from time import sleep from datetime import datetime from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException, ElementNotInteractableException from time import sleep from colorama import Fore, Style, init import ctypes
def clear(): Error decompyling main.pyc: invalid vector subscript
> 2. nearby the `JUMP_FORWARD_A`
```py
>pycdc.exe main.pyc
# Source Generated with Decompyle++
# File: main.pyc (Python 3.11)
from keyauth import api
import sys
import time
import platform
import os
import hashlib
from time import sleep
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException, ElementNotInteractableException
from time import sleep
from colorama import Fore, Style, init
import ctypes
def clear():
Error decompyling main.pyc: invalid vector subscript
Opcode solved, but vector thing...
try to figure out where does that come from is it due to newly added opcode or it might be totally different issue not related at all..
Duplicate #452
this is my samples. sample.zip
C:\tools\pycdc-master\pycdc-master\Debug>pycdc.exe sample.pyc >> sample.py Unsupported opcode: JUMP_BACKWARD Error decompyling sample.pyc: invalid vector subscript
how did i solve this problem?