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 


AOB Scan

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Char03
Newbie cheater
Reputation: 0

Joined: 12 Nov 2015
Posts: 23

PostPosted: Mon Nov 30, 2015 5:42 pm    Post subject: AOB Scan Reply with quote

I'm using this code to scan AOB but gives me 2 results and how I can make 2 results take the change?

Code:
[ENABLE]
Aobscan(_fpx,02 ?? 7B ?? ?? 58 ?? 02 17)

_fpx:
db 02
_fpx+2:
db 7B
_fpx+5:
db 59
_fpx+7:
db 02 17

[DISABLE]


Thanks.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4703

PostPosted: Mon Nov 30, 2015 6:28 pm    Post subject: Reply with quote

http://forum.cheatengine.org/viewtopic.php?t=584688
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Mon Nov 30, 2015 10:02 pm    Post subject: Reply with quote

This is an AA Script Extension to allow Looping.

The related new commands are RepeatWith and RepeatEnd. Unlike other AA command, it is case sensitive. These 2 commands themselves has no functionality, but just for string capture of SYMBOL, LUA-EXPRESSION, TEMPLATE-BLOCK. Format:
Code:
RepeatWith(SYMBOL,"--Lua-expression-to-be-return-a-table-or-StringList( AOBScan returned object )--")

// template block with SYMBOL as looping variable

RepeatEnd()


NOTE:
1.The Looping Symbol should not use outside the template block;
2.The Looping Symbol in a template block is unrelated to other template block (kind of 'i' in a 'for i=..' loops, which is LOCAL Variable);
3.The Lua Expression returned Table(or StringList) should contain Integer or Symbol-String or Hex-String (AOBScan return this contained type);
4.If the returned value is a Table but no content, ie. zero length, error may or may not occurs, the effect is same as removing the text between RepeatWith...Template-Block..RepeatEnd;
5. One Level of Looping Only, nesting loop will not work;
6. In the template block, if the symbol may need to 'touch' other alphabet, for example, use a double quote around the symbol. See the following example plz.

The Lua expression must be contain in 2 double quote, so it itself cannot contain double quote, Lua can use single quote ' for string literal.

To enable the AA Script use the Extension function, but not inference normal AA if need, the script need to use RepeatWith has to be start the very beginning line with "///CUSTOM"

This is example script in the attached CT:
Code:
///CUSTOM  <== this is to use our Custom PreProcessor,
//             w/o this it will run as normal AA
[ENABLE]
RepeatWith(symbol,"AOBScan('11 22 FF 77 55 ?? 99')") //??? comments..

  symbol+08:
  readmem(symbol+05,1)

RepeatEnd()


RepeatWith(symbol," -- from here to next _DOUBLE_QOUTE_ is Lua expression
-- multi-line possible, AA may complaint for syntax error,
-- but it should work, as long as there is no Lua syntax error ;)
(function() -- use this function block to allow local vars

local a = 5
return {1,readBytes('__+10')+3,3,a}
--  RETURN Value must be of type TABLE or StringList,
--  StringList has to manually/externally destroy if need.
end)()      -- function block end
") //???

  __+1symbol:
  db symbol
  __+"symbol"0:
  db symbol

RepeatEnd()


[DISABLE]


To test, attach ce to itself, activate 'setup' script then go to Memory View at '__' (double underscore, it is a registered symbol) then activate 'test' script (same as above).

The actual Lua script to extent AA Script function is in a Table File.
The Table File can be save to disk, then copy & paste to work with your setup. Or it can be load from Table File as in the 'setup' script.

bye~



01_aaRepeat.CT
 Description:
AA Repeat Script Extension

Download
 Filename:  01_aaRepeat.CT
 Filesize:  3.71 KB
 Downloaded:  864 Time(s)


_________________
- Retarded.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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