Fixes/Decrypts asar archives protected by asarmor and asarbreak.
npx asarfix app.asar -o out.asar
npx asar extract out.asar out
Asarmor uses AES-128-CBC to encrypt .js
files in the asar archive.
The encryption key is stored in one of these binaries:
- electron-forge:
resources/app.asar.unpacked/.vite/build/main.node
- electron-builder:
resources/app.asar.unpacked/dist/main.node
npx asarfix app.asar -o out.asar -b <path to main.node>
The key may also be available in plaintext: node_modules/asarmor/src/encryption/key.txt
.
It checks process.argv, but this can be bypassed in one of these ways:
- Set the
NODE_OPTIONS=--inspect
environment variable (only works with node, not electron) - Open
main.node
in a hex editor and replace the--inspect
string with anything else of the same length - Modify Fuses