"Error: vector" on Python 3.11-compiled code
# Source Generated with Decompyle++
# File: server.pyc (Python 3.11)
Error decompyling server.pyc: vector
Sample File: server.txt (extension changed to txt instead of original pyc)
There are too many bytecodes in your pyc file, which makes analysis more difficult. If this error is reported, it should be that the array is out of bounds.
case Pyc::LOAD_GLOBAL_A:
if (mod->verCompare(3, 11) >= 0) {
if (operand & 1) {
/* Changed in version 3.11:
If the low bit of "NAMEI" (operand) is set,
then a NULL is pushed to the stack before the global variable. */
stack.push(nullptr);
/*
and thats because for some reason for example 3 global functions: input, int, print.
it tries to load: 1, 3, 5
all though we have only 3 names, so thats should be: (1-1)/2 = 0, (3-1)/2 = 1, (5-1)/2 = 2
i dont know why, maybe because of the null push, but thats a FIX for now.
*/
operand = (int)((operand - 1) / 2);
}
}
stack.push(new ASTName(code->getName(operand)));
This place attempts to obtain global variables, and the operand obtained is 458, but the length of the entire array is only 251, so it is out of bounds. Hope someone fixes it
@ddouworld Thanks for your help. Now I see where to look from, and if I have time I would try to fix this.
same isssue
There is an issue with handling JUMP_FORWARD opcode in the routine named getConfig()
1362 JUMP_FORWARD 3 (to 1370)
and some others...
also please note these opcodes still were not hanlded:
Warning: block stack is not empty!
Unsupported opcode: COPY
Unsupported opcode: SWAP
Unsupported opcode: COPY
Unsupported opcode: MAKE_CELL
Unsupported opcode: COPY
Unsupported opcode: MAKE_CELL
Unsupported opcode: MAKE_CELL
Unsupported opcode: SWAP
Unsupported opcode: MAKE_CELL
Unsupported opcode: COPY
Unsupported opcode: COPY
Unsupported opcode: COPY
Unsupported opcode: POP_JUMP_BACKWARD_IF_TRUE
Unsupported opcode: POP_JUMP_BACKWARD_IF_TRUE
Unsupported opcode: POP_JUMP_BACKWARD_IF_TRUE
Unsupported opcode: POP_JUMP_BACKWARD_IF_TRUE
Unsupported opcode: COPY
Unsupported opcode: POP_JUMP_BACKWARD_IF_TRUE
Unsupported opcode: COPY
Unsupported opcode: COPY
Unsupported opcode: COPY
I"m not sure how to implement COPY and SWAP opcodes that are working directly with the stack object
According to opcode logic they are doing something that violates stack paradigm principle:
anyway, here is my current decompilation result, though it is not 100% full, sorry
but I hope it'll help to fill in missed gaps!
https://www.sendspace.com/file/665viw del https://www.sendspace.com/delete/665viw/ce7dcfe54da0b68ec639eae4432dcb8e
Do you have a time frame on getting this fixed? I am also seeing the same errors:
Source Generated with Decompyle++
File: Spirit_Calc.pyc (Python 3.11)
Unsupported opcode: JUMP_BACKWARD
Error decompyling <program_name>: vector
any sample python for this?
I am also facing the same problem... someone please fix this 😫
Should be fixed with #462