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 


Outputting AoBscan Addresses?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
suckershake
How do I cheat?
Reputation: 0

Joined: 30 Oct 2013
Posts: 8

PostPosted: Wed Oct 30, 2013 3:00 pm    Post subject: Outputting AoBscan Addresses? Reply with quote

Well, first of all I have no skill lua-scripting whatsoever...
I have tried stuff and it failed.
Basically what I want is to find specific addresses using a aobscan, then calculating offsets and a Pointer using those scan-results and finally storing the results in a textfile or something.

I failed successfully executing a print and an AoBscan in the same script however...

I realize that I must suck just as much as I suck at finding the solution...
So instead of wasting countless hours of my time getting nowhere, I'll get somewhere by wasting your time Razz

... So how do I read addresses using AoBscans (I know the instruction is aobscan(name,signature)
to calculate my static pointer with offsets (I should be able to do the calculations on my own)
and finally output the results?

If it's too complicated I don't mind first outputting the scan results and then calculating the results with something else.

I already have fool proof signatures and the scripting part really is the only thing I have trouble with.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25296
Location: The netherlands

PostPosted: Wed Oct 30, 2013 3:48 pm    Post subject: Reply with quote

check out this topic: http://forum.cheatengine.org/viewtopic.php?p=5502697#5502697

the script I posted should at least tell you how to use the basics, and check DaSpamer script out as well

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Oct 30, 2013 4:29 pm    Post subject: This post has 1 review(s) Reply with quote

Like this?
Code:
local AoB = AOBScan("90 90 90 90");
if (AoB == nil or AoB.Count > 1) then --> Ends function earlier if the AoB was not found, or if multiply aobs were found.
   return
end
local BaseAddress = AoB[0]; --> First address
local Pointer = '[' .. BaseAddress .. ']+10'; --> Sets it as pointer, for example if you print, output will be [Address]+10 --> [02000000]+10
-- You can write now or read
-- writeInteger(Pointer, 100);
-- readInteger(Pointer);

(I'm not sure if it works perfectly, since I have never tried lua with pointers, as I don't use pointers.)

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
suckershake
How do I cheat?
Reputation: 0

Joined: 30 Oct 2013
Posts: 8

PostPosted: Wed Oct 30, 2013 4:32 pm    Post subject: Reply with quote

Oh my god! Thank you so much!

Now if I want to print ... let's say:

A1 ** ** ** ** 35

the Address in-between the instructions?
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Oct 30, 2013 4:43 pm    Post subject: Reply with quote

I'm not really sure what you mean the address between them?
But you can change the BaseAddress to
Code:
local BaseAddress = AoB[0] .. '+offset'

If you're trying to read it then try this
Code:
function DEC_HEX(IN)
   if IN<=0 then
      return '0'
   end
   local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
   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
local AoB = AOBScan("90 90 90 90");
if (AoB == nil or AoB.Count > 1) then --> Ends function earlier if the AoB was not found, or if multiply aobs were found.
   return
end
local BaseAddress = AoB[0]; --> First address
local Pointer = '[' .. BaseAddress .. ']+10'; --> Sets it as pointer, for example if you print, output will be [Address]+10 --> [02000000]+10
local ReadBytes = readBytes(Pointer,6,true) --> reads the first 6 bytes from the address and returns as table for each byte and byte (ReadBytes[1],ReadBytes[2] ... ReadBytes[n]) but converts them to Decimal*
for _,String in pairs(ReadBytes) do --> for each entry and entry in the table ReadBytes do..
   local Hex = DEC_HEX(String) --> converting each byte and byte that stored in the ReadBytes Table
   if Hex:len()==1 then
      Hex = '0' .. Hex --> Just incase, making the bytes 2 character length
   end
   ReadBytes[_] = Hex
end
print(unpack(ReadBytes)) --> shows all ReadBytes table enteries as 1 line. Example of output A1 01 92 00 22 35

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
suckershake
How do I cheat?
Reputation: 0

Joined: 30 Oct 2013
Posts: 8

PostPosted: Wed Oct 30, 2013 5:13 pm    Post subject: Reply with quote

oh lol... this is waaay beyond me...

Got:
Error:[string "function DEC_HEX(IN)..."]:20: bad argument #1 to 'pairs' (table expected, got nil)
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Oct 30, 2013 5:25 pm    Post subject: Reply with quote

Oh my bad, I made this script try to read a pointer value.
Code:
function DEC_HEX(IN)
   if IN<=0 then
      return '0'
   end
   local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
   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
local AoB = AOBScan("90 90 90 90");
if (AoB == nil or AoB.Count > 1) then
   return
end
local Address = AoB[0];
local ReadBytes = readBytes(Address,6,true);
for _,String in pairs(ReadBytes) do
   local Hex = DEC_HEX(String);
   if Hex:len()==1 then
      Hex = '0' .. Hex;
   end
   ReadBytes[_] = Hex;
end
print(unpack(ReadBytes));

This one should work.
If you have this code
01 ?? ?? ?? ?? 06
and you want to read
?? ?? ?? ?? 06
just modify the
Code:
local ReadBytes = readBytes(Address,6,true);

to ( Don't remove the ,true at the end).
Code:
local ReadBytes = readBytes(Address .. '+offset',length to read ,true);

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
suckershake
How do I cheat?
Reputation: 0

Joined: 30 Oct 2013
Posts: 8

PostPosted: Wed Oct 30, 2013 5:56 pm    Post subject: Reply with quote

Thanks! I have all I need for now Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Thu Oct 31, 2013 7:24 pm    Post subject: Reply with quote

DaSpamer, Why you still use that DEC_HEX, there are more elegant ways...
_________________
Back to top
View user's profile Send private message MSN Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Fri Nov 01, 2013 5:58 am    Post subject: Reply with quote

mgr.inz.Player wrote:
DaSpamer, Why you still use that DEC_HEX, there are more elegant ways...

cba (can't be arsed) Smile.
I could use this
Code:
string.format("%X", number)

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
suckershake
How do I cheat?
Reputation: 0

Joined: 30 Oct 2013
Posts: 8

PostPosted: Wed Nov 06, 2013 11:09 am    Post subject: Reply with quote

edit: nvm I finally figured stuff out myself Very Happy I'm ready to go... after I've finished learning for the freaking exams tomorrow and basically the next three weeks... :DDDD
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