View previous topic :: View next topic |
Author |
Message |
zm0d Master Cheater
Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Fri Nov 29, 2013 9:34 am Post subject: [DLL Injection] Injection don't work on other PCs |
|
|
Hi Hitler...
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
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25783 Location: The netherlands
|
Posted: Fri Nov 29, 2013 10:36 am Post subject: |
|
|
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 |
|
 |
zm0d Master Cheater
Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Fri Nov 29, 2013 10:57 am Post subject: |
|
|
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
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Fri Nov 29, 2013 11:42 am Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25783 Location: The netherlands
|
Posted: Fri Nov 29, 2013 11:49 am Post subject: |
|
|
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 |
|
 |
SteveAndrew Master Cheater
Reputation: 30
Joined: 02 Sep 2012 Posts: 323
|
Posted: Fri Nov 29, 2013 12:01 pm Post subject: Re: [DLL Injection] Injection don't work on other PCs |
|
|
zm0d wrote: | Hi SteveAndrew...
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  |
Ahh rookie mistake!
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 [at least for me in vc++ 2013]
_________________
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Fri Nov 29, 2013 12:09 pm Post subject: |
|
|
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 |
|
 |
zm0d Master Cheater
Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Fri Nov 29, 2013 3:58 pm Post subject: |
|
|
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 seriosly
|
|
Back to top |
|
 |
SteveAndrew Master Cheater
Reputation: 30
Joined: 02 Sep 2012 Posts: 323
|
Posted: Fri Nov 29, 2013 4:11 pm Post subject: |
|
|
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 seriosly  |
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!
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
|
Back to top |
|
 |
|