• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Page 1 of 2 12 LastLast
    Results 1 to 10 of 19
    1. #1
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      konsowa's Avatar
      Join Date
      May 2012
      Posts
      184
      Thanks (-->)
      1
      Thanks (<--)
      2

      Hooking with detours tutorial

      Silent VPN
      Hey ppl so i decided to make this tutorial for all of u that want to start hooking functions using detours..

      So first thing ull need is microsoft detours which u can easily find by searching on Google.
      The second thing ull need is microsoft visual studio or an equivalent.
      And last but definitely not least u will need ur brain

      Lets start:

      So lets say u are playing a mmorpg and suddenly u wanna hack that game and lets say make ur own bot for packet editing(this is not a full bot tutorial this is only a small part of it), the first thing u wanna do at that point is find out which function u wanna hook(hint use a debugger and find out if it uses ws2_32.dll) if so then the game probably uses the connect function but u shud still check if it does. If thats the case then get ready to hook that function, here we go..


      • [li]create an empty dll[/li]
        [li]include winsock2.h, detours.h and iostream(u never know when ull need it) as well as windows.h like so:[/li]
      Code:
      #include &lt;WinSock2.h&gt;
      #include &lt;Windows.h&gt;
      #include &lt;detours.h&gt;
      #include &lt;iostream&gt;
      • [li] Now what u want to do is get the declaration of the function u want to hook, in this case the connect function, u can find the declaration at msdn and u declare it as so:[/li]


      Code:
      int (__stdcall *connect_o)( __in SOCKET s, __in const struct sockaddr_in *name, __in int namelen );
      note: the o stands for original, as this is the original function.

      • [li] Now that its declared u want to define it which is really simple..[/li]


      Code:
      int __stdcall connect_h(__in SOCKET s, __in  struct sockaddr_in *name, __in int namelen )
      {
          MessageBoxA(NULL,"I just made my first hook!!","Hook Tutorial", MB_OK);
          return connect_o(s, name, namelen);
      }

      • [li] Now u want to make A function that represents ur thread..[/li]


      Code:
      void WINAPI HookApi(LPVOID param)
      {
      }
      • [li]Next u want to get the address of the connect function inside that function that u just created, here is how[/li]


      Code:
      HANDLE ConnectAddress = GetProcAddress(GetModuleHandleA("ws2_32"), "connect");


      • [li]Your next step is making the actual detour which will allow ur function to be called when ever the original is called if that makes sense..[/li]


      Code:
      if(ConnectAddress)
      		connect_o = (int (__stdcall *)( __in SOCKET s, __in const struct sockaddr_in *name, __in int namelen ))DetourFunction((PBYTE)ConnectAddress,(PBYTE)connect_h);


      • [li]Now for the final step creating the thread and disabling thread library calls, so ur dll main shud like like this[/li]


      Code:
      bool __stdcall DllMain(HINSTANCE hinst, DWORD _Reason, _In_opt_ LPVOID _Reserved)
      {
      	DisableThreadLibraryCalls(hinst);
      
      	CreateThread(0,0,(LPTHREAD_START_ROUTINE)HookApi,0,0,&amp;ThreadID);
      
      	return true;
      }


      Now u can build this dll and inject it in ur game and u shud get a message box every time the connect function is called, u can hook the send/recv functions using the same technique.

      Note: Who ever hooks the send/recv functions first gets a cookie

      And here we are at the end of the tutorial, i hope it helped you in some way if u have any problems please dont hesitate to pm me or leave a comment below ill be very happy to help u with ur problems, if u encounter any and dont forget to give me sum kudos

      Edit: I added the detours lib and includes in the attachments
      Attached Files Attached Files

    2. Thanks guru, Chuck E thanked for this post
    3. #2
      Hacker
      Learning to hack games!
       
      Pawning
       
      Fleep's Avatar
      Join Date
      May 2012
      Posts
      626
      Thanks (-->)
      208
      Thanks (<--)
      743
      Very interesting stuff, Im not a big fan of detours in general but you can do some great stuff with it.

      Fleep

    4. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Puaaap's Avatar
      Join Date
      Jun 2012
      Posts
      1
      Thanks (-->)
      0
      Thanks (<--)
      0
      thanks for this, will see if I can make it work

    5. #4
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      konsowa's Avatar
      Join Date
      May 2012
      Posts
      184
      Thanks (-->)
      1
      Thanks (<--)
      2
      Your very welcome
      if u encounter any problems just pm me or leave a comment here.

    6. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      MrModd's Avatar
      Join Date
      Jun 2012
      Location
      Near Bean Town, Ma.
      Posts
      26
      Thanks (-->)
      0
      Thanks (<--)
      0
      Now I'm just learning all of this from scratch. But I am guessing this is, or on, the lines of what needs to be done to make a bypass right.

    7. #6
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      konsowa's Avatar
      Join Date
      May 2012
      Posts
      184
      Thanks (-->)
      1
      Thanks (<--)
      2
      Yes Sir, this stuff will definitely help u make a bypass but not if u hook the connect function tho i was just making this so that if anyone ever wants to make a proxy he can just make this dll and then make a program that would recieve and redirect everything on a specific port.

    8. #7
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      MrModd's Avatar
      Join Date
      Jun 2012
      Location
      Near Bean Town, Ma.
      Posts
      26
      Thanks (-->)
      0
      Thanks (<--)
      0
      Ahh very cool and TY. you have no idea how long I have been searching for stuff like this lmao. I get so many mixed signals on the net with trying to look this stuff up. I think part of my issue is I lack in the knowledge for the language while looking things up lol. I have my work cut for me trying to figure all this out lol. But I must say, I can't stop thinking about it. Feels like I'm back on Prom Night hahaha.

    9. #8
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      konsowa's Avatar
      Join Date
      May 2012
      Posts
      184
      Thanks (-->)
      1
      Thanks (<--)
      2
      No actually the problem is that most hackers don't want to give others the knowledge they have gained mostly because they worked hard to find that stuff and learn it, but there are some of us that are open to giving our knowledge to those that need it. So yea you really wont find too much about this topic on most sites.

    10. #9
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      MrModd's Avatar
      Join Date
      Jun 2012
      Location
      Near Bean Town, Ma.
      Posts
      26
      Thanks (-->)
      0
      Thanks (<--)
      0
      I can understand that. That's why even on other forums I tried I NEVER ask someone to give/do for me. I ask..... could you point me in the direction of. I don't want hand outs because in the end i feel like it will be more rewarding doing things with a little help than having it done for me. I just like talking to people that have some knowledge about things because it really really sux tring 100 different things just to find out that there ALL wrong lmao. Most I have ever really done was use an unpacker, WinHex, CE, and Excel to make some .csv hacks. So I don't want to say I am a total noob lol but this is fun stuff to learn.

    11. #10
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      konsowa's Avatar
      Join Date
      May 2012
      Posts
      184
      Thanks (-->)
      1
      Thanks (<--)
      2
      Silent VPN
      i agree and if you ever need anything just make a thread and don't be afraid to ask u will never learn if u don't ask.

    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [VideoTutorial] C++ Detour / Hooking Function Tutorial for Game Hacking
      By [GH]Rake in forum GH Hack Video Tutorials
      Replies: 26
      Last Post: 12-29-2016, 06:48 PM
    2. [VideoTutorial] C++ Mid Function Hooking Codecaving Tutorial DIFFICULTY [6/10]
      By Fleep in forum GH Hack Video Tutorials
      Replies: 53
      Last Post: 09-08-2015, 01:58 AM
    3. [Help] C++ Mid Function Hooking/Codecaving Tutorial
      By Brackston in forum GH Tutorials Help
      Replies: 12
      Last Post: 12-04-2013, 03:19 PM
    4. [Tutorial] Hooking tutorial (Vtable/JMP/UNIX/etc)
      By NTvalk in forum Game Hacking Tutorials
      Replies: 14
      Last Post: 12-03-2013, 03:02 AM