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 


Cheat Engine Forum Index
PostGo back to topic
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Sun Jul 23, 2023 9:46 pm    Post subject:

I've compacted it a little bit for this specific scenario. The function I posted can be used more globally

To use Lua in the same script just use {$LUA}/{$ASM} pre-processors:
Code:

[ENABLE]
{$LUA}
if syntaxcheck then return end
local as = AOBScan('8B 42 20 48 8D 54 24 20 48 49 4c 24 48 48 83 C1 50', '*newmem*W*C')
if as.Count > 0 then
   registerSymbol('cash-items', as[1], true)
else
   error('AOB not found')
end
as.destroy()
{$ASM}

alloc(newmem, $1000)

label(cash)
label(items)
label(code)
label(return)

newmem:
   cmp [rcx+0238],00280008
   je cash
   cmp [rcx+0238],FFFFFFFF
   je items
   jmp code

cash:
   mov [rdx+20],#9999999
   mov eax,[rdx+20]
   lea rdx,[rsp+20]
   mov [rsp+48],rcx
   add rcx,50
   jmp return

items:
   mov [rdx+20],63
   mov eax,[rdx+20]
   lea rdx,[rsp+20]
   mov [rsp+48],rcx
   add rcx,50
   jmp return


code:
   mov eax,[rdx+20]
   lea rdx,[rsp+20]
   mov [rsp+48],rcx
   add rcx,50
   jmp return

cash-items:
   jmp far newmem
   nop 3

return:

[DISABLE]

cash-tems:
   db 8B 42 20 48 8D 54 24 20 48 49 4c 24 48 48 83 C1 50

unregistersymbol(cash-items)
unregistersymbol(newmem)
dealloc(cash-items)
dealloc(newmem)


Last edited by LeFiXER on Mon Jul 24, 2023 8:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
relentlesstech
Review: Approve
Post reference:
ReviewPosted: Sun Jul 23, 2023 10:01 pm

Seems to be working! Thank you!
Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites