Closed 0xARROWK closed 1 year ago
The expected behavior was that dependencies are also packed as v8 bytecode.
Dependecies pkg.json file must also have private: true
field in order to be translated to v8
Thanks for your answer.
So, if I understand well, I need to put "private": true
in every package.json
files inside my node_modules folder ?
yeah
not working for me +1, maybe wrong config?
"bin": "./obfuscated/index.js",
"pkg": {
"private": true,
"assets": [
"./obfuscated/core.js",
"./node_modules/axios/dist/node/axios.cjs"
],
"targets": ["node16-win"],
"compress": "GZip",
"outputPath": "dist"
}
still pack as plain js, btw, compress
option seems not working either.
not working for me +1, maybe wrong config?
"bin": "./obfuscated/index.js", "pkg": { "private": true, "assets": [ "./obfuscated/core.js", "./node_modules/axios/dist/node/axios.cjs" ], "targets": ["node16-win"], "compress": "GZip", "outputPath": "dist" }
still pack as plain js, btw,
compress
option seems not working either.
do not use pkg .
to compile but use this method pkg ./obfuscated/index.js -t node16-win -C GZip -o dist
it works for me, the code has been converted to bytecode but some strings are still plain text
What version of pkg are you using?
5.8.1
What version of Node.js are you using?
16.19.1
What operating system are you using?
Ubuntu 20.04
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node16-win-x64
Describe the Bug
I tried to reverse my own application using pkg-unpacker to see if pkg was working as I expected.
Concerning the top-level code it seems to be good, code is well converted to v8 bytecode, but when I looked at dependencies used, I saw that they was included as plain js.
So I looked at issue for solving it (since I didn't saw anything in the README), and I used the following options in my top-level packages.json file :
But once I used pkg-unpacker after recompiling my app, dependencies code was in plain js again.
Expected Behavior
The expected behavior was that dependencies are also packed as v8 bytecode.
To Reproduce
Set in top-level packages.json file :
Package app :
Clone pkg-unpacker and run :