Svenskithesource / PyArmor-Unpacker

A deobfuscator for PyArmor.
GNU General Public License v3.0
536 stars 75 forks source link

Python 3.7 error: AttributeError: 'code' object has no attribute 'replace' #17

Closed SkeletalDemise closed 2 years ago

SkeletalDemise commented 2 years ago

Python 3.7.13 32 bit.

Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "<string>", line 358, in <module>
  File "<string>", line 179, in output_code
  File "<string>", line 179, in <genexpr>
  File "<string>", line 191, in output_code
  File "<string>", line 213, in handle_armor_enter
AttributeError: 'code' object has no attribute 'replace'
Svenskithesource commented 2 years ago

This issue is because code.replace() was only introduced in 3.8 and higher, we can fix this by replacing the code.replace() with copy_code_obj which is already included in the methods