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 


[DLL Injection] Injection don't work on other PCs

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
zm0d
Master Cheater
Reputation: 7

Joined: 06 Nov 2013
Posts: 423

PostPosted: Fri Nov 29, 2013 9:34 am    Post subject: [DLL Injection] Injection don't work on other PCs Reply with quote

Hi Hitler... Smile

Finally, I've finished my aimbot for the arcade shooter Intake. The code is stored in a DLL. When I inject the DLL, the aimbot is active... well on my PC it works... I use winject and have compiled the DLL in Visual Studio 2012. On every other PC (3, with Win7 x64), I tried to inject my DLL, but it not even reaches the DllMain function. Also I tried to inject my DLL with 2 other injectors (CE and ExtremeInjector) but all failed.

VC++ Runtime up to date. Also I disabled DEP and UAC. But still the same error Sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Nov 29, 2013 10:36 am    Post subject: Reply with quote

Do you test it on the game, or on a test process? If test process, is it the same type (32-bit/ 64-bit)


If the process, does your game have permission to open the dll path?
And how do you test if dllmain is loaded ?

_________________
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
zm0d
Master Cheater
Reputation: 7

Joined: 06 Nov 2013
Posts: 423

PostPosted: Fri Nov 29, 2013 10:57 am    Post subject: Reply with quote

Dark Byte wrote:
Do you test it on the game, or on a test process?

I test it on the games process, that runs as 32 bit Smile

Dark Byte wrote:
If the process, does your game have permission to open the dll path?

What do you mean with that? Could there be different permission, on exactly the same gameversion? The injection is successful on my pc and the aimbot works nicely.

Dark Byte wrote:
And how do you test if dllmain is loaded ?

After I got setup by this problem, I just build a second version of my DLL, that should pop-up a MessageBox right after process attached and before I start my thread.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Fri Nov 29, 2013 11:42 am    Post subject: Reply with quote

It sounds like an imported module that your DLL is using is missing on the other machines and your DLL is failing to initialize because of it.

Try creating a loader stub for your injection to call LoadLibrary then GetLastError to see what the result was.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Nov 29, 2013 11:49 am    Post subject: Reply with quote

Have you installed the 32-bit visual studio runtime? I noticed only installing the 64-bit runtime won't install the files for 32-bit

Also, did you compile with the debug runtime,or release runtime? (I always recommend static linking the runtime so stuff like this doesn't happen)

_________________
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
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Fri Nov 29, 2013 12:01 pm    Post subject: Re: [DLL Injection] Injection don't work on other PCs Reply with quote

zm0d wrote:
Hi SteveAndrew... Smile

Finally, I've finished my aimbot for the arcade shooter Intake. The code is stored in a DLL. When I inject the DLL, the aimbot is active... well on my PC it works... I use winject and have compiled the DLL in Visual Studio 2012. On every other PC (3, with Win7 x64), I tried to inject my DLL, but it not even reaches the DllMain function. Also I tried to inject my DLL with 2 other injectors (CE and ExtremeInjector) but all failed.

VC++ Runtime up to date. Also I disabled DEP and UAC. But still the same error Sad



Ahh rookie mistake! Smile

For some reason by default microsoft makes it link to the dynamic runtime... Which means the computer you intend to execute your executable (.dll / .exe/ whatever) will either need visual studio itself installed or at least the visual c++ redistributable package from your version of vc++!

Getting around that is simple at the cost of a very slightly enlarged executable! But that's so worth it, so you know it will work!


Also it doesn't seem very clear that choosing /MT Multi-threaded over default /MD Multi-threaded DLL is actually static linking rather than dynamic linking but that is in fact what it does!

So always when you create a project change that setting right away before you forget, or I think latest versions allow you to save it as default Very Happy [at least for me in vc++ 2013]

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Fri Nov 29, 2013 12:09 pm    Post subject: Reply with quote

As he stated the runtimes are up to date on the other machines so the runtime library option should not make a difference on which is selected. You only need to static link to the runtime if you want to ensure your stuff works without people needing the runtime dependencies on their machine.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
zm0d
Master Cheater
Reputation: 7

Joined: 06 Nov 2013
Posts: 423

PostPosted: Fri Nov 29, 2013 3:58 pm    Post subject: Reply with quote

SteveAndrew wrote:
Ahh rookie mistake! Smile

ouchhh :/ shame on me :OOOOO

Well, I followed SteveAndrew's hint and it WORKED... but on my other pc I've all VC++ Runtimes installed :/ exactly the same (if I can trust the version number in the software list)...
I checked this a little bit more and installed my VS2012 on my laptop and I was able to inject my smaller DLL, too... strange..

BTW: My DLL size increases from 32KB to 155KB

Thank you all for your help! Best forum out there Smile seriosly Razz
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Fri Nov 29, 2013 4:11 pm    Post subject: Reply with quote

zm0d wrote:
SteveAndrew wrote:
Ahh rookie mistake! Smile

ouchhh :/ shame on me :OOOOO

Well, I followed SteveAndrew's hint and it WORKED... but on my other pc I've all VC++ Runtimes installed :/ exactly the same (if I can trust the version number in the software list)...
I checked this a little bit more and installed my VS2012 on my laptop and I was able to inject my smaller DLL, too... strange..

BTW: My DLL size increases from 32KB to 155KB

Thank you all for your help! Best forum out there Smile seriosly Razz


Glad you've seen that it can work at least! Installing VS2012 definitely made sure it installed what is necessary!
You thought you had everything you needed to run the 'smaller' dynamically linked dll, but you did not! Smile

Without static linking, or installing Visual Studio / C++ Express, you can get a computer to run the 'smaller' dynamically linked executables by installing the 'redistributable' package for that version. So for VC++ 2013 you'd get the 2013 one...

For 2012 you'd need this one I'm fairly certain: (Did you install this?)
http://www.microsoft.com/en-us/download/details.aspx?id=30679

That's why I find it much easier just to deal with slight increase in file size then trying to install redistributable packages (finding the right one too) everywhere!

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Fri Nov 29, 2013 4:43 pm    Post subject: Reply with quote

Visual Studio 2010 Redist
x86: http://www.microsoft.com/en-us/download/details.aspx?id=5555
x64: http://www.microsoft.com/en-us/download/details.aspx?id=14632

Visual Studio 2012 Redist
http://www.microsoft.com/en-us/download/details.aspx?id=30679

Visual Studio 2013 Redist
http://www.microsoft.com/en-us/download/details.aspx?id=40784

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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