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 


Making a CETRAINER with a custom PID entry field

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

Joined: 04 Jun 2023
Posts: 6

PostPosted: Sun Jun 04, 2023 10:34 pm    Post subject: Making a CETRAINER with a custom PID entry field Reply with quote

Hello, I would like to convert my current auto assembler script into a CETRAINER. I want to provide the user with the option to enter the PID for their chosen game and execute the code accordingly. However, I'm unsure where to begin. Since it's a browser game, I can't simply auto-attach to the .exe. Any assistance would be greatly appreciated as I'm still a beginner in this field. Confused
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Mon Jun 05, 2023 7:04 am    Post subject: Reply with quote

You can do that with Lua:
Code:

local pid = inputQuery('Enter Process ID', 'Enter the ID of the process:', '')
if pid then
  openProcess(tonumber(pid, 16))
end
Back to top
View user's profile Send private message
Reubinator
How do I cheat?
Reputation: 0

Joined: 04 Jun 2023
Posts: 6

PostPosted: Mon Jun 05, 2023 7:44 am    Post subject: Reply with quote

Thank you very much Cool Laughing
Back to top
View user's profile Send private message
Reubinator
How do I cheat?
Reputation: 0

Joined: 04 Jun 2023
Posts: 6

PostPosted: Mon Jun 05, 2023 7:38 pm    Post subject: Reply with quote

Still having issues, here is my code. Solution is probably very obvious Rolling Eyes


local pid = inputQuery('Enter Process ID', 'Enter the ID of the process:', '')
if pid then
openProcess(tonumber(pid, 16))
local script = [[
aobscan(GODMODE1,44 89 44 0A 68 8B 4D DC 8B) // should be unique
alloc(newmem1,$1000,GODMODE1)

label(code1)
label(return1)

newmem1:
mov r8d,64
jmp return1

code1:
mov [rdx+rcx+68],r8d
jmp return1

GODMODE1:
jmp newmem1
nop 3
return1:
registersymbol(GODMODE1)

aobscan(GODMODE2,44 2B C7 44 89 44 0A 6C) // should be unique
alloc(newmem2,$1000,GODMODE2)

label(code2)
label(return2)

newmem2:
nop

code2:
nop
mov [rdx+rcx+6C],r8d
jmp return2

GODMODE2:
jmp newmem2
nop 3
return2:
registersymbol(GODMODE2)

aobscan(INFINITEAMMO,89 54 03 5C 8B 7C 03 2Cool // should be unique
alloc(newmem3,$1000,INFINITEAMMO)

label(code3)
label(return3)

newmem3:
nop

code3:
nop
mov edi,[rbx+rax+28]
jmp return3

INFINITEAMMO:
jmp newmem3
nop 3
return3:
registersymbol(INFINITEAMMO)

aobscan(MAXMATS,2B DA 89 5C 01 7C) // should be unique
alloc(newmem4,$1000,MAXMATS)

label(code4)
label(return4)

newmem4:
nop

code4:
nop
add ebx,edx
mov [rcx+rax+7C],ebx
jmp return4

MAXMATS:
jmp newmem4
nop
return4:
registersymbol(MAXMATS)

[DISABLE]

GODMODE1:
db 44 89 44 0A 68

unregistersymbol(GODMODE1)
dealloc(newmem1)

GODMODE2:
db 44 2B C7 44 89 44 0A 6C

unregistersymbol(GODMODE2)
dealloc(newmem2)

INFINITEAMMO:
db 89 54 03 5C 8B 7C 03 28

unregistersymbol(INFINITEAMMO)
dealloc(newmem3)

MAXMATS:
db 2B DA 89 5C 01 7C

unregistersymbol(MAXMATS)
dealloc(newmem4)
]]
autoAssemble(script)
end
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Tue Jun 06, 2023 5:24 am    Post subject: Reply with quote

Copy this and paste it into the main Cheat Engine window of an empty table.
Code:

<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"Attach To Process"</Description>
      <LastState/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$LUA}
if syntaxcheck then return end
local pid = inputQuery('Enter Process ID', 'Enter the ID of the process:', '')
if pid then
  openProcess(tonumber(pid, 16))
  AddressList.MemoryRecord['Multihack'].Active = true
end
{$ASM}
[DISABLE]
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>1</ID>
          <Description>"Multihack"</Description>
          <LastState/>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
aobscan(GODMODE1,44 89 44 0A 68 8B 4D DC 8B) // should be unique
alloc(newmem1,$1000,GODMODE1)

label(code1)
label(return1)

newmem1:
mov r8d,64
jmp return1

code1:
mov [rdx+rcx+68],r8d
jmp return1

GODMODE1:
jmp newmem1
nop 3
return1:
registersymbol(GODMODE1)

aobscan(GODMODE2,44 2B C7 44 89 44 0A 6C) // should be unique
alloc(newmem2,$1000,GODMODE2)

label(code2)
label(return2)

newmem2:
nop

code2:
nop
mov [rdx+rcx+6C],r8d
jmp return2

GODMODE2:
jmp newmem2
nop 3
return2:
registersymbol(GODMODE2)

aobscan(INFINITEAMMO,89 54 03 5C 8B 7C 03) // 2Cool // should be unique ------------------------ Check here, says 2Cool
alloc(newmem3,$1000,INFINITEAMMO)

label(code3)
label(return3)

newmem3:
nop

code3:
nop
mov edi,[rbx+rax+28]
jmp return3

INFINITEAMMO:
jmp newmem3
nop 3
return3:
registersymbol(INFINITEAMMO)

aobscan(MAXMATS,2B DA 89 5C 01 7C) // should be unique
alloc(newmem4,$1000,MAXMATS)

label(code4)
label(return4)

newmem4:
nop

code4:
nop
add ebx,edx
mov [rcx+rax+7C],ebx
jmp return4

MAXMATS:
jmp newmem4
nop
return4:
registersymbol(MAXMATS)

[DISABLE]

GODMODE1:
db 44 89 44 0A 68

unregistersymbol(GODMODE1)
dealloc(newmem1)

GODMODE2:
db 44 2B C7 44 89 44 0A 6C

unregistersymbol(GODMODE2)
dealloc(newmem2)

INFINITEAMMO:
db 89 54 03 5C 8B 7C 03 28

unregistersymbol(INFINITEAMMO)
dealloc(newmem3)

MAXMATS:
db 2B DA 89 5C 01 7C

unregistersymbol(MAXMATS)
dealloc(newmem4)

</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
</CheatTable>
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