• 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 5 of 5
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Nytlenc's Avatar
      Join Date
      Sep 2012
      Posts
      10
      Thanks (-->)
      4
      Thanks (<--)
      0

      HOOK D3D after loading the game

      John Kittz
      Can anybody tell me how Fleep inject DLL into the game and HOOK D3D after loading the game in this video? (Time 5:50)
      Interested C++ code

      https://www.youtube.com/watch?v=FZDcZ84xxzo

      This code does not do this:

      Code:
       
      
      bool WINAPI DllMain(HMODULE hDll, DWORD dwReason, PVOID pvReserved)
      {
      	if(dwReason == DLL_PROCESS_ATTACH)
      		{
      			DisableThreadLibraryCalls(hDll);
      			HMODULE hMod = LoadLibrary("d3d9.dll");		
      	
      			oDirect3DCreate9 = (tDirect3DCreate9)DetourFunc(
      				(BYTE*)GetProcAddress(hMod, "Direct3DCreate9"),
      				(BYTE*)hkDirect3DCreate9, 
      				5);
      	
      			return true;
      		}
      		return false;
      }
      
      void *DetourFunc(BYTE *src, const BYTE *dst, const int len)
      {
      	BYTE *jmp = (BYTE*)malloc(len+5);
      	DWORD dwback;
      
      	VirtualProtect(src, len, PAGE_READWRITE, &dwback);
      
      	memcpy(jmp, src, len);	jmp += len;
      	
      	jmp[0] = 0xE9;
      	*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
      
      	src[0] = 0xE9;
      	*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
      
      	VirtualProtect(src, len, dwback, &dwback);
      
      	return (jmp-len);
      }
      
      bool RetourFunc(BYTE *src, BYTE *restore, const int len)
      {
      	DWORD dwback;
      		
      	if(!VirtualProtect(src, len, PAGE_READWRITE, &dwback))	{ return false; }
      	if(!memcpy(src, restore, len))							{ return false; }
      
      	restore[0] = 0xE9;
      	*(DWORD*)(restore+1) = (DWORD)(src - restore) - 5;
      
      	if(!VirtualProtect(src, len, dwback, &dwback))			{ return false; }
      	
      	return true;
      }
      Last edited by Nytlenc; 10-07-2013 at 10:39 PM.

    2. #2
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      You need to hook something else than createdevice. Present or endscene for example.
      HOOK D3D after loading the game

    3. #3
      Hacker
      ^.^
       
      Eating
       
      NTvalk's Avatar
      Join Date
      Jul 2013
      Location
      Your RAM
      Posts
      512
      Thanks (-->)
      176
      Thanks (<--)
      145
      you need to detour EndScene()

    4. #4
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      Quote Originally Posted by NTvalk View Post
      you need to detour EndScene()
      Not necessarily. It's quite fun to see people going on and on for ages about hooking endscene whereas actually Present gets called after Endscene, when the data is presented to the backbuffer, making it a bit safer place to draw. But I guess it has turned into more of a personal choice.
      HOOK D3D after loading the game

    5. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Nytlenc's Avatar
      Join Date
      Sep 2012
      Posts
      10
      Thanks (-->)
      4
      Thanks (<--)
      0
      Cheats'n'Trainers
      Thank you guys. You helped a lot. I'll try it and I will write about the result

    Similar Game Hacker Threads

    1. [Tutorial] How To Hook
      By Solaire in forum Game Hacking Tutorials
      Replies: 12
      Last Post: 07-31-2016, 09:31 AM
    2. [Help] DIRECT3D hook vs OPENGL hook
      By blergmasta in forum Direct-X, OpenGL
      Replies: 3
      Last Post: 03-25-2016, 10:18 PM
    3. How to hook the rigester value in C++
      By hack_disgame in forum Hacking Help
      Replies: 10
      Last Post: 08-16-2015, 09:55 AM
    4. [Help] PointBlank Hook
      By ddikere in forum C/C++
      Replies: 2
      Last Post: 08-07-2015, 10:42 PM

    Tags for this Thread