View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Tue Mar 19, 2013 5:22 am Post subject: Pointers |
|
|
DarkByte:
You have mentioned a couple of times while helping me with my recalculation code that pointers will make the recalulation more difficult.
I have a old DOS game where the addresses are static in relation to each other, and for the number of times I have entered the game using DOSBox they are static in the game. However, in the battle screen, it appears that the addresses are not static and will need pointers.
So the question if one has a set of static addresses and some pointers will the recalculation code mess up those pointers?
The code looks something like this snipped:
Code: |
for x = 0, addresslist_getCount(addresslist)-1 do
memrec6 = addresslist_getMemoryRecord(addresslist, x);--Item in hex format without the 0x
if byteoffset ~= goldtableaddress then
memoryrecord_setAddress(memrec6, string.format('%x', memoryrecord_getAddress(memrec6) + byteoffset - goldtableaddress));
end;
end;
|
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Mar 19, 2013 6:54 am Post subject: |
|
|
Is this a 32-bit game running in dos? Or is it a realmode 16-bit game ?
Realmode does not use pointers like windows, but uses segments and offsets
0x0:0x500=0x500
0x1:0x4f0=0x10+0x4f0=0x500
0x2:0x3e0=0x20+0x3e0=0x500
0x10:0x400=0x100+0x400=0x500
in memory:
0x10:0x400 would be stored as 00 04 10 00 (ce would see it as 0x10400)
0x2:0x3e0 would be stored as e0 03 02 00 (ce would see it as 0x203e0)
As you see, ce can't use a pointer like that. At best the offset part (2 byte) could be used as an idea how many bytes from a known location (within 65536 bytes) the actual address is
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Tue Mar 19, 2013 7:32 am Post subject: |
|
|
I can't answer what type it is but a guess a 16-bit game as it was developed in the early 90's. The game is Wizardry 7, Crusaders of the Dark Savant. I did try a pointer today and saw what you described the pointer was a long way from the byte in memory. I could not get an offset big enough to get rid of the ???.
Maybe I'll have to abandon the battle screen addresses.
Thanks
|
|
Back to top |
|
|
|