View previous topic :: View next topic |
Author |
Message |
educofu Expert Cheater
Reputation: 3
Joined: 21 Aug 2009 Posts: 171 Location: Brazil,MG,OP
|
Posted: Thu Dec 24, 2009 12:25 pm Post subject: CREATETHREAD understanding |
|
|
in AA,what is and how do i use the createthread?
_________________
"I finally started thinking outside of the box, only to find myself in a larger box." |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Wed Jan 06, 2010 3:21 pm Post subject: |
|
|
let's say you have a piece of code you want to execute, but don't want to hook the game's api
you can then use createthread to execute that code:
Code: |
alloc(mycode,4096)
CREATETHREAD(mycode);
mycode:
mov eax,[gamex.dll+123456]
mov ebx,[eax+4c]
mov [eax+48],ebx
push #1000
call sleep
jmp mycode
|
would for example set the health to the max health every second
or if you want to call an ingame routine without hooking you can also use createthread
Code: |
createthread(togglegodmode)
|
assuming togglegodmode contains the address of the game's routine to toggle godmode, and accepts a parameterless call, otherwhise you have to allocate an initialization routine that sets up the parameters and then call togglegodmode (and createthread on the initialization routine)
_________________
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 |
|
 |
educofu Expert Cheater
Reputation: 3
Joined: 21 Aug 2009 Posts: 171 Location: Brazil,MG,OP
|
Posted: Wed Jan 06, 2010 5:15 pm Post subject: |
|
|
thanks.
_________________
"I finally started thinking outside of the box, only to find myself in a larger box." |
|
Back to top |
|
 |
Aqua Regia Advanced Cheater
Reputation: 0
Joined: 12 May 2009 Posts: 51 Location: Sweden
|
Posted: Sat Mar 20, 2010 2:40 pm Post subject: |
|
|
If you use createthread in a cheat table, do you have to destroy the thread under [DISABLE]?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Sat Mar 20, 2010 3:40 pm Post subject: |
|
|
in case of threads you have to add in your own disable way , and don't free the associated memory
e.g:
[enable]
alloc(mycode,4096)
CREATETHREAD(mycode);
label(mustend)
registersymbol(mustend)
mycode:
mov eax,[gamex.dll+123456]
mov ebx,[eax+4c]
mov [eax+48],ebx
push #1000
call sleep
cmp [mustend],1
jne mycode
ret
mustend:
dd 0
[disable]
mustend:
dd 1
_________________
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 |
|
 |
Aqua Regia Advanced Cheater
Reputation: 0
Joined: 12 May 2009 Posts: 51 Location: Sweden
|
Posted: Sat Mar 20, 2010 4:47 pm Post subject: |
|
|
Thanks for responding, any idea why the program would crash when I execute that code?
I'm using Windows 7 64-bit version. When I tried the first code you posted in this thread it didn't crash when I removed the sleep part.
Description: |
|
Filesize: |
40.77 KB |
Viewed: |
118895 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Sat Mar 20, 2010 7:21 pm Post subject: |
|
|
when you say you removed the sleep part, did you also remove the parameter push ?
If not, that's the problem (by default a created thread has as return value on the stack the address of terminatethread, by messing with the stack, you'll start crashing
(also, infinitely looping like that is really a bad idea)
edit:
and of course
mov eax,[gamex.dll+123456]
mov ebx,[eax+4c]
mov [eax+48],ebx
will 100% cause a crash in almost any game if the address/pointer is wrong
edit2:
And again, don't even dare to dealloc the memory of the thread
_________________
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 |
|
 |
