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 


CreateThread question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
KalasDev
Master Cheater
Reputation: 1

Joined: 29 May 2016
Posts: 311

PostPosted: Fri Apr 20, 2018 3:21 pm    Post subject: CreateThread question Reply with quote

Hey, I'm new to the whole CreateThread thing, I just wanted to know how could I overcome the error with the jmp:

The function is taken from _addallitems function, just went and grabbed the function from start, and used the opcodes and simply getting an error with the jmp functions.

Code:
[ENABLE]

globalalloc(Thread,248)
createthread(Thread)

Thread:

push rbp
mov rbp,rsp
sub rsp,00000080 { 128 }
mov [rbp-28],00000000 { 0 }
mov [rbp-30],00000000 { 0 }
mov [rbp-34],00000000 { 0 }
mov [rbp-40],00000000 { 0 }
mov rax,[07344E40] { [3E579B28] }
mov rax,[rax+20]
mov [rbp-30],rax
mov [rbp-34],00000000 { 0 }
jmp TheForest:DebugConsole:_addAllItems+1a2
nop
mov rax,[rbp-30]
movsxd  rcx,dword ptr [rbp-34]
movsxd  rcx,ecx
cmp [rax+18],ecx
jbe TheForest:DebugConsole:_addAllItems+1d2
lea rax,[rax+rcx*8+20]
mov rax,[rax]
mov [rbp-28],rax
mov rax,[rbp-28]
movsxd  rax,dword ptr [rax+00000098]
test eax,eax
jl TheForest:DebugConsole:_addAllItems+150
mov rax,[rbp-28]
mov [rbp-50],rax
mov [rbp-54],00000400 { 1024 }
mov rax,[rbp-50]
cmp dword ptr [rax],00 { 0 }
mov rax,[rbp-50]
movsxd  rax,dword ptr [rax+0000008C]
movsxd  rcx,dword ptr [rbp-54]
and eax,ecx
test eax,eax
sete al
movzx rax,al
test eax,eax
sete byte ptr [rbp-55]
movzx eax,byte ptr [rbp-55]
test eax,eax
jne TheForest:DebugConsole:_addAllItems+150
mov rax,[07353C70] { [95101700] }
mov [rbp-60],rax
mov rax,[rbp-60]
cmp dword ptr [rax],00 { 0 }
mov rax,[rbp-60]
mov rax,[rax+000000A8]
mov [rbp-68],rax
mov rax,[rbp-68]
mov rcx,[rbp-28]
movsxd  rdx,dword ptr [rcx+00000088]
mov rcx,rax
sub rsp,20 { 32 }
cmp dword ptr [rax],00 { 0 }
mov r11,0000000052F54D07 { [232] }
call r11
add rsp,20 { 32 }
test eax,eax
je TheForest:DebugConsole:_addAllItems+150
mov rax,[07353C70] { [95101700] }
mov rcx,[rbp-28]
movsxd  rdx,dword ptr [rcx+00000088]
mov rcx,rax
mov r8d,000186A0 { 100000 }
mov r9d,00000001 { 1 }
push 00 { 0 }
push 00 { 0 }
sub rsp,20 { 32 }
cmp dword ptr [rax],00 { 0 }
mov r11,0000000052EF23EC { [4DDC0FE8] }
call r11
add rsp,30 { 48 }
jmp TheForest:DebugConsole:_addAllItems+199
mov rax,[rbp-20]
mov rax,[rbp-20]
mov [rbp-40],rax
sub rsp,20 { 32 }
mov r11,System:Object:__icall_wrapper_mono_thread_get_undeniable_exception { [EC8B4855] }
call r11
add rsp,20 { 32 }
mov [rbp-48],rax
mov rax,[rbp-48]
test rax,rax
je TheForest:DebugConsole:_addAllItems+197
mov rax,[rbp-48]
mov rcx,rax
mov r11,00000000073D1B90 { [6ADC8B4C] }
call r11
jmp TheForest:DebugConsole:_addAllItems+199
movsxd  rax,dword ptr [rbp-34]
inc eax
mov [rbp-34],eax
movsxd  rax,dword ptr [rbp-34]
mov rcx,[rbp-30]
movsxd  rcx,dword ptr [rcx+18]
cmp eax,ecx
jl TheForest:DebugConsole:_addAllItems+48
mov ecx,E49CA240 { [073CAAA0] }
sub rsp,20 { 32 }
mov r11,0000000007A0D69A { [232] }
call r11
add rsp,20 { 32 }
leave
ret

[DISABLE]


It's for the game called, The Forest (Unity Engine).
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Fri Apr 20, 2018 4:28 pm    Post subject: Reply with quote

for unity games the thread must attach itself first so the tls is valid

i don't know right now but i think it"s something called attachthread which needs the domain

alternatively, look into the ce lua command mono_invoke_method which will do the same

_________________
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
View user's profile Send private message MSN Messenger
KalasDev
Master Cheater
Reputation: 1

Joined: 29 May 2016
Posts: 311

PostPosted: Fri Apr 20, 2018 4:37 pm    Post subject: Reply with quote

Thanks for the info.
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 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