How to hack nw.js based games?

Leviathan_Carnifex

What is cheating?
Jul 19, 2017
3
0
1
#1
Hello everyone! I need some tips or tutorials how to hack nw.js (nw.exe) based games. Most of those games is indie. The problem is - i can't find values even if I use "unknown initial value" and value type - "all. Such as health bars or power bars, etc. Even if I found right address for the value on the screen (number of lives or other things, which represented by number on the screen) and change it, nothing happens in the game.

Sorry for orthographic error's, eng is not my native lang.
 
Jul 19, 2017
6
0
1
#2
Uhhh... You know JS doesn't have an integer type, right? Everything in JS is IEEE 754 Single Precision.
 

FreeER

RCE Fanatics
Talents
Mar 10, 2017
82
2
8
#3
I've played a few where you can find or manage to extract the js code (after some time spent googling) and modify it directly, other than that I haven't had much luck when double scans didn't work but I haven't played too many of them either. Part of the problem with JS (to my limited understanding of how the engines are implemented) is that's it's garbage collected and passes around values a lot along with closures and byte code etc.

hm, reading this https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/ gives me an idea to try using 4 byte values with the first / most significant / sign bit set...

@gir489_2 while JS does use the IEEE 754 Floating Point standard it doesn't use the binary32 single precision 4 byte "float" type but the binary64 double precision 8 byte "double" type (http://2ality.com/2012/04/number-encoding.html). Also the link above would prove you wrong about integer types when the V8 engine is used...
 

gir489

RCE Fanatics
Talents
May 8, 2017
188
8
18
#4
I said JS doesn't have an integer type, therefore I wasn't wrong.
 

FreeER

RCE Fanatics
Talents
Mar 10, 2017
82
2
8
#5
gir489 post_id=13510 time=1500485365 user_id=3979 said:
I said JS doesn't have an integer type, therefore I wasn't wrong.
FreeER post_id=13501 time=1500479216 user_id=980 said:
the link above
just in case it caused confusion, by that I meant the thibaultlaurens link not the one about the floating point format...
https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/ said:
Tagged values

To have an efficient representation of numbers and JavaScript objects, V8 represents both with a 32 bit value. It uses a bit to know if it is an object (flag = 1) or an integer (flag = 0) called here SMall Integer or SMI because of its 31 bits. Then, if a numeric value is bigger than 31 bits, V8 will box the number, turning it into a double and creating a new object to put the number inside.
While the ECMAScript standard JS is based on may not have defined an integer type if the implementation of the engine that you are going to be working with to hack a game does then saying that JS doesn't have an integer type is practically wrong and worse than meaningless to everyone trying to hack a game on that engine (worse because then their looking in the wrong direction to find the value they want). I'd have agreed with you before reading that post, and while I haven't tested so it could still be incorrect, saying you're not wrong without more evidence when there's something saying you are is a bit silly.

Oh, and based on https://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations it's the low bit that's used not the high bit (sign) bit like I'd assumed previously.
 
Top Bottom