Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    67
    Reputation
    10
    Thanks
    305
    Can you add DrawIndexed for d3d11 plz? I have trouble hooking this function, works for a half second (I can log the indexcount) but then it's crashing. I had no problem adding DrawIndexedPrimitive for d3d9. Here is what I have.

    Code:
    HookData d3d11DrawIndexed;
    
    ID3D11Device* device = NULL;
    ID3D11DeviceContext *context = 0;
    
    //in DXGISwapPresentHook
    if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void **)&device)))
    	{
    		device->GetImmediateContext(&context);
    ..
    
    //DrawIndexedhook
    void __stdcall D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	d3d11DrawIndexed.Unhook();
    
    	//if(GetAsyncKeyState(VK_F10) & 1 )
    	//Log("IndexCount == %d", IndexCount);
    	
    	d3d11DrawIndexed.Rehook();
    	return context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    }
    
    //in InitD3D11Hook
    UPARAM * vtblcontext = *(UPARAM**)context;
    d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);
    
    d3d11DrawIndexed.Rehook();
    Last edited by lvous; 06-22-2014 at 07:20 AM.

  2. #17
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    Quote Originally Posted by lvous View Post
    Can you add DrawIndexed for d3d11 plz? I have trouble hooking this function, works for a half second (I can log the indexcount) but then it's crashing. I had no problem adding DrawIndexedPrimitive for d3d9. Here is what I have.
    Try the code below, if you rehook before calling the original function, you go into an infinite loop.

    Code:
    HookData d3d11DrawIndexed;
    
    ID3D11Device* device = NULL;
    ID3D11DeviceContext *context = 0;
    
    
    //in DXGISwapPresentHook
    if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void **)&device)))
    	{
    		device->GetImmediateContext(&context);
    ..
    
    
    //DrawIndexedhook
    void __stdcall D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	d3d11DrawIndexed.Unhook();
    
    
    	//if(GetAsyncKeyState(VK_F10) & 1 )
    	//Log("IndexCount == %d", IndexCount);
    
    
    	context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    
    
    	d3d11DrawIndexed.Rehook();
    }
    
    
    //in InitD3D11Hook
    UPARAM * vtblcontext = *(UPARAM**)context;
    d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);
    
    
    d3d11DrawIndexed.Rehook();
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  3. #18
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    67
    Reputation
    10
    Thanks
    305
    thanks, it's working now :>
    Attached Thumbnails Attached Thumbnails
    122nlae.jpg  


  4. The Following User Says Thank You to lvous For This Useful Post:

    skrillux0 (08-02-2015)

  5. #19
    cheiky1's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    what
    Posts
    4
    Reputation
    10
    Thanks
    0
    thx man very much

  6. #20
    tutukinho's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    good friends

  7. #21
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    Looking to building an updated version, to add DirectX 12 support
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  8. #22
    strixxd's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by topblast View Post
    Looking to building an updated version, to add DirectX 12 support
    Het topblast, nice work that sounds amazing if you could do that.

    Can I ask for your help, I've tried my best to get this working with your answer a few posts back on here but I can't get the D3D11DrawIndexedhook to call can you help me out?

    Can you see what i'm doing wrong here?

    InitD3D11Hook()

    ....
    Code:
    if (SUCCEEDED(hr))
    		{
    			context->Release();
    			device->Release();
    			
    			bSuccess = true;
    			UPARAM * vtbl = *(UPARAM**)swap;
    			UPARAM * vtblcontext = *(UPARAM**)context;
    
    			d3d11SwapPresent.Hook((FARPROC)*(vtbl + (32 / 4)), (FARPROC)DXGISwapPresentHook);
    			d3d11ResizeBuffer.Hook((FARPROC)*(vtbl + (52 / 4)), (FARPROC)DXGISwapResizeBuffersHook);
    			d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);
    
    			swap->Release();
    
    			d3d11SwapPresent.Rehook();
    			d3d11ResizeBuffer.Rehook();
    			d3d11DrawIndexed.Rehook();
    		}

    Code:
    void __stdcall D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	Logger::LogMessage("D3D11DrawIndexedhook()\n");
    	d3d11DrawIndexed.Unhook();
    
    
    	//if(GetAsyncKeyState(VK_F10) & 1 )
    	//Output("IndexCount == %d", IndexCount);
    
    	context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    
    
    	d3d11DrawIndexed.Rehook();
    }
    - - - Updated - - -

    Also how do you know the vtbl position for these? Is it different for all games?

    Code:
    d3d11SwapPresent.Hook((FARPROC)*(vtbl + (32 / 4)), (FARPROC)DXGISwapPresentHook);
    			d3d11ResizeBuffer.Hook((FARPROC)*(vtbl + (52 / 4)), (FARPROC)DXGISwapResizeBuffersHook);
    			d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);

  9. #23
    strixxd's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    I think I figured it out maybe? I think its at position 13 in the vtable

    but now when It hits this, i'm getting nothing render on the screen?

    Code:
    void STDMETHODCALLTYPE D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	return context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    }

  10. #24
    strixxd's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    Can we talk on steam I added you? name is greenarrow

    This part crashes the game

    Code:
    void __stdcall D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	d3d11DrawIndexed.Unhook();
    
    
    	//if(GetAsyncKeyState(VK_F10) & 1 )
    	//Log("IndexCount == %d", IndexCount);
    
    
    	context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    
    
    	d3d11DrawIndexed.Rehook();
    }

  11. #25
    Stimulative's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by strixxd View Post
    Can we talk on steam I added you? name is greenarrow

    This part crashes the game

    Code:
    void __stdcall D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	d3d11DrawIndexed.Unhook();
    
    
    	//if(GetAsyncKeyState(VK_F10) & 1 )
    	//Log("IndexCount == %d", IndexCount);
    
    
    	context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    
    
    	d3d11DrawIndexed.Rehook();
    }
    IF anything is wrong with it, it will be...
    Code:
    //Log("IndexCount == %d", IndexCount);
    Change that to an integer or float value such as %.0f or $i. Let me know how you go

    Also add logs the debug your code so at the hook section after every if statement put a log so that you can check the file and see where it is crashing.

  12. #26
    strixxd's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Stimulative View Post
    IF anything is wrong with it, it will be...
    Code:
    //Log("IndexCount == %d", IndexCount);
    Change that to an integer or float value such as %.0f or $i. Let me know how you go

    Also add logs the debug your code so at the hook section after every if statement put a log so that you can check the file and see where it is crashing.
    Don't think it's that as it's commented out, I've completely removed it now. It crashes on most games but on WatchDogs it does this weird stuff:

    Can't post links but this is the image: i.imgur<dot>com/yOaOsNt.png

    Code:
    void STDMETHODCALLTYPE D3D11DrawIndexedhook(ID3D11DeviceContext* pContext, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
    {
    	Logger::LogMessage("D3D11DrawIndexedhook\n");
    	d3d11DrawIndexed.Unhook();
    	pContext->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    	d3d11DrawIndexed.Rehook();
    }

  13. #27
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    Quote Originally Posted by strixxd View Post
    InitD3D11Hook()

    ....
    Code:
    if (SUCCEEDED(hr))
    {
    context->Release();
    device->Release();

    bSuccess = true;
    UPARAM * vtbl = *(UPARAM**)swap;
    UPARAM * vtblcontext = *(UPARAM**)context;

    d3d11SwapPresent.Hook((FARPROC)*(vtbl + (32 / 4)), (FARPROC)DXGISwapPresentHook);
    d3d11ResizeBuffer.Hook((FARPROC)*(vtbl + (52 / 4)), (FARPROC)DXGISwapResizeBuffersHook);
    d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);

    swap->Release();

    d3d11SwapPresent.Rehook();
    d3d11ResizeBuffer.Rehook();
    d3d11DrawIndexed.Rehook();
    }
    Not that the 'swap' variable is released after i hook, i assume you should do the same with the ID3D11DeviceContext as that may yield unexpected results.

    Please not that should the 'D3D11DrawIndexedhook' function may be empty as in '{ }' and the application should not crash, though nothing will draw. You can use this to ensure that the hook is truly working.
    Last edited by topblast; 04-24-2016 at 04:52 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  14. #28
    strixxd's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by topblast View Post


    Not that the 'swap' variable is released after i hook, i assume you should do the same with the ID3D11DeviceContext as that may yield unexpected results.

    Please not that should the 'D3D11DrawIndexedhook' function may be empty as in '{ }' and the application should not crash, though nothing will draw. You can use this to ensure that the hook is truly working.
    Thanks ill give that a go and let you know what happends.

    Do you know of any good DX11 test environments to test this against?

  15. #29
    strixxd's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    I'm releasing everything now

    Code:
    if (SUCCEEDED(hr))
    		{
    			bSuccess = true;
    			UPARAM * vtbl = *(UPARAM**)swap;
    			UPARAM * vtblcontext = *(UPARAM**)context;
    
    			Logger::LogMessage("d3d11SwapPresent: 0x%I64X\n", (FARPROC)*(vtbl + (32 / 4)));
    			Logger::LogMessage("d3d11ResizeBuffer: 0x%I64X\n", (FARPROC)*(vtbl + (52 / 4)));
    			Logger::LogMessage("d3d11DrawIndexed: 0x%I64X\n", (FARPROC)*(vtbl + (56 / 4)));
    
    			d3d11SwapPresent.Hook((FARPROC)*(vtbl + (32 / 4)), (FARPROC)DXGISwapPresentHook);
    			d3d11ResizeBuffer.Hook((FARPROC)*(vtbl + (52 / 4)), (FARPROC)DXGISwapResizeBuffersHook);
    			d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (52 / 4)), (FARPROC)D3D11DrawIndexedhook);
    
    			context->Release();
    			device->Release();
    			swap->Release();
    
    			d3d11SwapPresent.Rehook();
    			d3d11ResizeBuffer.Rehook();
    			d3d11DrawIndexed.Rehook();
    		}
    If I have nothing in D3D11DrawIndexedhook() nothing shows.

    If I add the following still nothing shows? What do I need to return in order to show something
    Code:
    d3d11DrawIndexed.Unhook();
    	pContext->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
    	d3d11DrawIndexed.Rehook();

  16. #30
    orad1232's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    1
    Thank you very much. But I cant inject it to Combat Arms can you help me please?
    Auto inject does nothing.
    I'm using Extreme Injector v3.
    Last edited by orad1232; 04-27-2016 at 02:53 PM.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [Release] Topblast Menu Base D3D9 & D3D11 [64/32 bit] (Updated)
    By topblast in forum Battlefield 4 Hacks & Cheats
    Replies: 12
    Last Post: 04-08-2014, 10:17 PM
  2. [Release] Topblast Menu Base D3D9 & D3D11, 64 bit & 32 bit
    By topblast in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 4
    Last Post: 03-27-2014, 07:20 PM
  3. [Preview] Topblast Menu Base D3D9 & D3D11, 64 bit & 32 bit
    By topblast in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 10
    Last Post: 03-24-2014, 10:36 AM
  4. [Preview] Topblast Menu Base D3D9 & D3D11, 64 bit & 32 bit
    By topblast in forum Battlefield 4 Hacks & Cheats
    Replies: 5
    Last Post: 03-15-2014, 03:41 AM
  5. [Release] Revival : [Topblast Menu Base v1.3]
    By topblast in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 21
    Last Post: 08-10-2011, 08:37 AM