Aqua Regia Advanced Cheater
Reputation: 0
Joined: 12 May 2009 Posts: 51 Location: Sweden
|
Posted: Sat Mar 20, 2010 7:39 pm Post subject: |
|
|
I was wrong, it's the push part. If I comment that part out it doesn't crash.
This is the code you posted above, I only replaced the part right after "mycode:". What's the return doing there anyway? And are symbols like variables or something, and "dd" sets them?
Code: | [enable]
alloc(mycode,4096)
CREATETHREAD(mycode);
label(mustend)
registersymbol(mustend)
mycode:
inc [0028FF44]
push #1000
call sleep
cmp [mustend],1
jne mycode
ret
mustend:
dd 0
[disable]
mustend:
dd 1 |
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Sat Mar 20, 2010 8:48 pm Post subject: |
|
|
symbols are names you can use throughout ce
e.g in the memory view you can goto address "mustend" and it'll go there
and you can even put it into your addresslist
and dd initializes a 4 byte value at the current address
dq a 8 byte, dw a 2 byte and db a 1 byte
and as I said in the previous post, the ret will cause the thread to jump to the terminatethread function so it'll terminate itself
_________________
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 |
|
 |
XaLeX Expert Cheater
Reputation: 0
Joined: 19 Aug 2008 Posts: 226
|
Posted: Thu Jul 01, 2010 8:22 am Post subject: |
|
|
There's something i don't get about this..
Code: | [ENABLE]
globalalloc(routine,256)
createthread(routine)
label(end)
registersymbol(end)
routine:
push eax
push ecx
//do stuff
pop ecx
pop eax
push #1000
call sleep
cmp [end],1
jne routine //if !end then loop routine
ret
end:
dd 0
[disable]
end:
dd 1 |
and it says, "Error in line 2 (end:) this address specifier is not valid"
i tried playing with (global)alloc, label and stuff, but there's always a different error
..i got around using end by using an ingame address, but everything crashes anyway xD
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Thu Jul 01, 2010 9:20 am Post subject: |
|
|
that script will work, but it looks like you found a bug
push #1000 is assembled wrong, replace it with "push 000003e8"
I'll see if I can quickly upload a fixed version
_________________
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 |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Thu Jul 01, 2010 9:25 am Post subject: |
|
|
ok, redownload ce and it'll be fixed
one thing I have to say about that script: You have to wait a full second before you can re-enable it else you might end up having multiple threads running.
A lower sleep (e.g 10 ms) will fix it and won't even lag the game at all (1 millisecond is a really long time for a cpu)
_________________
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 |
|
 |
XaLeX Expert Cheater
Reputation: 0
Joined: 19 Aug 2008 Posts: 226
|
Posted: Thu Jul 01, 2010 10:02 am Post subject: |
|
|
woah, i'm glad i could help improve CE even though i gave you work to do on your birthday xD
anyway, you've been very helpful, as always.. thanks ^_^
|
|
Back to top |
|
 |
Twizz Newbie cheater
Reputation: 0
Joined: 21 Jan 2011 Posts: 12
|
Posted: Sat Jan 29, 2011 9:33 pm Post subject: |
|
|
Dark Byte wrote: | in case of threads you have to add in your own disable way , and don't free the associated memory
e.g:
[enable]
alloc(mycode,4096)
CREATETHREAD(mycode);
label(mustend)
registersymbol(mustend)
mycode:
mov eax,[gamex.dll+123456]
mov ebx,[eax+4c]
mov [eax+48],ebx
push #1000
call sleep
cmp [mustend],1
jne mycode
ret
mustend:
dd 0
[disable]
mustend:
dd 1 |
If we don't free the associated memory... then will we alloc (in your example) a KB of memory everytime we tick it? If so, when will it become available to the system again? When we close cheat engine?
When the thread reaches a ret, does it terminate? What if the thread reaches a ret and there is something on the stack, will it jump there?
Haha, maybe noob questions, but I'm still trying to learn. Thanks
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25700 Location: The netherlands
|
Posted: Sat Jan 29, 2011 9:38 pm Post subject: |
|
|
Assuming you only want to do it one time.
But if you do want to call it multiple times you can replace the alloc with globalalloc
That way it will reuse the memory next time it's executed
_________________
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 |
|
 |
|