Retrieving Array Data

Technical Discussions not Related Directly to MHS. For Example, Coding, Hex Editing, General Hacking, Etc.

Moderators: g3nuin3, SpeedWing, WhiteHat

Retrieving Array Data

Postby PsychoTron » Fri Apr 29, 2011 1:57 pm

I've hooked a function that returns the address of an array.

0x00DBA498 <- This exist in the .exe, and should be my array.

Code: Select all
int Data = GetCharacterData(index); // Returns 0x00DBA498

int* arr = &Data;
int Length = sizeof(arr)/sizeof(int*);

for (int i = 0; i < Length; i++)
{
   UInt32 Temp = arr[i];
   Log("Data: " + UInt32ToString(Temp));
}


I've tried a number of different methods, but none seem to work as expected. (char*, inline asm([value+1]), *var, (type*)var, &var, etc, etc, etc,.)

It should be 1088 byte array containing the stats, etc, of a character.

Perhaps the info I got was just wrong, but regardless, the way C++ handles arrays is a bit confusing, so I still need to know how to do it properly, I'm sure I'll come across this again.

---

Edit: It wasn't an array at all, it was a start index for reading global values. (ie, just read offset + 1byte, to get this data, offset + 2byte to get that data, etc, etc,.)

I didn't decode that bit, someone else did, and they obviously misread what was happening. (Their data is generally correct, so I didn't bother double checking it.)
PsychoTron
Hackleberry Fin
 
Posts: 21
Joined: Sun Aug 29, 2010 7:02 am

Re: Retrieving Array Data

Postby L. Spiro » Sat Apr 30, 2011 8:06 am

It is the address of a structure.
The offsets are offsets from the base of the structure, and the data order is defined by the order of the members in the structure during the time it was actually coded.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3127
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: Retrieving Array Data

Postby PsychoTron » Sun May 01, 2011 12:06 am

L. Spiro wrote:It is the address of a structure.
The offsets are offsets from the base of the structure, and the data order is defined by the order of the members in the structure during the time it was actually coded.


L. Spiro


So, that's what a structure looks like in ASM. :)

That makes sense, I doubt they would be referenced the way they are if they were just regular global values.

Thanks, that should help me out quite a bit. :)
PsychoTron
Hackleberry Fin
 
Posts: 21
Joined: Sun Aug 29, 2010 7:02 am


Return to Technical Unrelated

Who is online

Users browsing this forum: No registered users and 1 guest

cron