Hack Forums
[C] [TuT] .DLL Injection (Games) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] [TuT] .DLL Injection (Games) (/showthread.php?tid=363480)

Pages: Pages 1 2


[TuT] .DLL Injection (Games) - The-One - Apr 12, 2010

Tutorial wrote by me, I did the comments with the '//'.
NOTE:
  • Inject it to a process, which procces is decided by the injector (http://pastebin.com/TnCxvupB = Injector Source VB.net)

  • This has NO menu/GUI(Look down this post for a base with menu/GUI)




Code
#include <windows.h>
#include <stdio.h>

#define ADR_SPEED 0x123819 // Not existing

/*------- Hacks Here -------*/

void SpeedHack() // When SpeedHack(); Is called
{
if(GetAsyncKeyState(VK_NUMPAD0) &1) // If GetAsyncKeyState NUMPAD 0 is pressed
{
*(float*)(ADR_SPEED) = 200; // float(used to 'float' values) to 200 (Normal value = 95)
}
}


void HackThread() // HackThread makes the hack inject
{
for(;; )
{
SpeedHack(); // This puts the hack on.
}
Sleep(200); // Protect from overload
}

BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) // DLLMain uses for threading
{
if(dwReason == DLL_PROCESS_ATTACH) // If its attached
{
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0); // Make thread for the HackThread, so our hacks run when the hack is injected.
}
return TRUE;
}

EDIT:
Ok, im posting this now, its called inline asm, which means, using C++ to write to the asm of the .exe (I COPIED THIS FROM A SITE ILL CODE FOR)
Spoiler (Click to View)

My OLD Full base + menu + more advanced codes + bypass cheat detection(Full Source) =
Download Click

VTable Numbers:
Vtable Numb3rs

I hope you enjoy this thread!
[warn]


* - The-One - Apr 12, 2010

22 views and a few downloads but no reply's? Feedbacks please people :)


* - i Slap Kidz - Apr 12, 2010

Very nice, base is well organized, not sure what to add to the tut so A++


* - Weather Man - Apr 12, 2010

Thanks for this, I do memory editing in games and I was looking for a tutorial for using InlineASM.


* - The-One - Apr 13, 2010

(Apr 12, 2010 12:11 PM)Moterrac Wrote:  Thanks for this, I do memory editing in games and I was looking for a tutorial for using InlineASM.

Glad I'd helped :)

(Apr 12, 2010 11:27 AM)i Slap Kidz Wrote:  Very nice, base is well organized, not sure what to add to the tut so A++

Thanks :D


* - Weather Man - Apr 13, 2010

How would the Anti-Hack bypass work, would it suspend the threads with an injectable DLL?


* - The-One - Apr 14, 2010

(Apr 13, 2010 12:11 PM)Moterrac Wrote:  How would the Anti-Hack bypass work, would it suspend the threads with an injectable DLL?

You would to get the main .dll from the Anti-Cheat program, reverse(unpack) it, and find addresses. Which basically jump over the detection checks/messages and its functions.

(Apr 13, 2010 01:02 PM)dealin29a Wrote:  Most likely this would be detected with any anti-hack wouldn't it? but thanks!

NoMenu hacks would never be detected, although you can't use memory hacks(Which writes to assembly).


* - D.O.A - Apr 16, 2010

THNX MAN I REALLY NEED THIS MAN
+k


* - The-One - Apr 17, 2010

(Apr 16, 2010 05:40 AM)D.O.A Wrote:  THNX MAN I REALLY NEED THIS MAN
+k

No Problem hope u liked it :D


* - thanasis2028 - Apr 30, 2010

Oops, posted in wrong thread. Please delete this post


* - The-One - Apr 30, 2010

(Apr 30, 2010 06:01 AM)thanasis2028 Wrote:  Oops, posted in wrong thread. Please delete this post

Loolled, you can delete your own posts.


* - Physix - May 2, 2010

Would this work in Counter-Strike ?


* - wernesgruner - May 2, 2010

Wtf this violates rules?


* - ztrain - May 3, 2010

how would you write something that scans for a memory address like cheat engine?
we are making a game in our programing class, and the teacher is going to have a rigged character. hes going to be standing there so i cant use CE to scan for addresses, so how would i do this in code?


* - Justsomeguy - May 4, 2010

If i could +rep you i should do it very nice organized i suck at reading topics like this but this one totally helped me out thank you dude :)