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 


AOB Scans to Re-Calculate Addresses?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
mg_01
Cheater
Reputation: 0

Joined: 28 Jan 2018
Posts: 41

PostPosted: Fri Aug 24, 2018 3:24 am    Post subject: AOB Scans to Re-Calculate Addresses? Reply with quote

Hello,

I have 7 groups of addresses, each has a parent address that I find using an AOB scan from which I re-recalculate its children-addresses.

Currently, I'm manually searching for the AOB, going to the memory viewer, copying its address using "Go to Memory", going back to the CE table, and re-calculating the parent-address using the found one.

I was wondering if it were possible to use LUA to auto search for the AOB and put the result-address into the output console so that I can grab it and re-recalculate the addresses in my table.

The only problem might be that some AOBs need to be jumped into the correct address from where the result takes you. For some, i use the result+430 to get to the right address that I use to re-calculate stuff.


I tried putting together something, but it finds the wrong value...

Code:

test = "02 04 01 00 00 00 00 00 00 55 D5 BA 42 5A B4 47 44 00 00 00 00 55 D5 BA 42 5A B4 47 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 D5 3A 43 00 00 00 00 00 00 00 00 55 D5 3A 43 00 00 00 00 00 00 2C 42 00 00 BE 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A0 C4 00 00 A0 44 CD CC 9A 44 68 66 3A C2 00 00 00 00 00 00 00 00 00 00 00 00 70 BB 43 00 70 C3 43 00 00 F3 4B 00 60 C5 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AB AA CA BF ED A0 58 C1 00 00 00 00 AB AA 4A"
AOBScan(test)
print (AOBScan(test))


It outputs 7B4A13D0 , when the right value is 0548FF4.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Aug 24, 2018 3:36 am    Post subject: Reply with quote

you can also use aa script

Code:

aobscan(something,02 04 01 00 00 00 00 00 00 55 D5 BA 42 5A B4 47 44 00 00 00 00 55 D5 BA 42 5A B4 47 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 D5 3A 43 00 00 00 00 00 00 00 00 55 D5 3A 43 00 00 00 00 00 00 2C 42 00 00 BE 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A0 C4 00 00 A0 44 CD CC 9A 44 68 66 3A C2 00 00 00 00 00 00 00 00 00 00 00 00 70 BB 43 00 70 C3 43 00 00 F3 4B 00 60 C5 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AB AA CA BF ED A0 58 C1 00 00 00 00 AB AA 4A)

label(whatiwant)
registersymbol(whatiwant)

something+430:
whatiwant:


as for the lua script , the lua version of AOBScan returns multiple results as a stringlist object. To get the address from that you need to get the first item from the result.
so
Code:

r=AOBScan("90 90 90")
print(r[0])
r.destroy()

_________________
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
mg_01
Cheater
Reputation: 0

Joined: 28 Jan 2018
Posts: 41

PostPosted: Fri Aug 24, 2018 4:15 am    Post subject: Reply with quote

Oh, thank you!

I had tried the AA script before, but it JUST occurred to me right now how I could use it to re-calculate the address. I have the script as one address, then another whose value is the AA script result, then my parent address that I re-calculate using the name of the AA script (ex: whatiwant).

This might end up being pretty fast, I just have to select Re-calculate and type in the name of the corresponding script for all 7 addresses.

Is there any way to have the Recalculate addres window open on the "Change to address" column by default? I'm just trying to think of ways to expedite the process using AHK or some other macro program.

I didn't know about the LUA syntax, thank you. I'm still going to try to piece together a LUA script. Isn't it possible to use LUA to set the value of an address (by finding it using an ID or description)? That might end up being my goal:

Clicking the AA scripts to find the addresses, then running the LUA script to change the values of the addresses to "whatiwant" or something.

*Edit*

Ah!

I found out that using the name of the label for recalculation doesn't work more than once since it becomes the permanent address. I have to keep the recalculation address static or it'll get messed up.

I guess the solution'll be to use AA to find everything, then LUA to print the hardcoded addresses to copy and use for recalculation.
Back to top
View user's profile Send private message
mg_01
Cheater
Reputation: 0

Joined: 28 Jan 2018
Posts: 41

PostPosted: Fri Aug 24, 2018 9:14 pm    Post subject: Reply with quote

I feel really dumb for asking this, but how do I add an offset in the LUA script?

For example, I wanted to add "1C" to the scan, and then print the address just like the other ones:

Code:
five=AOBScan("?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 80 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3F 00 00 80 3F 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F0 80 4F 00 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3F 00 00 00 00 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 80 3F 00 00 00 00 ??")
print ("05 Indicators-A")
print (five[0])
five.destroy()
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Aug 25, 2018 1:08 am    Post subject: Reply with quote

aobscan returns the address as a string so it has to be converted to an integer

so:
Code:

address=tonumber(five[0])+0x1c


also, i really recommend AA script for aobscan or use the memscan class and tell it to stop on first result, because lua's aobscan will notbstop scanning when it has found the first result

_________________
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
mg_01
Cheater
Reputation: 0

Joined: 28 Jan 2018
Posts: 41

PostPosted: Sat Aug 25, 2018 3:56 pm    Post subject: Reply with quote

the lua console returned an error saying it couldn't do arithmetic on a null value. i ended up writing this lua code for the time being:
Code:

two=AOBScan("00 00 00 00 00 00 20 C2 00 00 A0 40 00 00 20 C2 00")
if two == nil then return end
for i=0, two.Count-1, 1 do
print ("02 Combo Meter & Message+4")
print(two[0])
writeToClipboard(two[0].."+4")
end
two.destroy()


is it possible to pass the aa's result to clipboard? I was able to do it in the Lua script, but I dont know how to add the Lua syntax in the AA script so that it passes it to the clipboard once it finds it.

Something like this? I don't know how to pass the result of twofind to it.
Code:
loadlibrary(luaclient-i386.dll)
luacall(openLuaServer('CELUASERVER'))

CELUA_ServerName:
db 'CELUASERVER',0
 {$lua}
 [ENABLE]
aobscan(twofind,00 00 00 00 00 00 20 C2 00 00 A0 40 00 00 20 C2 00)

writeToClipboard("result")
[DISABLE]
 {$asm}
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Aug 26, 2018 12:10 am    Post subject: Reply with quote

i think it's better to use registersymbol(twofind)

then all addresses that have twofind as address will get updated.

(and you can give addresses like twofind+1c )

_________________
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
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