thethiny Cheater Reputation: 0
Joined: 01 Apr 2012 Posts: 38 Location: earth
|
Posted: Thu May 16, 2019 1:28 pm Post subject: AutoAssembler AOBScan mem allocation makes no sense? |
|
|
Hi,
so I'm working on a mod for a game, and it's working perfectly. However, I don't understand the fashion of the memory allocation used!
Code: | aobscanmodule(npc,MK11.exe,89 44 24 30 89 44 24 34 85 C0 74 2A 8B D0 33 C9 44 8D 41 08 E8 03 B7) // should be unique
alloc(newmem,$1000,"MK11.exe"+4405C4) |
Here the purpose of aob scan is that we DON'T know the address. But in the second line, we're allocating newmem near a specific address. Doesn't that defeat the purpose of AOB Scan? I mean we're eventually specifying the addres... I don't get this.
Can't I just do "npc" instead of Code: | "MK11.exe" + 4405c4? |
Edit:
I was correct. It works. However I have a question:
Code: |
aobscanmodule(npc,MK11.exe,89 44 24 30 89 44 24 34 85 C0 74 2A 8B D0 33 C9 44 8D 41 08 E8 03 B7) // should be unique
alloc(newmem,$1000, npc)//"MK11.exe"+4405C4)
|
for a reason too hard to explain, the aobscanned result is only there once. This means my function works once only, then fails the 2nd time. Is there a pre-built function that tests if "npc" is registered?
currently I created a 2nd script that does the aobscan and registers it, then this script above will utilize the npc that the previous script found. I'm trying to remove the need of the 2nd script.
Also I realized that npc is registered without me having to registersymbol. How did that happen?
|
|