How to make instant build trainer Tutorial -- by Groza / May 2001
Target: Red Alert 2 version 1.004
I wrote this tutorial in order to show you how I made the instant
option in my trainer for Red Alert 2. Because of a great demand I will
write how to make reveal map and skip mission options too. All the
will be available to download from my page http://grozatt.cjb.net so
it out time to time.
WHAT WE NEED ?
- SoftIce ( the best tool, can't live without it )
To make an instant build trainer we have to find out the code that
cares(calculates) how long something will be building. There are many
possibilities how to find it out. I will explain just one of them,
worked fine with me. Now if we think a little, there should be some
in memory that is increasing or decreasing(depends on the game) during
build. We are going to find it out.
So let's start building something. Now during building process we have
find all the memory locations which are decreasing or increasing.
will try to find out those which are decreasing. In the game we start
building Barracks and as soon as it starts we pause the game(we press
ALT+TAB to WinHack choose the process of RedAlert 2(game.exe) and
searching the locations. Then ALT+TAB back to the game, unpause and
little. Back ALT+TAB to Winhack and use the -has decreased- option to
only those memory locations which were decreased since the last
Then back to the game... we need to repeat doing this till we don't
one or few locations.
In Winhack we can also use other options like -has decreased by Less
which can be very useful but I won't explain them here.
OK, everything should come well and we find the location(by me is
Let's check it out.
Back to the game and ALT+D to Softice. Be sure that we are in
and not in some other process. Let's put a breakpoint on the address
bpmb 88FCEEC w and ALT+D to return to the game. SoftIce should pop up.
We should see something like this:
:004B9529 mov ecx, dword ptr [esi+68]
:004B952C push edi
:004B952D call 004E5470
:004B9532 mov eax, dword ptr [esi+5C]
:004B9535 mov [esi+58], 00
:004B9539 sub eax, edi
<-this decrease our counter
:004B953B mov dword ptr [esi+5C], eax
:004B953E cmp dword ptr [esi+24],
:004B9542 jne 004B9574
Hm, let's patch it !!! Instead of sub eax, edi let's modify it by
sub eax,eax ! In this way we will decrease the counter so it should
the thing instantly. Let's modify it, disable all breakpoints and back
the game. What???#%&%#& Nothing happen. :(
But don't give up, let's check that cmp at the 004B953E. Seems it's
the location pointed to [esi+24] with 36 hex. Let's check it out,
all breakpoints and put a bpmb [esi+24] w.
Back to the game and softice pop up here:
mov eax, dword ptr [esi+38]
mov edx, dword ptr [esi+24]
add edx, eax
mov dword ptr [esi+24], edx
mov eax, dword ptr [00A35354]
mov edx, dword ptr [esp+0C]
Hm, we can see that here is some other counter, which increases
And when it reaches 0x36 it is done. OK, let's modify the code in this
mov edx, 36
//this 3 additional nops are because this instruction is
//shorter than that we've replaced
mov dword ptr [esi+24], edx
OK, disable all breakpoints and let's go back to the game. YES, IT
We have the instant build. Now we only need to make a trainer that
modify the code when we press a button.
And that's all that has to be done. Easy isn't it ?
Please check the tutorial section on my page to find out more about
writing a trainer...
Greetz to MICRaL from TekZ 8193 for trying to make my page better !
From the heart of the winter,