AOB to change float values
-migrated-
AOB to change float values Posted on: 08/02/2011 12:20am
Quote Post
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"

Code: [Select]
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

Code: [Select]
//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.
Re: AOB to change float values Posted on: 08/02/2011 5:49am
Quote Post
Never let a computer tell me shit.
hmm maybe this will help you. understand. maybe its a bit childish for you, but maybe not.

Lets say you have a telephone. If I want to call you, I would pick up my phone and dial your phone number. The phone number is not your "value" nor does it represent anything about _you_. It is simply how we call you if we need to talk to you.

Likewise, the "2F" is like a phone and "5B" is like a phone number. If we wish to speak or otherwise interact with a double value we must call him.

So suppose our double 0.8 is some dude named hairy. You only have his phone number, but what you really want to talk to a girl named sue. So what do you do? Pick up the phonebook and find sue's phone number, then call her.

Now back to the AoB, its the same idea. search through the phonebook. just type in "pushdouble" into the search bar, then hit search all. then you get a nice listing of every sexy double in the program. go through them and pick the one that tickles your fancy.



I use this AoB tool to make all the AoBs I post. Try the online version if you dont feel like downloading it.
"Obviously, windows are central to Windows. They are so important that they named the operating system after them. But what is a window?"

Re: AOB to change float values Posted on: 08/02/2011 8:48am
Quote Post
i see, every game has it's own values. did some searching and 0.1 appears to be e6 23. thanks for the explanation.