Posted: Mon Oct 31, 2022 8:08 am Post subject: Need help understanding an error in a script
I found a bit of code from another table and I am trying to understand how to read the part where its getting the address, however I ran into a problem where i am getting this error when attempting to add it to my table:
Quote:
Error in line 7 ( 00000000+(DWORD)[00000000+03]+03+04:):This address specifier is not valid
From what I gather the table seems to work fine for others, See code below:
Code:
[ENABLE]
aobscanmodule(aobResourceHook,ExpeditionsRome-Win64-Shipping.exe,48 8D 0D 4D 4F ED 02)
I have two questions:
1 - why am I getting this error
2- can someone explain to me the line aobResourceHook+(DWORD)[aobResourceHook+03]+03+04. are all the '+' signs offsets?
CE may give an error when it tries to save the script to the address list, but when the script is enabled, it runs perfectly fine. Assign an empty script with only [ENABLE] / [DISABLE] tags to the address list first, then edit that. CE will still complain, but it will at least let you save it to the address list anyway.
To explain: that `lea` instruction is using an RIP-relative addressing mode. The signed 4-byte integer 0x02ED4F4D (aob `4D 4F ED 02`) is added to RIP (address of next instruction) to calculate the final address.
The symbol `aobResourceHook` is the address of the `lea` instruction. The address of the next instruction would be `aobResourceHook+7`. To add the 4-byte integer, you need to read the dword (4 bytes) at `aobResourceHook+3`: that's what the (DWORD) and square brackets are for.
It's weird the author used `+03+04` instead of simply `+7`.
I also wouldn't include the relative displacement in the aob signature (i.e. I'd use `48 8D 0D ?? ?? ?? ?? ...`, plus extra bytes to ensure it's unique)- that is less likely to break on a game update. _________________
I don't know where I'm going, but I'll figure it out when I get there.
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