Page 1 of 3 123 LastLast
Results 1 to 15 of 42
  1. #1
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    326
    My Mood
    Inspired

    DX9 Hook by ~FALLEN~

    Should be undetected, don't know, haven't used this in a while. Have fun (: *Yes you can port this to d3d8 if you know how*

    Tools : Ollydbg & IDA
    Credits : ~FALLEN~
    Coded in : C++

    Code:
    struct sStack
    {
    	sStack* PreviousStack;
    	DWORD ReturnAddress;
    	void* Arguments[ 127 ];//Maximum number of arguments to pass to a function
    };
    
    DWORD SCPtr = 0;//Table[19]
    DWORD SCRet = 0;//On xp - Start of EndScene Function + 0xB9 - Vista / 7 - Start of EndScene Function + 0x9E
    
    void __fastcall hkSceneCapture( void* ECX, void* EDX, signed int Capture )
    {
    	IDirect3DDevice9* pDevice;//Device interface pointer
    	sStack* Stack;//Stack handling structure
    	__asm
    	{
    	  MOV Stack, ESP
    	  pushad//Preserve all General-Registers
    	  pushfd//Preserve EFlags
    	}
    	if( Stack->ReturnAddress == SCRet )
    	{
    	  if( ( pDevice = Stack->PreviousStack->Arguments[ 0 ] ) != NULL )
    	  {
    	    //DoShit
    	  }
    	}
    	__asm
    	{
    	  popfd//Restore EFlags
    	  popad//Restore All General-Registers
    	}
    	return ( ( void( __thiscall* )( void*, signed int ) SCPtr )( ThisPtr, Capture );//Give control back to SceneCapture
    }
    
    DWORD Table = FindPattern( D3DModuleHandle, 0x105000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\xC7\x46\x00\x0B\x00\x00\x00\x8B\xC6" ), "xx????xx?x???xx" );//CD3DDIDX7 SCPtr = this[19]

  2. The Following 10 Users Say Thank You to ~FALLEN~ For This Useful Post:

    AVA PlaYe (01-29-2013),AznNicholas1314 (01-23-2013),Chrome Boy (03-22-2013),Jabberwock (12-31-2012),Lehsyrus (01-01-2013),meawww (03-27-2013),Prepix (12-31-2012),R3d_L1n3 (01-01-2013),SzaQal (01-02-2013),[RAPGOD]EMINEM (01-29-2013)

  3. #2
    R4v0r's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    London
    Posts
    234
    Reputation
    11
    Thanks
    142
    My Mood
    Amazed
    Nice, finally something propper released for A.V.A!

  4. #3
    oyasuna.dev's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United States.
    Posts
    32
    Reputation
    10
    Thanks
    374
    Don't see anything wrong. Haven't been active with AVA so I'm not sure what changes they have made, but this looks like it would work.

  5. #4
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    326
    My Mood
    Inspired
    Quote Originally Posted by oyasuna.dev View Post
    Don't see anything wrong. Haven't been active with AVA so I'm not sure what changes they have made, but this looks like it would work.
    Nothing is wrong with it, I did however simplify it. You can do this with classes and it would be more organized of course. Probably a tad faster too because it wouldn't have to go out into the .bss section to retrieve the global variables. It can be made faster, but the speed difference wouldn't be noticeable...

  6. #5
    oyasuna.dev's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United States.
    Posts
    32
    Reputation
    10
    Thanks
    374
    Quote Originally Posted by ~FALLEN~ View Post
    Nothing is wrong with it, I did however simplify it. You can do this with classes and it would be more organized of course. Probably a tad faster too because it wouldn't have to go out into the .bss section to retrieve the global variables. It can be made faster, but the speed difference wouldn't be noticeable...
    True, but if your looking from a performance standpoint then there are 2 key variables you try to accomplish: Speed (along with complexity), and Memory usage. I know I had a third, but I forget. Now if you increase the speed, you will use more memory but for a shorter amount of time. Not sure if I'm being clear cause I had a point in my head, but now I forget.

  7. #6
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    326
    My Mood
    Inspired
    Quote Originally Posted by oyasuna.dev View Post
    True, but if your looking from a performance standpoint then there are 2 key variables you try to accomplish: Speed (along with complexity), and Memory usage. I know I had a third, but I forget. Now if you increase the speed, you will use more memory but for a shorter amount of time. Not sure if I'm being clear cause I had a point in my head, but now I forget.
    Not necessarily, if you do things more efficiently you can get faster code with less memory usage, to be honest it tends to go hand in hand with clean and well preforming code. Don't leak, don't clutter, etc, and you're good to go really...

    What you said may be true if you are using say a garbage collector or a virtualized language such as java ( java gets converted to byte code which is then interpreted by a VM ) .Net languages use a garbage collector, etc. In general though, C++ ( when coded right, and with the right optimizations ) won't hold your hand and as I said, if done right, can give you some really great performance.
    Last edited by ~FALLEN~; 12-31-2012 at 10:08 AM.

  8. The Following User Says Thank You to ~FALLEN~ For This Useful Post:

    oyasuna.dev (12-31-2012)

  9. #7
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,695
    Reputation
    191
    Thanks
    15,190
    My Mood
    Relaxed
    What's the matter with performance... This code you provided would probably be done in a spilt second. What's there to be worry about?
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  10. The Following User Says Thank You to Jabberwock For This Useful Post:

    ~FALLEN~ (12-31-2012)

  11. #8
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    326
    My Mood
    Inspired
    Quote Originally Posted by Jabberwo0ck View Post
    What's the matter with performance... This code you provided would probably be done in a spilt second. What's there to be worry about?
    Nothing, like I said performance wouldn't be a significant difference as there's only two global's in constant use.
    However if you were using say 10,000 - 100,000 global's, you would notice, but at that point I would be asking you "why the fuck are you using so many variables?" lol. XD

  12. #9
    oyasuna.dev's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United States.
    Posts
    32
    Reputation
    10
    Thanks
    374
    Quote Originally Posted by ~FALLEN~ View Post
    Nothing, like I said performance wouldn't be a significant difference as there's only two global's in constant use.
    However if you were using say 10,000 - 100,000 global's, you would notice, but at that point I would be asking you "why the fuck are you using so many variables?" lol. XD
    Very good point.

  13. The Following User Says Thank You to oyasuna.dev For This Useful Post:

    ~FALLEN~ (01-01-2013)

  14. #10
    u.A.v.A's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    640
    Reputation
    17
    Thanks
    624
    unstable .___.

    need a few changes

  15. #11
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    326
    My Mood
    Inspired
    Quote Originally Posted by u.A.v.A View Post
    unstable .___.

    need a few changes
    No it's not, the code is perfectly stable and doesn't need to be changed. it's something you are doing. Make sure your handling your interfaces correctly.

  16. #12
    RobinC's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    Mpgh.exe
    Posts
    1,771
    Reputation
    69
    Thanks
    3,677
    My Mood
    Aggressive
    Made This working in d3d8 and worked

  17. #13
    SzaQal's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Here n There
    Posts
    160
    Reputation
    36
    Thanks
    35
    My Mood
    Cold
    it's unstable but working - just add some lines of code... i will try to find some adressess inn ava - but ollydbg is detected, i will try find some basig debuggers or create my own idk

  18. #14
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    326
    My Mood
    Inspired
    Quote Originally Posted by SzaQal View Post
    it's unstable but working - just add some lines of code... i will try to find some adressess inn ava - but ollydbg is detected, i will try find some basig debuggers or create my own idk
    it's not unstable... Make sure you reset any interfaces you create.... I used this hook for over 2 years without anything problems, the only difference in the one I used is it was part of one of my classes. Make sure you're rehooking if it gets unhooked, and make sure you have write access to change the vtable. Its common sense really. Its stable.

    -edit-
    The only way I can the hook itself **possibly** becoming unstable is if you use byte patching, aka detours. Even then, if you aren't using crappy detours I would imagine it would work fine ( assuming the detour function is saving the original operations )
    Last edited by ~FALLEN~; 01-02-2013 at 05:28 AM.

  19. #15
    SzaQal's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Here n There
    Posts
    160
    Reputation
    36
    Thanks
    35
    My Mood
    Cold
    whats ur IDE?

Page 1 of 3 123 LastLast

Similar Threads

  1. WR D3D Hook - =o - 03/22/07
    By Dave84311 in forum Hack/Release News
    Replies: 14
    Last Post: 10-06-2007, 09:59 AM
  2. tut How to hook tut 6
    By llvengancell in forum WarRock - International Hacks
    Replies: 1
    Last Post: 06-26-2007, 03:24 PM
  3. D3D hooking tutorial 5 i think
    By llvengancell in forum WarRock - International Hacks
    Replies: 7
    Last Post: 06-26-2007, 03:09 PM
  4. How can i hook the punkbuster?
    By TheRedEye in forum WarRock - International Hacks
    Replies: 5
    Last Post: 05-27-2007, 12:34 PM
  5. New Hacks Announced & Warrock DX Hook Update
    By Dave84311 in forum Hack/Release News
    Replies: 17
    Last Post: 03-02-2007, 03:54 PM