+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  PC Pointers?
Pages: [1]
Author Topic: PC Pointers?  (Read 416 times)
rmco2003
Guest
« on: May 27, 2007, 04:17:32 pm »

Is there a standard for PC executable pointers? How would I go about calculating them? I've been working on a patcher for a game but I need to be able to repoint some text that's inside the main executable.
DaMarsMan
Guest
« Reply #1 on: May 27, 2007, 04:34:09 pm »

They are usually 32bit little endian (reversed bytes). However, there is no standard.
creaothceann
Guest
« Reply #2 on: May 27, 2007, 07:16:20 pm »

Ahem. They're not reversed. Roll Eyes

x86 pointers are simple. DOS pointers map down to 1 MB instead of 4 GB, but even that shouldn't be a problem.
rmco2003
Guest
« Reply #3 on: May 28, 2007, 12:24:49 am »

So what would the structure be like in hexadecimal, say for example if I wanted to go to offset 123456 in hex, what would it look like as a 32 bit pointer? The executable is over 1 MB so I don't think it'll be a DOS pointer Wink
creaothceann
Guest
« Reply #4 on: May 28, 2007, 03:45:17 am »

Pointers are for memory, offsets are for blocks of data (e.g. files). So it's an offset?

"123456h" in 32 bits would be "00123456h". In a hex editor you write each group of 8 bits by its own, i.e. "56 34 12 00".

If your "123456" was decimal you need to convert it to hex first, i.e. "0001E240h". This would be displayed as "40 E2 01 00" in the hex editor.
rmco2003
Guest
« Reply #5 on: May 28, 2007, 03:50:05 pm »

*sigh* doesn't look like it uses that structure, can't find any pointers for the text in the executable, so it's probably hardcoded amongst the ASM code.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC