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 


AOBSwap function

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 146

Joined: 07 Nov 2008
Posts: 4137
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Jan 31, 2014 4:02 pm    Post subject: AOBSwap function Reply with quote

Code:
function AOBSwap(aobIn,aobOut)
 aobOut = aobOut:gsub('[^%w]','') -- remove all spaces

 local _aobOut=''
 for i=1,#aobOut,2 do
  _aobOut = _aobOut..aobOut:sub(i,i+1)..' '  -- add spaces (only the needed ones)
 end

 local address = 0

--AOBScan("aobstring", protectionflags OPTIONAL, alignmenttype OPTIONAL, alignmentparam HALFOPTIONAL)


 local aobs = AOBScan(aobIn, '+W*X-C', 1, '4') -- you can change here: protection flags and alignment (e.g. writable, addresses dividable by 4)
 if(aobs ~= nil) then
   for i = 0,aobs.Count-1 do
     address = aobs.String[i]
     autoAssemble(address..[[:
                  db ]].._aobOut)
   end
   aobs.destroy()
 end
end



Usage:
Code:
AOBSwap('00 01 01 02 FE FF 02 01 00', '00 01 01 02 AA BB 02 01 00')



Will change this
00 01 01 02 FE FF 02 01 00

to this
00 01 01 02 AA BB 02 01 00

_________________
Back to top
View user's profile Send private message MSN Messenger
ErcHimA
Newbie cheater
Reputation: 0

Joined: 07 Oct 2013
Posts: 18
Location: In Your Heart :P

PostPosted: Sat Mar 15, 2014 6:35 am    Post subject: Reply with quote

thank you
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 Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites