Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Tue Apr 30, 2024 9:56 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Example codes?
PostPosted: Thu May 31, 2007 9:39 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Mon Mar 26, 2007 7:23 am
Posts: 344
Could someone write a set of examples for each of the AR DS codetypes? The way they're currently laid out is a bit odd and hard, at least, for me to understand.

I get the basic types, but offsets and the like confuse the hell out of me.


Top
 Profile  
Reply with quote  
 Post subject: Re: Example codes?
PostPosted: Fri Jun 01, 2007 5:30 am 
Offline
Komrade
Komrade
User avatar

Joined: Mon Oct 02, 2006 5:56 pm
Posts: 1978
Title: Mr. Bitches
I'll try to explain pointer codes.

Sometimes, blocks of data move around in memory. Therefore it is necessary to use a pointer!

The game needs to know where the data block is or else it can't use it either, so there will most times be an address holding the address of the start of the memory block.

Let's say we have cheat at the address 0x02301F90 that moves around in memory every time you change a level. (We're on level 1)
First, let's get some readings on what the cheat is in levels 2 and three. Once you find these cheats in these levels, jot down the first 5 or so digits of each address.

In level 1, we search for the first 5 digits of our cheat 02301*** (* means it can be anything, or wildcard).
Repeat this in level two until you find an address that has a value that consistently changes each level.

Let's say we find an address at 0x02010000 that, on our first level of the game, has a value of 02301F00. It changes only when we change levels. This is probably a pointer we can use!

Code:
Type 0x0B
Load offset
BXXXXXXX 00000000    Loads the 32-bit value into the 'offset'.
Offset = word at [0XXXXXXX + offset].


Basically this codetype loads the value at address xxxxxxxx and uses it as the offset.

In our case it would be B2010000 00000000
Our offset is now set to 02301F00, now all we need to do is write our address. In our case, our cheat is always 0x90 from our offset.

Code:
0x02301F90 <-Cheat code for level 1
0x02301F00  <- Minus the value of our pointer address on level one
-------------
           0x90 <- Our code is this far away from the start of the data block, and always will be.


Code:
B2010000 00000000 <- Load the value at 0x02010000 as the offset.
20000090 000000FF <- Write 0xFF to offset + 0x90
D2000000 00000000 <- End, clear offset, etc


Let's go over it once more. The above code will:
-Take the value at 0x02010000 and use it as the offset.
-Write the byte 0xFF to offset + 90

Even if the value at 0x02010000 changes, our cheat will always be 0x90 away from the address specified by the address 0x2010000 holds.

There are a few things we must do to make our pointer more "proper". Don't worry, they're easy.

We don't want to use the value of 0x02010000 if the value is 0. If we did, it could potentially cause problems.
So to prevent that, we first check to see if the value of 02010000 is 0. We will only continue if it != 0

Code:
62010000 00000000 <- If 0x02010000 != 0, continue
B2010000 00000000 <- Load the value at 0x02010000 as the offset.
20000090 000000FF <- Write 0xFF to offset + 0x90
D2000000 00000000 <- End, clear offset, etc


If you have any questions, feel free to ask.

Oh, and I probably should have told you this before, but if you have two RAM dumps (One from each level, or two places where the cheats are different) and the codes from each level, you can use Kenobi's pointer app to find pointers for you.

_________________
Image
Image
<EggWerx> MetalOverlord: Dsman and lemmayoshi will be used for taco meat, ask mo he knows me.
jleemero wrote:
Being required to learn Java for a Comp Sci MAJOR is like being required to shit on a lawnmower to be an astronaut.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group