 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Reclaimer Shawn Advanced Cheater
Reputation: 0
Joined: 09 Jun 2015 Posts: 77
|
Posted: Fri Aug 02, 2019 9:48 pm Post subject: Aobscan and writeBytes |
|
|
So, I wanted to create a script that writes to addresses near an AOBScan signature. Here's my AOBScan Code:
| Code: |
[ENABLE]
aobscan(EnemyData, 80 00 03 40 00 00 00 01 80 4A BD DC 80 83 36 08 80 4A 86 98 00 00 00 01 80 4A BD DC 80 83 36 18 80 00 C6 28 00 00 00 00 00 00 00 02 80 83 36 38 80 1F C5 4C 00 00 00 00 00 00 00 00 00 00 00 00 80 4A 86 CC)
label(_EnemyData)
registersymbol(_EnemyData)
EnemyData:
_EnemyData:
[DISABLE]
unregistersymbol(_EnemyData)
|
Let's say I want to write the address that is 0x6C bytes away from this signature. How would I go about doing that? I tried through all of these ways, but they don't work for me:
| Code: |
writeBytes(_EnemyData+6C,01,01)
writeBytes("_EnemyData+6C",01,01)
writeBytes(EnemyData+6C,01,01)
writeBytes("EnemyData+6C",01,01)
|
The EnemyData address would need to be stored as a global variable, as this will be subsequently accessed by several different functions.
|
|
| Back to top |
|
 |
FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Aug 03, 2019 7:54 am Post subject: |
|
|
writeBytes("_EnemyData+6C",01,01)
should work, assuming that the script as actually been activated to add _EnemyData to the symbol table, and you wanted to write two 1 bytes (note that lua sees numbers as decimal unless you use 0x but for 1-9 it's the same anyway).
There's really no need for the extra label btw, you can directly register the one aobscan creates eg. | Code: | [ENABLE]
aobscan(_EnemyData, 80 00 03 40 00 00 00 01 80 4A BD DC 80 83 36 08 80 4A 86 98 00 00 00 01 80 4A BD DC 80 83 36 18 80 00 C6 28 00 00 00 00 00 00 00 02 80 83 36 38 80 1F C5 4C 00 00 00 00 00 00 00 00 00 00 00 00 80 4A 86 CC)
[DISABLE]
unregistersymbol(_EnemyData) |
just to test the lua code you could do something like this | Code: |
-- fake the AA script registering the symbol
unregisterSymbol('_EnemyData') -- can't register when already registered
registerSymbol('_EnemyData', 0x400000) -- whatever the real address is for testing
-- test whatever with the symbol registered
local address = getAddress('_EnemyData+6C')
return ('%X'):format(address) -- just printing the address in hex
| Then you know if it's the lua code or the AA code.
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|