Closed D1ag0n-Young closed 2 years ago
seems python 3.8 not support for param announcement
with |
i will remove it for compatibility
def extract_arch(arch: CArchiveReader | ZlibArchive, current_directory: str):
pass
➜ testpydumpck pydumpck ./exp
Traceback (most recent call last):
File "/home/yrl/.local/bin/pydumpck", line 5, in <module>
from pydumpck import run
File "/home/yrl/.local/lib/python3.8/site-packages/pydumpck/__init__.py", line 8, in <module>
from .pyinstaller_dump import run as run_main
File "/home/yrl/.local/lib/python3.8/site-packages/pydumpck/pyinstaller_dump.py", line 215, in <module>
class PackageDescription:
File "/home/yrl/.local/lib/python3.8/site-packages/pydumpck/pyinstaller_dump.py", line 219, in PackageDescription
arch: CArchiveReader | ZlibArchive = None
TypeError: unsupported operand type(s) for |: 'type' and 'type'
I reinstalled 1.1.27, still the same error
fixed in v1.3.35
➜ testpydumpck pydumpck exp
Traceback (most recent call last):
File "/home/yrl/.local/bin/pydumpck", line 8, in <module>
sys.exit(run())
File "/home/yrl/.local/lib/python3.8/site-packages/pydumpck/__init__.py", line 11, in run
CommonDump.main()
TypeError: main() missing 3 required positional arguments: 'self', 'target_file', and 'output_directory'
➜ testpydumpck pydumpck ./exp --output .
Traceback (most recent call last):
File "/home/yrl/.local/bin/pydumpck", line 8, in <module>
sys.exit(run())
File "/home/yrl/.local/lib/python3.8/site-packages/pydumpck/__init__.py", line 11, in run
CommonDump.main()
TypeError: main() missing 3 required positional arguments: 'self', 'target_file', and 'output_directory'
I reinstalled 1.3.35, still having problems Do you have any special requirements for the environment?
finally , we update to 1.5.92
, solve all this above.
see build & test
The program can run, but there seems to be an error when compiling pycdc
root@6043bc9e028d:~# pydumpck ./exp -p pycdc
plugins loaded with ['pycdc']
[*] target file input:./exp
to:output_8409477
[*] start dump target file.
[+] struct file found b'U\r\r\n\x00\x00\x00\x00\xf0\x840b\x01\x01\x00\x00'
export pyc
[*] dumping source file:27/27
decompile pyc
[!] pycdc_file not exist , trying build it...
[!] pycdc_file not exist , trying build it...
[!] pycdc_file not exist , trying build it...
[!] pycdc_file not exist , trying build it...
[*] decompile source file:0/8[!] Exception on decompile bytecode output_8409477/pyimod01_os_path.pyc [Errno 17] File exists: '/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/.vs/pycdc/v17/ipch'
[!] pycdc_file not exist , trying build it...
-- The C compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_a8411/fast && make: *** No rule to make target 'cmTC_a8411/fast'. Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeOutput.log".
See also "/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeError.log".
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_1cb8b/fast && make: *** No rule to make target 'cmTC_1cb8b/fast'. Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeOutput.log".
See also "/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeError.log".
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
make: *** No targets specified and no makefile found. Stop.
[!] Exception on decompile bytecode output_8409477/pyi_rth_subprocess.pyc [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/pycdc'
[!] pycdc_file not exist , trying build it...
make: *** No targets specified and no makefile found. Stop.
[!] Exception on decompile bytecode output_8409477/struct.pyc [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/pycdc'
[!] pycdc_file not exist , trying build it...
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake:45 (try_compile):
Failed to configure test project build system.
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:74 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeOutput.log".
See also "/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found. Stop.
[!] Exception on decompile bytecode output_8409477/pyimod02_archive.pyc [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/pycdc'
[!] pycdc_file not exist , trying build it...
[*] decompile source file:4/8-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.10")
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output
[ 2%] Generating bytes/python_10.cpp, bytes/python_11.cpp, bytes/python_13.cpp, bytes/python_14.cpp, bytes/python_15.cpp, bytes/python_16.cpp, bytes/python_20.cpp, bytes/python_21.cpp, bytes/python_22.cpp, bytes/python_23.cpp, bytes/python_24.cpp, bytes/python_25.cpp, bytes/python_26.cpp, bytes/python_27.cpp, bytes/python_30.cpp, bytes/python_31.cpp, bytes/python_32.cpp, bytes/python_33.cpp, bytes/python_34.cpp, bytes/python_35.cpp, bytes/python_36.cpp, bytes/python_37.cpp, bytes/python_38.cpp, bytes/python_39.cpp, bytes/python_310.cpp
Scanning dependencies of target pycxx
[ 4%] Building CXX object CMakeFiles/pycxx.dir/bytecode.cpp.o
[*] decompile source file:4/8-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output
[ 2%] Generating bytes/python_10.cpp, bytes/python_11.cpp, bytes/python_13.cpp, bytes/python_14.cpp, bytes/python_15.cpp, bytes/python_16.cpp, bytes/python_20.cpp, bytes/python_21.cpp, bytes/python_22.cpp, bytes/python_23.cpp, bytes/python_24.cpp, bytes/python_25.cpp, bytes/python_26.cpp, bytes/python_27.cpp, bytes/python_30.cpp, bytes/python_31.cpp, bytes/python_32.cpp, bytes/python_33.cpp, bytes/python_34.cpp, bytes/python_35.cpp, bytes/python_36.cpp, bytes/python_37.cpp, bytes/python_38.cpp, bytes/python_39.cpp, bytes/python_310.cpp
Scanning dependencies of target pycxx
[ 4%] Building CXX object CMakeFiles/pycxx.dir/bytecode.cpp.o
[ 7%] Building CXX object CMakeFiles/pycxx.dir/data.cpp.o
[ 9%] Building CXX object CMakeFiles/pycxx.dir/pyc_code.cpp.o
[ 9%] Building CXX object CMakeFiles/pycxx.dir/pyc_code.cpp.o
[ 12%] Building CXX object CMakeFiles/pycxx.dir/pyc_module.cpp.o
[*] decompile source file:4/8[ 12%] Building CXX object CMakeFiles/pycxx.dir/pyc_module.cpp.o
[ 14%] Building CXX object CMakeFiles/pycxx.dir/pyc_numeric.cpp.o
[ 14%] Building CXX object CMakeFiles/pycxx.dir/pyc_numeric.cpp.o
[ 17%] Building CXX object CMakeFiles/pycxx.dir/pyc_object.cpp.o
[ 17%] Building CXX object CMakeFiles/pycxx.dir/pyc_object.cpp.o
[ 19%] Building CXX object CMakeFiles/pycxx.dir/pyc_sequence.cpp.o
[*] decompile source file:4/8[ 19%] Building CXX object CMakeFiles/pycxx.dir/pyc_sequence.cpp.o
[ 21%] Building CXX object CMakeFiles/pycxx.dir/pyc_string.cpp.o
[ 21%] Building CXX object CMakeFiles/pycxx.dir/pyc_string.cpp.o
[ 24%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_10.cpp.o
[ 24%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_10.cpp.o
[ 26%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_11.cpp.o
[*] decompile source file:4/8[ 26%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_11.cpp.o
[ 29%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_13.cpp.o
[ 29%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_13.cpp.o
[ 31%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_14.cpp.o
[ 31%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_14.cpp.o
[ 34%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_15.cpp.o
[*] decompile source file:4/8[ 34%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_15.cpp.o
[ 36%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_16.cpp.o
[ 36%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_16.cpp.o
[ 39%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_20.cpp.o
[ 39%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_20.cpp.o
[ 41%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_21.cpp.o
[ 41%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_21.cpp.o
[*] decompile source file:4/8[ 43%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_22.cpp.o
[ 43%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_22.cpp.o
[ 46%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_23.cpp.o
[ 46%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_23.cpp.o
[ 48%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_24.cpp.o
[ 48%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_24.cpp.o
[ 51%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_25.cpp.o
[*] decompile source file:4/8[ 51%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_25.cpp.o
[ 53%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_26.cpp.o
[ 53%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_26.cpp.o
[ 56%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_27.cpp.o
[ 56%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_27.cpp.o
[ 58%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_30.cpp.o
[*] decompile source file:4/8[ 58%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_30.cpp.o
[ 60%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_31.cpp.o
[ 60%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_31.cpp.o
[ 63%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_32.cpp.o
[ 63%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_32.cpp.o
[ 65%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_33.cpp.o
[*] decompile source file:4/8[ 65%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_33.cpp.o
[ 68%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_34.cpp.o
[ 70%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_35.cpp.o
[ 70%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_35.cpp.o
[ 73%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_36.cpp.o
[ 73%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_36.cpp.o
[ 75%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_37.cpp.o
[ 75%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_37.cpp.o
[*] decompile source file:4/8[ 78%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_38.cpp.o
[ 78%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_38.cpp.o
[ 80%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_39.cpp.o
[ 80%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_39.cpp.o
[ 82%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_310.cpp.o
[ 82%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_310.cpp.o
[ 85%] Linking CXX static library libpycxx.a
[*] decompile source file:4/8[ 85%] Built target pycxx
[ 85%] Linking CXX static library libpycxx.a
Scanning dependencies of target pycdc
[ 87%] Building CXX object CMakeFiles/pycdc.dir/pycdc.cpp.o
[ 87%] Built target pycxx
[ 87%] Building CXX object CMakeFiles/pycdc.dir/pycdc.cpp.o
[ 90%] Building CXX object CMakeFiles/pycdc.dir/ASTree.cpp.o
[ 90%] Building CXX object CMakeFiles/pycdc.dir/ASTree.cpp.o
[*] decompile source file:4/8[ 92%] Building CXX object CMakeFiles/pycdc.dir/ASTNode.cpp.o
[ 92%] Building CXX object CMakeFiles/pycdc.dir/ASTNode.cpp.o
[ 95%] Linking CXX executable pycdc
[ 95%] Linking CXX executable pycdc
[ 95%] Built target pycdc
Scanning dependencies of target pycdas
[ 97%] Building CXX object CMakeFiles/pycdas.dir/pycdas.cpp.o
[ 97%] Built target pycdc
[ 97%] Building CXX object CMakeFiles/pycdas.dir/pycdas.cpp.o
[*] decompile source file:4/8[100%] Linking CXX executable pycdas
[100%] Linking CXX executable pycdas
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/pycdas.dir/build.make:85: pycdas] Error 1
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/pycdas.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Error opening link script "CMakeFiles/pycdas.dir/link.txt"
make[2]: *** [CMakeFiles/pycdas.dir/build.make:85: pycdas] Error 1
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/pycdas.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
[!] Exception on decompile bytecode output_8409477/pyimod03_importers.pyc [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/src/output/pycdc'
[*] detect pycdc_file not executable,try auth:/usr/local/lib/python3.8/dist-packages/pydumpck/pyc_checker/lib_pycdc/pycdc
[!] decompile bytecode by pycdc fail output_8409477/pyimod04_ctypes.pyc CreateObject: Got unsupported type 0x40
Error loading file output_8409477/pyimod04_ctypes.pyc.structed.pyc: std::bad_cast
[!] fail to decompile bytecode output_8409477/pyimod04_ctypes.pyc CreateObject: Got unsupported type 0x40
Error loading file output_8409477/pyimod04_ctypes.pyc.structed.pyc: std::bad_cast
[*] decompile source file:6/8Traceback (most recent call last):
File "/usr/local/bin/pydumpck", line 8, in <module>
sys.exit(run())
File "/usr/local/lib/python3.8/dist-packages/pydumpck/pyinstaller_dump.py", line 93, in run
return dmp.main(**vars(args))
File "/usr/local/lib/python3.8/dist-packages/pydumpck/py_common_dump/__init__.py", line 101, in main
result = self.action_dispatch[dispatch_to](target_file)
File "/usr/local/lib/python3.8/dist-packages/pydumpck/py_common_dump/__init__.py", line 57, in handle_arch_file
self.file_struct_pyc.progress_check()
File "/usr/local/lib/python3.8/dist-packages/pydumpck/py_package/package_struct/__init__.py", line 89, in progress_check
self.progress_check_pyc_decompile() # decompile pyc
File "/usr/local/lib/python3.8/dist-packages/pydumpck/py_package/package_struct/__init__.py", line 55, in progress_check_pyc_decompile
return self.progress_waitter('decompile source file')
File "/usr/local/lib/python3.8/dist-packages/pydumpck/py_package/package_struct/__init__.py", line 66, in progress_waitter
raise Exception(f'{t}\n{c}\n')
Exception: timeout:from 1653538376.3645818 to 1653538496.6327944
cost:120.26821255683899,timeout=120
It's working fine now, thanks a lot
[+] decompile bytecode by pycdc success output_9027479/PYZ-00.pyz_extract/xmlrpc/__init__.pyc 1
[+] decompile bytecode output_9027479/PYZ-00.pyz_extract/xmlrpc/__init__.pyc 1
[+] decompile bytecode by pycdc success output_9027479/PYZ-00.pyz_extract/xmlrpc/client.pyc 30773
[+] decompile bytecode output_9027479/PYZ-00.pyz_extract/xmlrpc/client.pyc 30773
[+] decompile bytecode by pycdc success output_9027479/PYZ-00.pyz_extract/yourpy.pyc 1703
[+] decompile bytecode output_9027479/PYZ-00.pyz_extract/yourpy.pyc 1703
[+] decompile bytecode by pycdc success output_9027479/PYZ-00.pyz_extract/zipfile.pyc 64530
[+] decompile bytecode output_9027479/PYZ-00.pyz_extract/zipfile.pyc 64530
[*] decompile source file:219/223[!] decompile bytecode by pycdc fail output_9027479/PYZ-00.pyz_extract/argparse.pyc Command '['/home/yrl/.local/lib/python3.8/site-packages/pydumpck/pyc_checker/lib_pycdc/pycdc', 'output_9027479/PYZ-00.pyz_extract/argparse.pyc.structed.pyc']' timed out after 10 seconds
[!] fail to decompile bytecode output_9027479/PYZ-00.pyz_extract/argparse.pyc (TimeoutExpired(['/home/yrl/.local/lib/python3.8/site-packages/pydumpck/pyc_checker/lib_pycdc/pycdc', 'output_9027479/PYZ-00.pyz_extract/argparse.pyc.structed.pyc'], 10), 'fail when handling output_9027479/PYZ-00.pyz_extract/argparse.pyc -> output_9027479/PYZ-00.pyz_extract/argparse.pyc.structed.pyc')
[*] decompile source file:220/223[1] 18856 killed pydumpck ./something -p pycdc
When I decompiled a program, it was finally killed. Is it because the program is too large? This is the target program something.zip
if you use plugin uncompyle6
, it's strongly recommended to use --decompile xxxmodule
to specify the file(s) you want to decompile,instead of default(decompile all files)
output_1710906.zip here is result partial
Got it, thanks a lot
The local environment is ubuntu20.04,python3.8. After executing pip install pydumpck, run pydumpck exp and report the above error,what happened to this error?