pycdc icon indicating copy to clipboard operation
pycdc copied to clipboard

Bad MAGIC! Could not load file [.pyc file]

Open steklyashka33 opened this issue 1 year ago • 9 comments

pyc_file.zip

returns an error Bad MAGIC! Could not load file [.pyc file]

python 3.11 does not work only on version 3.11, but it works on other versions. and it doesn't even work on the test files in the tests folder version 3.11

What to do?

steklyashka33 avatar Jan 04 '24 18:01 steklyashka33

what do you mean under

does not work only on version 3.11,

please show the output of console and your try I don't see any troubles with your .pyc files

greenozon avatar Jan 06 '24 22:01 greenozon

@greenozon

root@User:~/pycdc# pycdc "./AutoForward_Telegram.pyc"
Bad MAGIC!
Could not load file ./AutoForward_Telegram.pyc
root@User:~/pycdc# pycdc "./tests/compiled/test_calls.3.11.pyc"
Bad MAGIC!
Could not load file ./tests/compiled/test_calls.3.11.pyc
root@User:~/pycdc# pycdc "./tests/compiled/test_calls.3.10.pyc"
# Source Generated with Decompyle++
# File: test_calls.3.10.pyc (Python 3.10)

import sys
import os
sys.stdout.write('Test\n')
sys.stdout.write(os.path.join('foo', 'bar'))
print('\n')
print(eval('4 * 13'))
print()

steklyashka33 avatar Jan 07 '24 16:01 steklyashka33

not sure whats going on on your PC... sorry are you using latest bits of the tool? etc

here is what I'm getting on your input:

AutoForward_Telegram.pyc.cdc1.txt

greenozon avatar Jan 07 '24 18:01 greenozon

abc.pyc is hitting the Unsupported opcode: DICT_MERGE issue

but decompiles 99% the rest..

greenozon avatar Jan 07 '24 18:01 greenozon

@greenozon could you tell me what needs to be done to properly install pycdc and repeat your success?

steklyashka33 avatar Jan 07 '24 19:01 steklyashka33

for the beginning - build binaries from latest sources?

greenozon avatar Jan 07 '24 19:01 greenozon

I am using the latest version of pycdc

steklyashka33 avatar Jan 07 '24 19:01 steklyashka33

I used this link instruction for linux but I can use windows

steklyashka33 avatar Jan 07 '24 19:01 steklyashka33

the steps in above link IMHO looks over-complicated I"ve tried to bring up binaries on Linux (Ubuntu 20.04) and here is my output:

git clone  ...
cmake . 
make
 
./pycdc ./AutoForward_Telegram.pyc 
# Source Generated with Decompyle++
# File: AutoForward_Telegram.pyc (Python 3.11)

import os
 
......... (full text shown)
 
 


./pycdc abc.pyc 
# Source Generated with Decompyle++
# File: abc.pyc (Python 3.11)

Segmentation fault (core dumped)
 
 

I'm not able to see the crash under Windows...

greenozon avatar Jan 08 '24 16:01 greenozon