• 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
  • Results 1 to 8 of 8
    1. #1
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      m0v's Avatar
      Join Date
      Jun 2012
      Posts
      58
      Thanks (-->)
      0
      Thanks (<--)
      0

      DetourFunc Problem

      Silent VPN
      hey guys i tryed today to make a simple messagebox detourfunc hook for a sample but it still wont work maybe some one of you can get me through what i did wrong here comes the code
      Code:
      #include "detours.h"
      #pragma comment(lib, "detours.lib")
      
      int (__stdcall* InsertDateTime)(int x); //Function prototype
      
      int MyInsertDateTime(int x) //Our function
      {
      //Messagebox
      MessageBoxA(NULL, "InsertDateTime Just Got Called", "InsertDateTime", MB_OK);
      return InsertDateTime(x); //Return the origional function
      }
      
      BOOL APIENTRY DllMain( HMODULE hModule,
                  DWORD ul_reason_for_call,
                  LPVOID lpReserved
      					 )
      {
      	switch (ul_reason_for_call)
      	{
      	case DLL_PROCESS_ATTACH:
      		InsertDateTime = (int (__stdcall*)(int))DetourFunction((PBYTE)0x0100978A, (PBYTE)MyInsertDateTime);
      		Beep(1000,1000);
      		break;
      	case DLL_THREAD_ATTACH:
      	case DLL_THREAD_DETACH:
      	case DLL_PROCESS_DETACH:
      		DetourRemove((PBYTE)0x0100978A, (PBYTE)InsertDateTime);
      		break;
      	}
      	return TRUE;
      }
      forget to say that i use Detour 1.5 and the lib

    2. #2
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      voidisalive's Avatar
      Join Date
      May 2012
      Posts
      68
      Thanks (-->)
      1
      Thanks (<--)
      14
      Hey Mov take a look at my video here

      Detouring Minesweeper IDA , C++, detours

      shows you how to detour a function with yours.

      Greets,

      voidisalive

    3. #3
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      m0v's Avatar
      Join Date
      Jun 2012
      Posts
      58
      Thanks (-->)
      0
      Thanks (<--)
      0
      thanks for that voidisalive i hope it helps me out to get it

    4. #4
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      voidisalive's Avatar
      Join Date
      May 2012
      Posts
      68
      Thanks (-->)
      1
      Thanks (<--)
      14
      No problem let me know if the info on the video helped you.

      Greets,

      voidisalive

    5. #5
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      m0v's Avatar
      Join Date
      Jun 2012
      Posts
      58
      Thanks (-->)
      0
      Thanks (<--)
      0
      didnt worked well i dont know what i did wrong winject always says:

      Both injections-methods faild!

      (RemoteLoadLibrary and Detourinjecting)
      Target is protected? err: 0

    6. #6
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      voidisalive's Avatar
      Join Date
      May 2012
      Posts
      68
      Thanks (-->)
      1
      Thanks (<--)
      14
      then try another injector... I'm sure it will work just fine.

      Greets,

      voidisalive

    7. #7
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      m0v's Avatar
      Join Date
      Jun 2012
      Posts
      58
      Thanks (-->)
      0
      Thanks (<--)
      0
      I tryed another injector and it comes to the same error always no found library should I put it in the source like #pragmatic once (lib,"detours.lib") or wouldn't it help?

    8. #8
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      voidisalive's Avatar
      Join Date
      May 2012
      Posts
      68
      Thanks (-->)
      1
      Thanks (<--)
      14
      Silent VPN
      Here mate read on this topic on Wikipedia https://en.wikipedia.org/wiki/Addres..._randomization

      thats the security Notepad has on win 7 and vista too I think Xp doesn't have this and to work around that you have to use Relative virtual Address not Virtual Adressess to get your relative virtual address all you need to do is take the address of the function in IDA, subtract the base address that IDA is using, and you'll have your relative virtual address. then use the runtime base address + rva using GetModuleHandle
      like this
      Code:
      GetModuleHandleA("notepad.exe")) + 0x978A;
      Result
      DetourFunc Problem
      and here is the source

      Code:
      #include &lt;windows.h&gt;
      #include &lt;detours.h&gt;
      
      //Original Function
      typedef int (__stdcall* InsertDateTime_o)(int x); 
      InsertDateTime_o InsertDateTime;	
      //Function to detour
      int DateAndTime(int x)
      {
      	MessageBox(NULL, "Time and Date has been Detoured!!!", "voidisalive", 0x00000000L);
      	return InsertDateTime(x);
      }
      
      int WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpReserved)
      {
      	if( DLL_PROCESS_ATTACH == Reason )
      	{
      		//typecast reinterpretention DWORD cast.
      		DWORD dwNP = reinterpret_cast&lt;DWORD&gt;(GetModuleHandleA("notepad.exe")) + 0x978A;//Runtime Base + RVA
      		InsertDateTime = reinterpret_cast&lt;InsertDateTime_o&gt;(DetourFunction((PBYTE)dwNP, (PBYTE)&amp;DateAndTime));
      	}
      		
      	return true;
      }
      Download -&gt; https://www.4shared.com/rar/xv8EgdZx...meDateCpp.html
      Virus scan -&gt; https://virusscan.jotti.org/en/scanr...66183dbe69d30f

      Greets,

      voidisalive



    Similar Game Hacker Threads

    1. [Help] C# Problem
      By xa84759x in forum Hacking Help
      Replies: 11
      Last Post: 02-07-2015, 02:00 PM
    2. [Help] CE Problem
      By ace0000 in forum GH Tutorials Help
      Replies: 4
      Last Post: 12-25-2013, 10:39 AM
    3. Little Problem with value
      By etix in forum Hacking Help
      Replies: 4
      Last Post: 04-07-2013, 06:59 PM
    4. Little Problem!
      By nico0 in forum Visual Basic
      Replies: 9
      Last Post: 07-24-2012, 04:54 AM