Age of Defense 3
-migrated-
Age of Defense 3 Posted on: 02/07/2011 10:58pm
Quote Post
Hi I have been struggling to hack this game. I have already determined that it requires an AoB hack (so i have already tried everything else). I have never hacked Aob (im trying to learn but thats been a real struggle.

What I have so far:
age-of-defense-3-10475.swf >> Action (200) >> MainMovie
Code: [Select]
xscore: 96 0b 00 08 0b 06 00 00 00 00 00 00 00 00 ->
At this point im lost as to what to do next. any help would be appreciated.
http://armorgames.com/play/10475/age-of-defense-3
Re: Age of Defense 3 Posted on: 02/08/2011 11:46am
Quote Post
Well, the first thing I did was to do an all search for Prada, as that's how the money is called in the game.
I then saw there are two variables: punyaPrada and punyaPrada2. Guessing that the developer likes us better, I went with the theory that our money is punyaPrada. (punya is has or something like that)
So, what I did next was to search for punyaPrada +
Seeing as how there is a maximum value for money, I'm guessing that there will be an if statement that resets the money. (if money is higher than maxmoney, money = maxmoney)
And here it is, in all it's grandeur:
Code: [Select]
function tambahPrada1()
{
    if (cekPause == false)
    {
        punyaPrada = punyaPrada + Math.ceil(3 + pilihVillage / 10);
        if (punyaPrada >= maxPrada)
        {
            punyaPrada = maxPrada;
        } // end if
        punyaPrada = Math.ceil(punyaPrada);
    } // end if
} // End of the function
MainTimeline lines 1999-2010
Happily I copied the function name and went to the raw data. There I found the if statement:
Code: [Select]
//9d 02 00 09 00
_if true goto #583
//96 04 00 08 3b 08 3c
_push "punyaPrada" "maxPrada"
//1c
_getVariable
//1d
_setVariable
#11838-#11845
Then, I simply NOPed the if statement:
9d 02 00 09 00 96 04 00 08 3b 08 3c 1c 1d =>
02 02 02 02 02 96 04 00 08 3b 08 3c 1c 1d

And voila, you always have maximum money.

The upgrade points are basically the same. Finding the variable for it wasn't difficult; just did a search for upgrade. punyaUpgrade
The if statement in question here is nearly the same: it checks if our upgrade points are higher or equal to the necessary amount. Knowing that, I searched for  punyaUpgrade >=
There are two results, I'm sure you're quite capable of doing the rest of your own. If not, take a peek inside the spoiler tag.

//96 02 00 08 16
_push "hargaUpgradeUnit"
//1c
_getVariable
//96 02 00 08 13
_push "indi"
//1c
_getVariable
//4e
_getMember
//48
_less2
//12
_not
//12
_not
//9d 02 00 46 00
_if true goto #181

96 02 00 08 16 1c 96 02 00 08 13 1c 4e 48 12 12 9d 02 00 46 00 =>
96 02 00 08 16 1c 96 02 00 08 13 1c 4e 48 12 12 02 02 02 02 02

The second one is the same, except for the fact that the 5th byte, 16, is 29 (like so):
96 02 00 08 29 1c 96 02 00 08 13 1c 4e 48 12 12 9d 02 00 46 00 =>
96 02 00 08 29 1c 96 02 00 08 13 1c 4e 48 12 12 902 02 02 02 02

Hope this helped.
Re: Age of Defense 3 Posted on: 02/24/2011 1:35am
Quote Post
Zirak, thanks for putting so much detail into your post - I'm brushing up on finding array of bytes and found your post very useful.

I just wanted to piggyback on your post and make clear to folks that the reason you search/replace
 "9d 02 00 09 00 96 04 00 08 3b 08 3c 1c 1d" and not just "9d 02 00 09 00" (which are the opcodes for just the if-statement) is because changing "9d 02 00 09 00" will change *ALL* of the similar if-statements in the game.  

Instead, you want to extend the length of the code you use so that when you finally replace it, you're only replacing that one, specific instance of the code that you were targeting.  To do that, you just extend the array of bytes to include the codes following the line you're targeting.