AOB to change float values
Hi, i'm new to AOB hacking but i already know to do most of the stuff explained in the tutorials section.
I am still practicing but i kind of hit a wall today when i was trying to make a hack for Kingdom Rush, 1 hit kill to be specific. To do that i searched for health variables and i found the difficulty multiplier conveniently named "ModifEnemyHealth"
if (!(_loc_5 && this))
{
do
{
this.ModifSoldierHealth = 1;
}
do
{
do
{
this.ModifEnemyHealth = 1;
}
}while (true)
this.ModifSoldierHealth = 1.2;
}while (true)
}while (this.game.difficulty != DIFFICULTY_EASY)
this.ModifEnemyHealth = 0.8;
I looked at the raw data
//62 05
_as3_getlocal <5>
//2a
_as3_dup
//12 03 00 00
_as3_iffalse offset: 3
//29
_as3_pop
//d0
_as3_getlocal <0>
//76
_as3_convert_b
//11 0b 00 00
_as3_iftrue offset: 11
//10 c1 ff ff
_as3_jump offset: -63
//09
_as3_label
//d0
_as3_getlocal <0>
//24 01
_as3_pushbyte 1
//68 c6 08
_as3_initproperty *::ModifSoldierHealth
//62 04
_as3_getlocal <4>
//2a
_as3_dup
//11 03 00 00
_as3_iftrue offset: 3
//29
_as3_pop
//d1
_as3_getlocal <1>
//76
_as3_convert_b
//12 1c 00 00
_as3_iffalse offset: 28
//10 cf ff ff
_as3_jump offset: -49
//09
_as3_label
//10 ca ff ff
_as3_jump offset: -54
//09
_as3_label
//d0
_as3_getlocal <0>
//24 01
_as3_pushbyte 1
//68 e2 01
_as3_initproperty *::ModifEnemyHealth
//10 d7 ff ff
_as3_jump offset: -41
//09
_as3_label
//d0
_as3_getlocal <0>
//2f ac 02
_as3_pushdouble 1.2
//68 c6 08
_as3_initproperty *::ModifSoldierHealth
//10 e4 ff ff
_as3_jump offset: -28
//09
_as3_label
//d0
_as3_getlocal <0>
//66 ba 03
_as3_getproperty *::game
//66 ff 03
_as3_getproperty difficulty
//60 e6 0d
_as3_getlex DIFFICULTY_EASY
//14 da ff ff
_as3_ifne offset: -38
//d0
_as3_getlocal <0>
//2f 5b
_as3_pushdouble 0.8
//68 e2 01
_as3_initproperty *::ModifEnemyHealth
From the line
//2f 5b
_as3_pushdouble 0.8
I understand that 2f->pushdouble ( i checked against the AS3 opcodes list ) and 5b is 0.8? Afaik 0.8 in hex is 0x3f4ccccd and i can't seem to find any way to get from 5b to 0.8 :|
If anyone can please explain the logic behind this and how to convert say 0.1 to a hex value that would work i'd really appreciate it.
P.S. The game is http://armorgames.com/play/12141/kingdom-rush if anyone needs the swf file to check.