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 


Cheat Engine Forum Index
PostGo back to topic
oLaudix
Expert Cheater
Reputation: 3
Joined: 25 Mar 2010
Posts: 138

PostPosted: Mon Aug 20, 2012 6:32 am    Post subject:

Make lua file in autorun folder and put this in it.
Code:
function DEC_HEX(IN)
    local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
   if IN<1 then
      OUT=0
      return OUT
   end
    while IN>0 do
        I=I+1
        IN,D=math.floor(IN/B),math.mod(IN,B)+1
        OUT=string.sub(K,D,D)..OUT
    end
    return OUT
end

function Aobswap(search, change)
   aobs = AOBScan(search)
   if(aobs ~= nil) then
      j = stringlist_getCount(aobs)
      --print("Found:",j);
      for i = 1, j do
         --print(stringlist_getString(aobs,i-1));
            --66 ?? ?? d1 a1 68 ?? ?? d0 d0
         address=stringlist_getString(aobs,i-1)
                for i = 1, string.len(change), 3 do
               z = string.sub(change, i, i+2)
                    x, y = string.find(z, "%?+")
                    if (x == nil) then
                  script=[[
                  ]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
                  db ]]..z..[[
                  ]]
                  autoAssemble(script)
                  --print(z)
                        --print(address.."+"..(DEC_HEX((i-1)/3)))
                    end
                end
      end
      object_destroy(aobs);
      aobs=nil
   end
end

Scripts to use it looks like this
Code:
[ENABLE]
LuaCall(Aobswap("60 ?? ?? 66 ?? ?? 66 ?? ?? a2 a0","02 02 02 02 02 02 25 e8 07 a2 a0"))
[DISABLE]

First AoB is what it should look for, second AoB is what it shout change it to.

Oh and you can ofc put many of those in 1 script like this
Code:
[ENABLE]
LuaCall(Aobswap("14 ab 00 00 d0 66 ?? ?? d1 24 1b", "14 ab 00 00 d0 66 ?? ?? d1 24 7F"))
LuaCall(Aobswap("66 ?? 02 d1 24 50 61 ?? 0e d0 66 ?? 03 d1 24 07 61 ?? 0e d0 66 ?? 05 d1 2f 49", "66 ?? 02 d1 24 04 61 ?? 0e d0 66 ?? 03 d1 24 3C 61 ?? 0e d0 66 ?? 05 d1 24 80"))
LuaCall(Aobswap("66 ?? 04 d1 25 82 01 61 ?? 0e d0 66 ?? 07 d1 24 04", "66 ?? 04 d1 25 88 27 61 ?? 0e d0 66 ?? 07 d1 24 04"))
[DISABLE]
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
chiyoko10
Review: Approve
Post reference:
ReviewPosted: Fri May 10, 2013 5:42 am

You showed great Instructions!!
Clearly to be understood!

Back to top
View user's profile Send private message Yahoo Messenger
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites