 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
catshy How do I cheat?
Reputation: 0
Joined: 01 Feb 2019 Posts: 9
|
Posted: Mon Jul 01, 2019 10:18 am Post subject: Execute C function in Lua |
|
|
Hello, I have a function in C:
Code: | #define CALL_6(return_type, call_type, address, a1, a2, a3, a4, a5, a6) ((return_type(call_type *)(int, int, int, int, int, int))(address))((int)(a1), (int)(a2), (int)(a3), (int)(a4), (int)(a5), (int)(a6))
void SaveGame(char* save_name) { CALL_6(void, __thiscall, 0x4BEB60, *(int*)0x699538, save_name, 1, 1, 1, 0); } |
how to execute this code in LUA/CE?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25804 Location: The netherlands
|
Posted: Mon Jul 01, 2019 12:43 pm Post subject: |
|
|
Normally I'd say:
Code: |
function SaveGame(save_name)
executeCodeEx(0,nil,0x4beb60,{type=0,value=0x688538},{type=3,value=save_name},{type=0,value=1},{type=0,value=1},{type=0,value=1},{type=0,value=0})
end
|
but there's a bug with more than 4 parameters, so you have to wait till next version
(and there you can do:
Code: |
function SaveGame(save_name)
executeCodeEx(0,nil,0x4beb60,0x688538, save_name, 1, 1, 1,0)
end
|
)
_________________
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 |
|
 |
catshy How do I cheat?
Reputation: 0
Joined: 01 Feb 2019 Posts: 9
|
Posted: Mon Jul 01, 2019 2:04 pm Post subject: |
|
|
Thanks for answer Dark Byte.
So I have two question now.
1. Do u know when u done new version of CE?
2. If is not time-consuming can u write this function in ASM (maybe then it will work)
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25804 Location: The netherlands
|
Posted: Mon Jul 01, 2019 3:21 pm Post subject: |
|
|
is the target 64 or 32 bit ?
_________________
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 |
|
 |
catshy How do I cheat?
Reputation: 0
Joined: 01 Feb 2019 Posts: 9
|
Posted: Mon Jul 01, 2019 3:41 pm Post subject: |
|
|
64 bit
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25804 Location: The netherlands
|
Posted: Mon Jul 01, 2019 4:32 pm Post subject: |
|
|
something like this
Code: |
save_name:
db 'save_name text',0
...
sub rsp,#56 //or sub rsp,#48 if already aligned
mov rcx,699538
//mov [rsp],rcx
mov rdx,save_name
//mov [rsp+8],rdx
mov r8,1
//mov [rsp+10],r8
mov r9,1
//mov [rsp+18],r9
mov [rsp+20],1
mov [rsp+28],0
call 4BEB60
add rsp,#56 //or 48 (see sub rsp)
|
_________________
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 |
|
 |
catshy How do I cheat?
Reputation: 0
Joined: 01 Feb 2019 Posts: 9
|
Posted: Tue Jul 02, 2019 1:27 am Post subject: |
|
|
Thanks for your code. Im trying to use it, but I have this (attachment).
Can u help me to fix it?
Description: |
|
Filesize: |
23.22 KB |
Viewed: |
4260 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25804 Location: The netherlands
|
Posted: Tue Jul 02, 2019 5:15 am Post subject: |
|
|
have you targeted a 64 bit process?
also you havn't allocated or designated an address to write to
_________________
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 |
|
 |
|
|
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
|
|