pycdc icon indicating copy to clipboard operation
pycdc copied to clipboard

Support new opcodes

Open whoami730 opened this issue 5 months ago • 7 comments

Adds support for below opcodes with tests - [x] LOAD_FAST_CHECK [x] CALL_INTRINSIC_1 - INTRINSIC_LIST_TO_TUPLE [x] CALL_FUNCTION_EX

Updates existing LIST_EXTEND implementation with tests

whoami730 avatar Jul 13 '25 16:07 whoami730

Thanks for the review @zrax , I have updated the PR.

whoami730 avatar Jul 16 '25 09:07 whoami730

Source Generated with Decompyle++

File: QMXQ.pyc (Python 3.13)

Unimplemented function 2Unimplemented function 2Unimplemented function 2Unsupported opcode: MAKE_FUNCTION (122) import pygame import random import copy import json import os import time import math from OpenGL.GL.shaders import compileProgram, compileShader import numpy import csv import locale import sys dise = (45, 50, 50) xitong = sys.platform

WARNING: Decompyle incomplete

I encountered this problem, how can I solve it?

dasabi45 avatar Jul 21 '25 05:07 dasabi45

Below are the errors @dasabi45

Unimplemented function 2 Unimplemented function 2 Unimplemented function 2 Unsupported opcode: MAKE_FUNCTION (122)

I believe function 2 is INTRINSIC_IMPORT_STAR. You need to add implementation for whatever's missing... I believe all you need to do here is create an ASTImport object or something...

whoami730 avatar Jul 21 '25 10:07 whoami730

Hi @zrax any updates here would be appreciated, thanks!

whoami730 avatar Jul 29 '25 12:07 whoami730

Sir, I've encoutered an C++ exception

            'type': self.upgrade_type })


    def terminate(self, error = (False,)):
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast

Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
warning: 44     ./nptl/pthread_kill.c: No such file or directory
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7b3b27e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7b1e8ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7ddbff5 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff7df10da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff7ddba55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007ffff7df1391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x0000555555587e26 in PycRef<ASTBlock>::cast<ASTContainerBlock> (this=0x7fffffffb5a0) at /mnt/d/Workspaces/new_pycdc/pycdc/pyc_object.h:85
#10 0x0000555555563845 in BuildFromCode (code=..., mod=0x7fffffffcbe0) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:857
#11 0x000055555557f813 in decompyle (code=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3559
#12 0x000055555557b0ef in print_src (node=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3153
#13 0x000055555557cdbe in print_src (node=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3383
#14 0x000055555557a95b in print_src (node=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3094
#15 0x0000555555580910 in decompyle (code=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3646
#16 0x000055555557b0ef in print_src (node=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3153
#17 0x000055555557d1ab in print_src (node=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3409
#18 0x000055555557a95b in print_src (node=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3094
#19 0x0000555555580910 in decompyle (code=..., mod=0x7fffffffcbe0, pyc_output=...) at /mnt/d/Workspaces/new_pycdc/pycdc/ASTree.cpp:3646
#20 0x000055555555c0e5 in main (argc=2, argv=0x7fffffffcfb8) at /mnt/d/Workspaces/new_pycdc/pycdc/pycdc.cpp:97

NyaMisty avatar Aug 29 '25 05:08 NyaMisty

@NyaMisty can you please share the pyc file? it's hard to investigate without the file.

whoami730 avatar Aug 29 '25 08:08 whoami730

@zrax I think the tests here should mostly cover the new changes. Hope you can get it expedited? Thanks!

whoami730 avatar Nov 01 '25 09:11 whoami730