question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can a software compiled with Nuitka be decompiled easily?

See original GitHub issue

Hi everyone!

Offtopic: First of all, congrats to the Nuitka team… my favourite python tool is becoming better and better gradually and getting more and more traction and that’s just superb 😃

Bit of background first, one of the things I liked the most about Nuitka vs freezing tools from the very beginning since I’ve discovered Nuitka was the ability Nuitka had (theorically) to obfuscate python code nicely as pe/elf code… that was a great feature indeed (at least to me) as it offered an extra layer of source code protection you wouldn’t have when using all existing python freezers, it’s a well known fact there are available decompilers for all python freezers so I’ve never truly understood really the real value of this type of software actually 😕

Anyway, it seems when you compile source code as a module with Nuitka you’re basically offering the source code of such modules quite easily as inspect.getsourcelines will work flawlessly.

Here’s my question, let’s say you then don’t compile your modules as .pyd to avoid this exploit so instead you decide to embed that code in the exe… if that was the case, how hard would be for somebody to use inspect.getsourcelines and reveal your source code?

First of all, I’m truly aware the only way to protect your source code is by not giving away any form of executable but I’d like to know in this case what’s the level of difficulty for crackers to break software built with Nuitka.

Assuming crackers could inject some code in the exe itself to use inspect.getsourcelines… would there be a good way to avoid inspect.getsourcelines working?

For instance, when you try to use inspect on some Sublime builtin core modules you’ll get a nice crash, ie:

>>> inspect.getsourcelines(sublime_api.window_views)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "./python3.3/inspect.py", line 715, in getsourcelines
  File "./python3.3/inspect.py", line 551, in findsource
  File "./python3.3/inspect.py", line 435, in getfile
TypeError: <built-in function window_views> is not a module, class, method, function, traceback, frame, or code object

Which it’s great, as SublimeHQ has been concerned about source code protection from the very beginning and they did a great job in that area 😃

Regards!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

9reactions
kayhayencommented, May 6, 2021

@iPurya thanks for confirming my selling points 😃

2reactions
iPuryacommented, May 6, 2021

reverse engineering nuitka is so hard with ghidra. its mixed with python codes. is there better way to reverse engineering nuitka compiled files ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kay Hayen on Twitter: "New #nuitka release https://t.co ...
Can a software compiled with Nuitka be decompiled easily? · Issue #392 · Nuitka/Nuitka. Hi everyone! Offtopic: First of all, congrats to the ......
Read more >
Does Nuitka Remove Names of Variables, Functions, Classes ...
Does Nuitka Remove Or Obscure Names of Variables, Functions, Classes, Etc. From Your Python Code? (Nope! It Preserves Them For Reverse Engineers!)
Read more >
How to decompile python ELF file (Compiled with Nuitka)?
I have some files that compiled with nuitka. formats are .bin. I could get shell access to running process with pyrasite same as...
Read more >
native code compiler status (PyPy, Nuitka, Cython, Numba)?
Web2py is extremely dynamic, so I expect even if e.g. Nuitka can make it native, it won't be faster and still have enough...
Read more >
How do I protect Python code from a rebuilder? - Quora
You could use a mix of Cython and Nuitka. These will turn your Python code into C/C++ code that uses the python DLL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found