Reverse engineering GoDaddy's tracking script
lolware.net
lolware.net
void 0 !== b &&
//node testability hack
(b.tcg = c);
>I'll be blunt, I can't work out what this does, but I don't believe it's significant in the browser. If a node person wants to add input here, please do.I don't know if OP is reading this thread, but this is a minified and then beautified version of `if (b !== undefined) b.tcg = c`.
tl;dr is that you can actually redefine the keyword `undefined` since its actually a global property and not reserved. void 0 will always return you the true value of undefined so it will work in all cases regardless of external shenanigans. Pretty neat.
[1] https://stackoverflow.com/questions/7452341/what-does-void-0...
This is horrible :(
However you can still declare variables named undefined that get their own storage and so can have any value. Originally “undefined” didn’t exist in the global scope so many sites had “var undefined” or function f(..., undefined){..} to get a reference to the value.
I always wondered how people figured out what minified scripts did.
Call it deobfuscation, code translation or simply reading, but calling parsing of Javascript reverse engineering is just title inflation.