Reputation: 11
I have an app (that I believe has malware in it, but I wish to confirm before I go ahead and use it) that has been compiled/packaged using Zeit's PKG.
It seems to use v8's snapshot feature to obfuscate the code... any way to reverse this? I know it compiled node in the exe, but I'm new to programming and reverse engineering.
Where do I start with reverse engineering this thing? Thanks!
Upvotes: 1
Views: 2066
Reputation: 1446
First you need to understand how it works. You will find that it forks node.js repo and change the bootstrapping code responsible of starting the engine.
Second part is the serialized data. It uses V8 engine (the javascript engine running node.js and chromium based browsers) to create a bytecode of the whole program and appends that to the end of the binary.
So, to reverse that binary:
As a side note, v8 engine allows to you dump the bytecode directly in text format by passing a flag -print-bytecode
and optionally --print-bytecode-filter=func_name
. However, v8 engine will not dump constant pools since that functionality is stripped from release channel. This will allow you to see the function code but not the values used by the function.
Upvotes: 0