Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Lua Bytes Scan

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Shapeless
How do I cheat?
Reputation: 0

Joined: 30 Jun 2013
Posts: 7

PostPosted: Sun Jun 30, 2013 9:27 pm    Post subject: Lua Bytes Scan Reply with quote

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
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Mon Jul 01, 2013 2:20 am    Post subject: Reply with quote

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
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Mon Jul 01, 2013 2:30 am    Post subject: Reply with quote

Why not use Aobscan command?
_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites