Page 1 of 1

Dynamic AOB signature possible?

Posted: Mon Sep 14, 2020 3:53 pm
by Sevael
Is it possible to pull two bytes from a specific (static) address and input those into the middle of an AOB signature and then scan for that signature?

I am trying to make an inventory editor table work via AOB. The problem is that the only truly unique array of bytes in the entire inventory section of memory contains the individual character ID in the middle of it; if I use wildcards for the character ID, there will be six results (six characters) and the game regularly shuffles the order of the characters so the individual inventory the scan finds will be random. I want it to find the currently active character's inventory.

There is a static address that houses the two bytes that identify which character is currently active. Ideally, I would like to take those two bytes and input them into the AOB signature so that the AOB scan will land on the proper character's inventory every time no matter what random order they are in.

Is there any way to do this? LUA script, perhaps? Unfortunately, I know absolutely nothing about LUA. I'm still brand new to AOB scanning.

For reference, the static address that contains the current character ID is 281EF75C8, and the AOB signature I am using (the only array that is truly unique) is:

Code: Select all

63 8B 00 00 00 00 00 00 01 01 09 00 ?? ?? 00 00
...where the ?? ?? is the individual character ID from address 281EF75C8.

The following is my AA script (which only finds whichever inventory comes up first):

Code: Select all

[ENABLE]
aobscanregion(gearAOB,140000000,1D0000000,63 8B 00 00 00 00 00 00 01 01 09 00 ?? ?? 00 00)
label(_gearAOB)
registersymbol(_gearAOB)
label(_gearBase)
registersymbol(_gearBase)

gearAOB:
_gearAOB:

gearAOB+10:
_gearBase:

[DISABLE]
unregistersymbol(_gearAOB)
unregistersymbol(_gearBase)

Re: Dynamic AOB signature possible?

Posted: Mon Sep 14, 2020 9:03 pm
by Cake-san

Code: Select all

{$lua}
return "aobscanregion(gearAOB,140000000,1D0000000,63 8B 00 00 00 00 00 00 01 01 09 00"..(" %X %X "):format(readBytes(0x281EF75C8,2)).."00 00)"
{$asm}

Re: Dynamic AOB signature possible?

Posted: Mon Sep 14, 2020 10:21 pm
by Sevael
That worked. Thanks very much!!