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 


Can't inject my DLL. Force load module failed: KERNEL32

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Macadelic
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 1:50 am    Post subject: Can't inject my DLL. Force load module failed: KERNEL32 Reply with quote

Hello, I am facing a problem that does not come from cheat engine but I do not know where to find my answer.

Basically I created a DLL which works very well which I inject each time manually with CE
When I load my dll before the first loading in game, I have an error
Force load module failed: KERNEL32! SleepConditionVariableSRW.

But when I wait after the first loading of the game, my dll injects correctly.

I'm compiling my project via Visual Studio 2019, and I think it's a build properties issue with runtime dependencies. But I tried everything I did not succeed.

I am compiling in Release x86 and the Runtime Library is Multi-threaded (/ MT)

(I also tried to put the other choices but nothing works)

So I really don't see what else I can do.



cheatengine.png
 Description:
I have try every possibility
 Filesize:  39.9 KB
 Viewed:  12745 Time(s)

cheatengine.png


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

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

PostPosted: Thu Apr 23, 2020 3:19 am    Post subject: Reply with quote

call lua command waitForExports() before dll injection

or else try reinitializeSymbolhandler(true)

_________________
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
Macadelic
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 3:25 am    Post subject: Reply with quote

My problem is that I use cheat engine to inject my dll just to verify that it works, then I use an autoinject for my game.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Apr 23, 2020 3:38 am    Post subject: Reply with quote

You have to wait till the game has fully loaded before dll injection works. You can't inject a dll before the entrypoint has been 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
View user's profile Send private message MSN Messenger
Macadelic
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 5:40 am    Post subject: Reply with quote

Yes but I do not think that the problem comes from there, because with the same version of the dll if I withdraw all my menu and leave that the main thing it works at startup, it is just this Kernel32SleepConditionVariableSRW which prevents the execution of my dll . I don't know what it could be.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Apr 23, 2020 6:05 am    Post subject: Reply with quote

yes

Kernel32SleepConditionVartiableSRW is not a real export in kernel32 but a redirect to api-ms-win-core-synch-l1-2-0.SleepConditionVariableSRW

and that one is likely a redirect to kernelbase.SleepConditionVariableSRW

See if you can compile your dll without having that in there, or fix the force load module code (e.g in ce you can manually bypass that issue by registering SleepConditionVariableSRW and point it to kernelbase.SleepConditionVariableSRW )

_________________
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
Macadelic
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 6:42 am    Post subject: Reply with quote

Ah interesting, but what I don't understand is why it crashes, does my DLL need this function and it can't find it? If that's what I don't understand, it should be compiled with everything it needs right?

Thank you for your answers
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