How to unpack a single EXE file produced by Electron pack?
Asked Answered
B

2

1

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.

Berniecebernier answered 4/6, 2019 at 8:44 Comment(1)
This question is out of scope of Stack Overflow. Stick with research via a search engine.Hypophosphite
C
3

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.

Craquelure answered 4/6, 2019 at 9:0 Comment(5)
I don't mean the Electron implementation code but an electron app, which is packed as a single exe. I don't know which package tool (e.g., electron builder or packager) it used.Berniecebernier
If you can provide me the executable, I can take a better look and then helpCraquelure
Really? I don't think anyone needs to "disassemble" electron apps? AFAIK those are Javascript! You don't disassemble JS in IDA! People just want to edit the .js files.Subconscious
@Subconscious if you read out my answer carefully, you should see that I mentioned the same i.e., its the javascript which is the source for the app. I wrote down about the disassembly because I thought the OP wanted to get source of the executable produced by electron (not the javascript which it packs to run)Craquelure
The OP wants to study the JS files inside the .exe. When the Electron app is packaged into an asar archive, you can extract the code, using the asar node module. But, I am not sure how you extract the code, if the asar=false option has been set in electron-builder? I would also be very interested to know!Fabrin
R
-1

Hi you can use exeinfope software. This is best ever software you can check programming languages easily

Radie answered 12/2, 2021 at 5:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.