1. 6
  1. 2

    Loosely related: I recall using raw Python bytecode manipulation to deal with obfuscated malware, as described here: https://www.mandiant.com/resources/deobfuscating-python

    1. 2

      I did this a while back. It is not as detailed as this post, but implemented in pyodide. So you can explore online.

      1. 1

        Very nice

      2. 1

        Happy to answer questions or hear your feedback!

        1. 2

          I think that the link to Skybison is broken.

          Have you looked at PyPy’s translation process? The RPython toolchain also builds a collection of basic blocks from bytecode.

          1. 1

            Thanks for the tip! Fixing it now. I’ll take a look at PyPy…

            EDIT: Oh, very neat. I should add a link to that somewhere.