|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Thu Jun 06, 2013 4:04 pm Post subject: How to increase 1 byte by 2.. |
|
|
Hey,
I'm trying to do an Aobscan for some AoB.
I don't want to update the script, so I'm trying to do the following:
Aobscan for 00 ?? ?? 01 01 02 03 (example).
The following bytes are changing
Quote: | 00 ?? ?? 01 01 02 03 |
I want to read the high lighted byte
Quote: | 00 ?? ?? 01 01 02 03 |
And increase it by 2.
(Convert it to decimal, increase by 2, convert back to hex and then write bytes).
My issue is, to read that 1 byte.
Any help?
Code: | function Hack(sender)
aob=AOBScan("00 ?? ?? 01 01 02 03")
if (aob~=nil) then
count=stringlist_getCount(aob)
if (count~=0) then
for i= 0, count-1 do
hack=stringlist_getString(aob,i)
print(string.format( '%x' , readBytes(hack, 4))) -- This prints only the first bytes (00) so useless
end
end
object_destroy(aob)
results=nil
end
end |
_________________
Last edited by DaSpamer on Thu Jun 06, 2013 6:04 pm; edited 2 times in total |
|
Back to top |
|
|
Gniarf Grandmaster Cheater Supreme Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Thu Jun 06, 2013 4:46 pm Post subject: Re: How to increase 2 bytes by 2.. |
|
|
DaSpamer wrote: | I want to read the high lighted byte
Quote: | 00 ?? ?? 01 01 02 03 |
And increase it by 2. | The thread title says you want to increase 2 bytes by 2, the quote above says you want to increase a single byte. Not knowing what you actually want to do, I shit a brick.
This brick:
Code: | YouWant2Bytes=false;
function Hack(sender)
local aob=AOBScan("00 ?? ?? 01 01 02 03")
if (aob~=nil) then
local count=stringlist_getCount(aob)
if (count~=0) then
for i= 0, count-1 do
local hack=getAddress(stringlist_getString(aob,i))+1;
local Bytes;
if (YouWant2Bytes) then
Bytes=readBytes(hack,2,true);
if (Bytes[1]>0xFD) then
Bytes[2]=Bytes[2]+1;
end
Bytes[1]=Bytes[1]+2;
writeBytes(hack,Bytes[1],Bytes[2]);
else
Bytes=readBytes(hack,1,true);
Bytes[1]=Bytes[1]+2;
writeBytes(hack,Bytes[1]);
end
end
end
object_destroy(aob)
results=nil
end
end |
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Thu Jun 06, 2013 6:05 pm Post subject: |
|
|
Whoops sorry for misleading, will fix.
Also thanks,
I've never used Aobscan for this kind of thing.
_________________
|
|
Back to top |
|
|
|
|
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
|
|