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 


Dissecting a Deque<T>

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
wizzar
How do I cheat?
Reputation: 0

Joined: 19 Oct 2015
Posts: 7

PostPosted: Thu Feb 27, 2020 9:48 pm    Post subject: Dissecting a Deque<T> Reply with quote

I'm writing an analyzer for an MMO, and I managed to find the base address for the loot messages that are constructed whenever a monster is killed.
I was able to code a little program that keeps querying the game's memory where the loot message will be saved, and I'm logging it because the game only allows 300 lines.

My problem is I can't figure out exactly what kind of structure this is, and I'm guessing it's a deque.

Here's how it looks like:

ADDRESS 0x0
OFFSET 0x0 - pointer that leads to the first 2 elements
OFFSET 0x4 - pointer that leads to elements 3 and 4
OFFSET 0x8 - pointer that leads to elements 5 and 6
.....

Now, inside OFFSET 0x0, here's what I find:

OFFSET 0x4 - pointer to first element (then 0x1C > 0x10 > actual loot line)
OFFSET 0xC - pointer to second element (then 0x1C > 0x10 > actual loot line)

This pattern is followed for 512 elements. After that, the game begins overwritting the list, i.e. element 513 will be written over element 1.

Here's a more programatic way to see the pattern:

Code:
// Positon 3 shifts between 0x4 and 0xC.
// Position 2 is the ever incremented offset.
int[] baseLootOffsets = { 0x10, 0xC, 0x0, 0x4, 0x1C, 0x10 };

// some code....

if (baseLootOffsets [3] == 0x4)
// This conditions toggles between the 2 elements
// that live at offset 0x4 and 0xC.
{
baseLootOffsets [3] = 0xC;
}
else
{
// If I already accessed both 0x4 and 0xC,
// then I need to increment the "external" offset
// to read the next 2 elements.
baseLootOffsets [2] += 0x4;
baseLootOffsets [3] = 0x4;
}


Does anybody have a clue what kind of structure migh look like this?
I would really like to find data like maximum size, header pointer, tail, etc.
Back to top
View user's profile Send private message
Banjo Patterson
Cheater
Reputation: 1

Joined: 15 May 2018
Posts: 36

PostPosted: Sat Feb 29, 2020 7:20 pm    Post subject: Reply with quote

Could it just be a size 512 array of custom loot structures? Where the loot structure contains 2 values, each a pointer to a particular loot related object?

If that were the case, you’d think you could just use an array of size 1024 and store a pointer to a loot object in each index, but perhaps the structure holds 2 pointers to neighbouring loot items as they need to refer to each other someway?

Just throwing ideas around.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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