Results 1 to 9 of 9
  1. #1
    arun823's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Los Angeles, California
    Posts
    523
    Reputation
    151
    Thanks
    1,899
    My Mood
    Amused

    Cool D3D9 Windows 8/7/XP EndScene/Reset

    Yay, a hook I created, fairly simple and works for Win 8/7/XP, you can get it to work for Windows Vista, just find the correct offset/address to add to the entrypoint.

    Code:
    void Hook()
    {
    	MODULEINFO mInfo;
    
    	DWORD dwD3D9 = NULL;
    
    	OSVERSIONINFO WindowsVersion;
    	WindowsVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    	GetVersionEx(&WindowsVersion);
    
    	while(!dwD3D9)
    	{
    		dwD3D9 = (DWORD)GetModuleHandle("d3d9.dll");
    	}
    
    	GetModuleInformation(GetCurrentProcess(), (HMODULE)dwD3D9, &mInfo, sizeof(MODULEINFO));
    
    	if(WindowsVersion.dwMajorVersion < 5 && WindowsVersion.dwMinorVersion >= 3)
    	{
    		MessageBoxA(NULL, "Your Operating System isn't supported!", "Attention!", NULL);
    		exit(EXIT_SUCCESS);
    	}	
    
    	if(WindowsVersion.dwMajorVersion == 6 && WindowsVersion.dwMinorVersion == 2)//Windows 8
    	{
    		Main->D3D->Settings->dwEndScene = (int)mInfo.EntryPoint + 0xFFFFFFFFFFFDF736; 
    		Main->D3D->Settings->dwReset = 0x72452A8F;
    	}
    	else if(WindowsVersion.dwMajorVersion == 6  && WindowsVersion.dwMinorVersion == 1)//Windows 7	
    	{
    		Main->D3D->Settings->dwEndScene = (int)mInfo.EntryPoint + 0x20D5A; 
    		Main->D3D->Settings->dwReset = 0x6B9DF251;
    	}
    	else if(WindowsVersion.dwMajorVersion == 5  && WindowsVersion.dwMinorVersion == 1)//Windows XP
    	{
    		Main->D3D->Settings->dwEndScene = 0x4FE571B0; 
    		Main->D3D->Settings->dwReset = 0x4FE136B0;
    	}	
    
    	pEndScene = (oEndScene)DetourFunction((PBYTE)Main->D3D->Settings->dwEndScene, (PBYTE)&EndScene);
    	pReset   = (oReset)DetourFunction((PBYTE)Main->D3D->Settings->dwReset, (PBYTE)&Reset);	
    }
    EndScene and Reset only, shouldn't be hard to hook Present either, btw, addresses are static according to the OS.

    Enjoy
    Last edited by arun823; 08-11-2013 at 06:57 PM.
    Reversing is the only way to move forward.

  2. The Following User Says Thank You to arun823 For This Useful Post:

    WhiteHat PH (11-27-2014)

  3. #2
    Stuxnet's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    3
    This will be a great help in my first public for dem peeps.
    Nice job.

  4. #3
    Timboy67678's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    87
    Reputation
    25
    Thanks
    80
    My Mood
    Aggressive
    i like ur anti c/p address

  5. #4
    WhiteHat PH's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    Some Where I Belong
    Posts
    1,350
    Reputation
    25
    Thanks
    3,097
    My Mood
    Aggressive
    thank's for this Sir ... ^^






    When Im gone dont forget me cause I will come back someday.



    Youtube Channel


     


  6. #5
    mamo007's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Location
    Behind You !
    Posts
    1,655
    Reputation
    216
    Thanks
    15,607
    My Mood
    Amazed
    can you example that

    Code:
    Main->D3D->Settings->dwEndScene = (int)mInfo.EntryPoint + 0xFFFFFFFFFFFDF736;
    [Source Code] Present Hooks Win 7/8 .. 8.1/10


    - removed youtube video as it had an outside link


  7. #6
    Cambodia's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    (Iron Heart Hacker)
    Posts
    162
    Reputation
    10
    Thanks
    1,819
    My Mood
    Mellow
    @mamo007 hello sir
    I will back one day

  8. #7
    arun823's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Los Angeles, California
    Posts
    523
    Reputation
    151
    Thanks
    1,899
    My Mood
    Amused
    Quote Originally Posted by mamo007 View Post
    can you example that

    Code:
    Main->D3D->Settings->dwEndScene = (int)mInfo.EntryPoint + 0xFFFFFFFFFFFDF736;
    Those are just class pointers, just delete it and declare dwEndScene as a DWORD
    Reversing is the only way to move forward.

  9. The Following User Says Thank You to arun823 For This Useful Post:

    mamo007 (08-24-2013)

  10. #8
    plarusdepeer's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    How would you go about drawing with this hook?

  11. #9
    letmeknowit2's Avatar
    Join Date
    Aug 2015
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    Would you mind sharing the assembly of endscene and DIP in d3d9.dll for windows 8, 8.1 and windows10?

Similar Threads

  1. [Help] How to use D3D9 Windows?
    By HarimauMalaya in forum Game Development
    Replies: 1
    Last Post: 12-13-2012, 02:02 PM
  2. [Help] Help .. How To Test D3D9 Window ? I Want Test My Hack ?
    By hanyali2012 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 7
    Last Post: 09-19-2012, 04:20 PM
  3. [Solved] Test D3D9 window
    By L0OocKie in forum Combat Arms Brazil Help
    Replies: 30
    Last Post: 05-09-2011, 10:48 AM
  4. [Solved] Test D3D9 Window - DevC++
    By ErickAssolari in forum Combat Arms BR Coding Help
    Replies: 7
    Last Post: 04-02-2011, 06:26 PM
  5. [reposted] windowed mode d3d9.dll
    By Grim in forum Combat Arms Discussions
    Replies: 40
    Last Post: 09-03-2009, 03:39 AM