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 crashes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Roogue
Newbie cheater
Reputation: 0

Joined: 31 May 2019
Posts: 14

PostPosted: Tue Jun 04, 2019 5:36 am    Post subject: CreateThread crashes Reply with quote

Hello guys, I got inside of my game a function called DoAttackMelee() who takes 3 parameters, so I use the following code :

alloc(create, 2000)
CREATETHREAD(create)

create:
push 0 (param 1)
push 1C (param 2)
push 008CD243 (pointer parameter 3)
call 04002345 (call func)
ret

i'm not doing ret 0C because it's already done in the function (at the end)

anyone have an idea ?

thanks
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Jun 04, 2019 8:07 am    Post subject: Reply with quote

How do you know that the functionname is DoAttackMelee? Is it a mono target?

If so, you need to attach the thread to the mono system first so that it's thread local storage can be configured properly

If not, and you got it from a pdb or something, then make sure the parameters are correct.
First thing I see is that you name the parameters wrong. You've got them in the wrong order(last parameter pushed is the first parameter). But assuming that's just a typo, then make sure that 008CD243 is the correct address.
Usually it'd be a class instance address that you have to scan for or get from a code injection somewhere else.

_________________
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
Roogue
Newbie cheater
Reputation: 0

Joined: 31 May 2019
Posts: 14

PostPosted: Tue Jun 04, 2019 3:00 pm    Post subject: Reply with quote

Dark Byte wrote:
How do you know that the functionname is DoAttackMelee? Is it a mono target?

If so, you need to attach the thread to the mono system first so that it's thread local storage can be configured properly

If not, and you got it from a pdb or something, then make sure the parameters are correct.
First thing I see is that you name the parameters wrong. You've got them in the wrong order(last parameter pushed is the first parameter). But assuming that's just a typo, then make sure that 008CD243 is the correct address.
Usually it'd be a class instance address that you have to scan for or get from a code injection somewhere else.


Hello,

I know the function is DoAttackMelee because i traced it from the source code of the game.

I made an error in my original post, i pushed the parameters in the right order. I searched in memory view a function calling the DoAttackMelee function, and i looked the parameters pushed onto the stack before the function call and did exactly the same..

I think the program is crashing because in the AA code i posted in the original post there is a retn leading to nowhere...

Thanks for the help and hope someone will find the problem for me
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Wed Jun 05, 2019 7:47 am    Post subject: Reply with quote

A return leads somewhere unless your stack is not aligned. It usually leads back to the beginning of the thread. If that's what you want then just ignore the stack and use a jmp create. Then you can trace it to see what the stack is doing. You should probably include a sleep too so it's not overbearing the processor.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Wed Jun 05, 2019 9:09 am    Post subject: Reply with quote

64-bit and 32-bit code have completely different calling conventions. Which is this?
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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