Skip to content Skip to sidebar Skip to footer

Does Compiled Standalone Cython Executable Still Contain All Original Source Code?

I'm experimenting with Cython and possibilities of code obfuscation (article). In that article especially noted: When the compilation is done there’s no way to reverse compiled

Solution 1:

No, it does not embed the code. It relies on being able to find the .pyx file - if you move that file then you will get a traceback but without the original code.

If you inspect the generated C source you'll find that the error handling routine goes through __Pyx_AddTraceback, then __Pyx_CreateCodeObjectForTraceback, which creates a PyCodeObject linked to your .pyx source file.

Under some circumstances (I'm not sure what though) it links to your .c file instead. The same rules will apply though - if it can't find the source it won't show that line.


Even without the .pyx file you will still get a traceback with useful method names - these are preserved in the compiled executable.

Post a Comment for "Does Compiled Standalone Cython Executable Still Contain All Original Source Code?"