Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Pointers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Tue Mar 19, 2013 5:22 am    Post subject: Pointers Reply with quote

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
View user's profile Send private message Yahoo Messenger
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Mar 19, 2013 6:54 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Tue Mar 19, 2013 7:32 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites