I have an EXE file which is packed and run by Electron. Now I want to unpack the single EXE file (not asar) to study the source code of this app. But how?
I have tried to unpack this web desktop app (EXE file packed by Electron) by change the extension of this file from exe to zip, 7z and tar. But all failed and indicates that this file is in "PE" format.
Could you please show some ways to unpack this Electron app in a single exe file? Thank you.
解决方案
You don't unpack an executable file, you decompile it.
AFAIK, you won't get the source code from executable, all you get is machine code that is assembly instructions. There are tools out there which can help you to convert this assembly instructions to readable C code, for example, IDA Pro can do this.
There are lot many other decompilers and debuggers which can help you in this scenario. Like x64 debugger or Olly Debugger.
Trust me, you need a lot many hours to get proficient with these tools before you can actually make sense out of the raw assembly instructions, getting the source code out is a long way ahead.
And out of curiosity, why you wanted the source code of electron executable? All the real implementations for electron app should be inside ASAR packed file (which can be decompressed and then you have all the JavaScript source code). Electron executable is just like a wrapper which runs the JavaScript.
You can check out the electron implementation here.