effewe2 How do I cheat? Reputation: 0
Joined: 20 Apr 2015 Posts: 4
|
Posted: Wed Apr 22, 2015 2:18 pm Post subject: |
|
|
Posted this answer in another post, but it applies here as well.
effewe2 wrote: |
Here is an AoB swap function I use in my trainers that I got from a different thread here on the cheat engine forums:
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
|
Simply place that at the start of your lua script in your trainer, then on your button click functions you call the functions and pass the value to scan for followed by the value to change all results to.
example below is a money hack that hacks 4 different AOBs and changes all results of each scan to "2d 4e 02 02 02 02 02":
Code: |
function CEButtonMoneyClick(sender)
openProcess("FlashPlayerPlugin")
Aobswap("D0 ?? ?? ?? 66 12 1c","2d 4e 02 02 02 02 02")
Aobswap("D1 ?? ?? ?? 66 12 1c","2d 4e 02 02 02 02 02")
Aobswap("D2 ?? ?? ?? 66 12 1c","2d 4e 02 02 02 02 02")
Aobswap("D3 ?? ?? ?? 66 12 1c","2d 4e 02 02 02 02 02")
showMessage("Cheat Enabled! Refresh after use.")
end
|
As you can see, the first part in quotes is what to scan for. all results that come back from that scan will be changed to the aobs in the second set of quotes.
For that particular hack there were 4 different values I had to scan for, so I called the Aobswap function 4 times passing a different scan value each time.
|
|
|