As per the title. If I have an ESP32 with some Python loaded, and have lost the source, can I retrieve it from the ESP32?
1 Answer
In most cases (that is, unless you have compiled/frozen the Python code), yes.
Depending on the exact environment you may be able to just retrieve the file via the usual file transfer tools.
Alternatively, you can just connect to the REPL (console) and read the file from the filesystem:
file = open("fileyouwanttoread", "r")
file.read()
This will display the contents of the file. You can then just copy and paste, and voilà!
You can find more examples of reading and writing files in this tutorial.
-
Welcome aboard. Thanx a 1,000,000. That's my answer. Now I just need to figure out how to compile my Python before loading to processor, to make reverse engineering a little harder.– MawgCommented Oct 8, 2019 at 12:12