extremecoders-re / bytecode_simplifier

A generic deobfuscator for PjOrion obfuscated python scripts
https://0xec.blogspot.com/2017/07/deobfuscating-pjorion-using-bytecode.html
103 stars 36 forks source link

Fixed compatibility issues with NetworkX and dictionary iteration in … #13

Closed 0x11DFE closed 9 months ago

0x11DFE commented 9 months ago

…Python

Fixed Compatibility Issues with NetworkX and Dictionary Iteration in Python

This commit addresses several issues in the code related to the use of outdated NetworkX methods and unsafe dictionary iteration. The changes include:

  1. NetworkX Method Updates: Replaced nodes_iter() and edges_iter() methods from NetworkX with nodes() and edges(), respectively. This change was necessary because the former methods were removed in NetworkX 2.0 and later.

  2. Safe Dictionary Iteration: Modified the code to prevent modification of a dictionary while iterating over it. This was achieved by creating a copy of the keys or items being iterated over before the loop starts.

  3. Fixed Indexing of Dictionary-Keyiterator: Resolved an issue where a dictionary-keyiterator object was being indexed. This was fixed by converting the iterator to a list before indexing.

These changes have resolved the runtime errors and improved the compatibility of the code with newer versions of Python and NetworkX.

extremecoders-re commented 9 months ago

Thanks!