 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Tue Mar 06, 2012 3:50 am Post subject: How to write a game cheat in lua? |
|
|
Suppose this is my script. What should I do with it.
| Code: | [ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
fstp dword ptr [edi+000002CC]
exit:
jmp returnhere
"crimsonland.exe"+1779E:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"crimsonland.exe"+1779E:
fstp dword ptr [edi+000002CC]
//Alt: db D9 9F CC 02 00 00 |
I pasted this in my lua table but it did nothing.
| Code: | myscript= [[//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
fstp dword ptr [edi+000002CC]
exit:
jmp returnhere
"crimsonland.exe"+1779E:
jmp newmem
nop
returnhere:]]
autoAssemble(myscript)
|
But it does nothing. What should I do? |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 473
Joined: 09 May 2003 Posts: 25909 Location: The netherlands
|
Posted: Tue Mar 06, 2012 5:17 am Post subject: |
|
|
Have you executed that lua script?
Was a process opened with ce when you executed that script ? _________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Tue Mar 06, 2012 10:52 pm Post subject: |
|
|
How to disable my script?
And how do I disable my script after 10 seconds?
| Code: | myscript = [[alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
fstp dword ptr [edi+000002CC]
mov dword ptr [edi+000002CC],200
exit:
jmp returnhere
"crimsonland.exe"+1779E:
jmp newmem
nop
returnhere:
]]
offscript = [[dealloc(newmem)
"crimsonland.exe"+1779E:
fstp dword ptr [edi+000002CC]
//
]]
timer = createTimer(nil,true)
timer_setInterval(timer,20000)
i=1
function onhere()
autoAssemble(myscript)
if i==1 then
timer_onTimer(timer, offok)
i=2
end
end
offok=function offhere()
autoAssemble(offscript)
end
onhere() |
|
|
| 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
|
|