Some Lua Codes (Tools)

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
User avatar
SilverRabbit90
Table Makers
Table Makers
Posts: 270
Joined: Fri Jan 15, 2021 12:01 am
Reputation: 236

Re: Some Lua Codes (Tools)

Post by SilverRabbit90 »

------------------------------

30)AoB Generator [In Memory View]:

This Tool is used to generate an AoB script by clicking the "AoB Generator" button located near "Kernel tools" in the Memory View. You can choose to generate a script with the "jmp short" or "jmp far" method, and the script can be wildcarded or normal. This tool will always find a unique array (unlike the AoB script generated by Cheat Engine, which sometimes doesn't find a unique array). The Tool also has the ability to generate a script that will create a pointer (if you select neither "see x64" nor "see x32" then a script useful for setting values will be generated). The generated script is somewhat special since it's designed to always find both the offset and the register autonomously, you just need to update the AoB (when a game is updated).

To be able to set a value, you need to insert the code in this section:

local offsetHex = string.format("%08X", offset)

-- USER CUSTOM CODE
local customCode = [==[
<-------- Insert your code here
]==]

-- DYNAMIC ASSEMBLY TEMPLATE WITH CUSTOM CODE SUPPORT

the script will automatically write the changes made in newmem.


The code can be one of these types:

A)

mov [%s+%s],(float)5.6 <--- obviously you can set the type of value you want (int, double, etc...) although I recommend writing integral values (int) in HEX

if the code is of this type -- movss xmm7,[rcx+18] -- or of this type -- mov rbp,[rsi+000000E0] -- (also applies to 32 bit)

B)

mov %s,(double)100.25

if the code is of this type -- mov [rdi+000000A4],eax -- it would be like writing -- mov eax,(double)100.25 --




In case you want to let the user set a value by having inserted a registersymbol:

C)

push r15
mov r15,setTest <--- you can use any type of register you want and any type of variable, this is just an example
mov r15d,dword ptr [r15]
mov [%s+%s],r15d
pop r15

D)

mov %s,[setTest]

This script finds both the offset and the register by itself through %s which will be automatically replaced by the correct register or offset (it's not integrated in "see x32" and "see x64"), you just need to update the array if necessary.



Script:
AoB Generator.CT
(77.02 KiB) Downloaded 30 times

Post Reply

Who is online

Users browsing this forum: No registered users