 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Shapeless How do I cheat?
Reputation: 0
Joined: 30 Jun 2013 Posts: 7
|
Posted: Sun Jun 30, 2013 9:27 pm Post subject: Lua Bytes Scan |
|
|
I have an array of bytes that that I can search in cheat engine memory scan. But when I try to put it in a Lua script it does not find an address.
The value returned by the scan + 0x20 is what I am trying to get.
| Code: | function AobScan(Bytes)
local Start = 0x0000000000000000;
local End = 0x15ffffffffffffff;
local Scan = createMemScan()
memscan_returnOnlyOneResult(Scan, true)
memscan_firstScan(Scan, soExactValue, vtByteArray, rtTruncated, Bytes, "", 0, 0x00FFFFFF, "", fsmNotAligned, nil, false, false, false, false)
local Return = memscan_getOnlyResult(Scan)
memscan_waitTillDone(Scan)
return Return
end
print("L",AobScan("?? ?? ?? ?3 ?? ?? ?? ?? ?? ?? ?? 6? 00 ?? 00 8? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 6? 00 ?? 00 8C 00 00 80 41 ?? ?? ?? ?? ?? ?? ?? ?? 00 0? 00 8C 00 00 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")) |
|
|
| Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Mon Jul 01, 2013 2:20 am Post subject: |
|
|
There are at least 2 problems in your script:
1-You're giving an hexadecimal input so the firstScan call should end with true,false,false,false);
2-You're reading the result before the scan is finished (memscan_getOnlyResult is above memscan_waitTillDone).
Don't know if you really need it, but this code gave me the expected results (uses CE 6.3 conventions):
| Code: | function MyAobScan(Bytes)
local StartAddress=0;
local EndAddress=0x15ffffffffffffff;
local Scan = createMemScan();
Scan.OnlyOneResult=true;
Scan.firstScan(soExactValue, vtByteArray, rtTruncated, Bytes, "", StartAddress, EndAddress, "", fsmNotAligned, "", true, false, false, false);
Scan.waitTillDone();
return Scan.getOnlyResult();
end
print(string.format("%X",MyAobScan("11 ?? 33 44"))) |
|
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Mon Jul 01, 2013 2:30 am Post subject: |
|
|
Why not use Aobscan command?
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| 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
|
|