Originally Posted by
mozartmclaus
i probably misunderstood the structure of RActors.I was trying to access them via:
[[156c8cc]+8b0]+148+i*416
(416 is decimal here)
now i realize that this is not an array but an object.
and to address array you say it would be correct to do this:
[[[156c8cc]+8b0]+148]+i*416
Sorry, I don't think you are there yet. Looking closely at assembly quoted in this thread: it is taking 16-bits low part of the GUID and does two things using a variable "bit size" (let's take 10 as an example):
1/ Takes top bits (10 to 15) to select a bucket of objects
2/ Masks low bits of the remaining address (9-0) to select the proper object in the bucket
In other words, you are looking at an array of buckets, ie implementation of a map (hashtable), which makes sense since D3 wants fast access based on GUID. I would suggest something like this if you want it iterate on it (accessing by GUID is obviously simpler):
Code:
RActorsAddress = getInt(ObjectManagerAddress+0x8b0);
RActorsMax = getInt(RActorsAddress+0x100);
RActorsBits = getInt(RActorsAddress+0x18C);
RActorsBase = getInt(RActorsAddress+0x148);
nbBuckets = RActorsMax/(1<<RActorsBits);
for(bucket=0; bucket<nbBuckets; ++bucket) {
bucketAddr = getInt(RActorsBase+4*bucket);
if (bucketAddr==0x0) continue;
for(pos=0; pos<(1<<RActorsBits); ++pos) {
addr = bucketAddr+0x428*pos;
GUID = getInt(addr);
if (GUID==0xFFFFFFFF || GUID==0x0) continue;
}
}
Posting with a new account as I could not manage to recover previous one.
New game, new account. Makes sense