Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 51
  1. #16
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by lvous View Post
    I don't play anymore but I used this:

    Logged the shader
    // cbPerObjectBones c0 204
    // cbSharedPerView c204 4
    // cbPerObject c223 4

    and then by trial and error:
    Code:
    D3DXMATRIX ProjMatrix, ViewMatrix, WorldMatrix;
    D3DXVECTOR3 VectorMiddle(0, 0, 0), ScreenMiddle(0, 0, 0);
    
    Device->GetVertexShaderConstantF(204, ProjMatrix, 4); 
    Device->GetVertexShaderConstantF(223, ViewMatrix, 4); 
    
    D3DXMatrixIdentity(&WorldMatrix);
    D3DXMatrixTranspose(&ViewMatrix, &ViewMatrix);
    D3DXMatrixTranspose(&ProjMatrix, &ProjMatrix);
    
    D3DXVec3Project(&VectorMiddle, &pModel->Position3D, &Viewport, &ProjMatrix, &ViewMatrix, &WorldMatrix);
    
    if (VectorMiddle.z < 1.0f && ProjMatrix._44 < 1.0f) //not sure
    {
    	pModel->Position2D.x = VectorMiddle.x;
    	pModel->Position2D.y = VectorMiddle.y;
    }
    I don't see any boxes now, am I missing something? :P
    Code:
    void Worldtoscreen(LPDIRECT3DDEVICE9 Device)
    {
    	ModelInfo_t* pModel = new ModelInfo_t;
    
    	D3DXMATRIX ProjMatrix, ViewMatrix, WorldMatrix;
    	D3DXVECTOR3 VectorMiddle(0, 0, 0), ScreenMiddle(0, 0, 0);
    
    	Device->GetVertexShaderConstantF(204, ProjMatrix, 4); 
    	Device->GetVertexShaderConstantF(223, ViewMatrix, 4); 
    
    	D3DXMatrixIdentity(&WorldMatrix);
    	D3DXMatrixTranspose(&ViewMatrix, &ViewMatrix);
    	D3DXMatrixTranspose(&ProjMatrix, &ProjMatrix);
    
    	D3DXVec3Project(&VectorMiddle, &pModel->Position3D, &Viewport, &ProjMatrix, &ViewMatrix, &WorldMatrix);
    
    	if (VectorMiddle.z < 1.0f && ProjMatrix._44 < 1.0f) //not sure
    	{
    		pModel->Position2D.x = VectorMiddle.x;
    		pModel->Position2D.y = VectorMiddle.y;
    	}
    }

  2. #17
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    348
    Quote Originally Posted by ves23 View Post
    I don't see any boxes now, am I missing something? :P
    can't test but remove this line "if (VectorMiddle.z < 1.0f && ProjMatrix._44 < 1.0f)" and look if it works. If not, you have to log the shader and look whether or not this changed:
    // cbSharedPerView c204 4
    // cbPerObject c223 4

  3. #18
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by lvous View Post
    223
    I don't know how to log the shader. Is it bad if I use stride and set texture? I had problems with set pixel shader, models would become transparent in heroes and generals, and I dont know to make them work

  4. #19
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    348
    Quote Originally Posted by ves23 View Post
    I don't know how to log the shader. Is it bad if I use stride and set texture? I had problems with set pixel shader, models would become transparent in heroes and generals, and I dont know to make them work
    Stride and SetTexture(1.. worked for me, pixel shader was buggy. To log the shader use this:
    Code:
    void doDisassembleShader(LPDIRECT3DDEVICE9 pDevice,char* FileName)
    {
        std::ofstream oLogFile(FileName,std::ios::trunc);
        if (!oLogFile.is_open())
            return;
        IDirect3DVertexShader9* pShader;
        pDevice->GetVertexShader(&pShader);
        UINT pSizeOfData;
        pShader->GetFunction(NULL,&pSizeOfData);
        BYTE* pData = new BYTE[pSizeOfData];
        pShader->GetFunction(pData,&pSizeOfData);
        LPD3DXBUFFER bOut;
        D3DXDisassembleShader(reinterpret_cast<DWORD*>(pData),NULL,NULL,&bOut);
        oLogFile << static_cast<char*>(bOut->GetBufferPointer()) << std::endl;
        oLogFile.close();
        delete[] pData;
        pShader->Release();
    }
    
    in drawindexedp:
    
    if(Stride == 40)
    if (GetAsyncKeyState(VK_F9) & 1)
    	doDisassembleShader(pDevice, "shader1.txt");
    or
    if (GetAsyncKeyState(VK_F10) & 1)
    if(Stride == 40)
    	doDisassembleShader(pDevice, "shader2.txt");

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

    ves23 (04-18-2015)

  6. #20
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by lvous View Post
    Stride and SetTexture(1.. worked for me, pixel shader was buggy. To log the shader use this:
    Logged the pixel shader = pastebin . com/e35jXu32
    and the vertex shader = pastebin . com/wuuNFZCc

  7. #21
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    348
    Quote Originally Posted by ves23 View Post
    Logged the pixel shader = pastebin . com/e35jXu32
    and the vertex shader = pastebin . com/wuuNFZCc
    Looks similar to what I logged two patches ago, so worldtoscreen should work. I left out GetViewport maybe that's the problem?
    Code:
    ..
    Device->GetViewport(&Viewport);
    Device->GetVertexShaderConstantF(204, ProjMatrix, 4); 
    Device->GetVertexShaderConstantF(223, ViewMatrix, 4); 
    ..

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

    ves23 (04-19-2015)

  9. #22
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by lvous View Post
    Looks similar to what I logged two patches ago, so worldtoscreen should work. I left out GetViewport maybe that's the problem?
    Code:
    ..
    Device->GetViewport(&Viewport);
    Device->GetVertexShaderConstantF(204, ProjMatrix, 4); 
    Device->GetVertexShaderConstantF(223, ViewMatrix, 4); 
    ..
    Works :P puu.sh/hjnd7/c3444eb5e3.jpg Aiming at feet, but I guess I'll find the head chams, or body chams. Or maybe just fix the Y coord where the mouse goes.

    Thanks for your source, your time, and the will to help some random guy

    Code:
    void Worldtoscreen(LPDIRECT3DDEVICE9 Device)
    {
    	ModelInfo_t* pModel = new ModelInfo_t;
    
    	D3DXMATRIX ProjMatrix, ViewMatrix, WorldMatrix;
    	D3DXVECTOR3 VectorMiddle(0, 0, 0), ScreenMiddle(0, 0, 0);
    
    	Device->GetViewport(&Viewport);
    	Device->GetVertexShaderConstantF(204, ProjMatrix, 4); 
    	Device->GetVertexShaderConstantF(223, ViewMatrix, 4); 
    
    	D3DXMatrixIdentity(&WorldMatrix);
    	D3DXMatrixTranspose(&ViewMatrix, &ViewMatrix);
    	D3DXMatrixTranspose(&ProjMatrix, &ProjMatrix);
    
    	D3DXVec3Project(&VectorMiddle, &pModel->Position3D, &Viewport, &ProjMatrix, &ViewMatrix, &WorldMatrix);
    
    // 	if (VectorMiddle.z < 1.0f && ProjMatrix._44 < 1.0f) //not sure
    // 	{
    		pModel->Position2D.x = VectorMiddle.x;
    		pModel->Position2D.y = VectorMiddle.y;
    	//}
    	ModelInfo.push_back(pModel);
    }

  10. #23
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    348
    Quote Originally Posted by ves23 View Post
    Works :P puu.sh/hjnd7/c3444eb5e3.jpg Aiming at feet, but I guess I'll find the head chams, or body chams. Or maybe just fix the Y coord where the mouse goes.

    Thanks for your source, your time, and the will to help some random guy
    Glad it works, I think you can adjust height if you edit the last value of ScreenMiddle or pModel->Position3D somehow, try this:
    Code:
    ..
    D3DXVECTOR3 VectorMiddle(0, 0, 0), ScreenMiddle(0, 0, (float)aimheight);
    pModel->Position3D = ScreenMiddle;
    ..

  11. #24
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Even if I use the head only chams, its still drawing a box, aiming at the feet. Why is that?

  12. #25
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    All's working good now. Thanks once again.

    puu.sh/hl7G6/70572b3f7e.jpg

  13. #26
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,392
    My Mood
    Stressed
    Quote Originally Posted by lvous View Post
    Glad it works, I think you can adjust height if you edit the last value of ScreenMiddle or pModel->Position3D somehow, try this:
    Code:
    ..
    D3DXVECTOR3 VectorMiddle(0, 0, 0), ScreenMiddle(0, 0, (float)aimheight);
    pModel->Position3D = ScreenMiddle;
    ..
    Hey I can use this W2S? too.

    Code:
    bool WorldToScreen(D3DXVECTOR3 inpos, D3DXVECTOR3 &outpos, LPDIRECT3DDEVICE9 pDevice)
    {
    	DWORD dwRenderData = (DWORD)GetModuleHandleA("i3GfxDx.dll") + 00000;
    	CRenderData* RenderData = (CRenderData*)(dwRenderData);
    
    	D3DXVECTOR3 vScreen;
    	D3DVIEWPORT9 g_ViewPort;
    
    	pDevice->GetViewport(&g_ViewPort);
    	g_ViewPort.X = g_ViewPort.Y = 0;
    	g_ViewPort.MinZ = 0;
    	g_ViewPort.MaxZ = 1;
    	D3DXVec3Project(&vScreen, &inpos, &g_ViewPort,
    		&RenderData->RenderData->ProjectMatrix,
    		&RenderData->RenderData->ViewMatrix,
    		&RenderData->RenderData->WorldMatrix);
    
    	if (vScreen.z < 1.0f && vScreen.x > 0.0f && vScreen.y > 0.0f && vScreen.x < g_ViewPort.Width && vScreen.y < g_ViewPort.Height)
    	{
    		outpos.x = vScreen.x;
    		outpos.y = vScreen.y;
    		outpos.z = vScreen.z;
    
    		return true;
    	}
    
    	return false;
    }

  14. #27
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    348
    Quote Originally Posted by Jhem View Post
    Hey I can use this W2S? too.

    Code:
    bool WorldToScreen(D3DXVECTOR3 inpos, D3DXVECTOR3 &outpos, LPDIRECT3DDEVICE9 pDevice)
    {
    	DWORD dwRenderData = (DWORD)GetModuleHandleA("i3GfxDx.dll") + 00000;
    	CRenderData* RenderData = (CRenderData*)(dwRenderData);
    ..
    which game pointblank? if you have the classes and the right offset then yes

  15. #28
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Ivous, I require your help again, doing it now for a different game, UE3 Engine.

    Logged this
    Code:
    //   ViewProjecti********  c0       4
    //   CameraPosition       c4       1
    //   BoneMatrices         c5     225
    //   LocalToWorld         c230     4
    //   WorldToLocal         c234     3
    Which one am I supposed to use? I've tried them all, if I use 4, it kinda works, rotating my screen moves the boxes, but they're all in the middle of my screen

    Code:
    Device->GetVertexShaderConstantF(0, ProjMatrix, 4); 
    Device->GetVertexShaderConstantF(4, ViewMatrix, 4);
    I can make videos, if needed
    Last edited by ves23; 04-25-2015 at 02:52 PM.

  16. #29
    lvous's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    348
    Quote Originally Posted by ves23 View Post
    Ivous, I require your help again, doing it now for a different game, UE3 Engine.

    Logged this
    Code:
    //   ViewProjecti********  c0       4
    //   CameraPosition       c4       1
    //   BoneMatrices         c5     225
    //   LocalToWorld         c230     4
    //   WorldToLocal         c234     3
    Which one am I supposed to use? I've tried them all, if I use 4, it kinda works, rotating my screen moves the boxes, but they're all in the middle of my screen

    Code:
    Device->GetVertexShaderConstantF(0, ProjMatrix, 4); 
    Device->GetVertexShaderConstantF(4, ViewMatrix, 4);
    I can make videos, if needed
    use viewprojection & localtoworld

    Code:
    Device->GetVertexShaderConstantF(0, ProjMatrix, 4);
    Device->GetVertexShaderConstantF(230, ViewMatrix, 4);
    
    D3DXMatrixIdentity(&WorldMatrix);
    D3DXVec3Project..

  17. #30
    ves23's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by lvous View Post
    use viewprojection & localtoworld

    Code:
    Device->GetVertexShaderConstantF(0, ProjMatrix, 4);
    Device->GetVertexShaderConstantF(230, ViewMatrix, 4);
    
    D3DXMatrixIdentity(&WorldMatrix);
    D3DXVec3Project..
    Using viewprojection & localtoworld, no boxes are being drawn, heres the full shader log pastebin.com/1m39x6a5

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [Request] A simple undetected aimbot
    By tylormartin in forum Battlefield 3 (BF3) Hacks & Cheats
    Replies: 1
    Last Post: 11-23-2012, 04:01 AM
  2. simple unpatched aimbot plix
    By DanOfAwsome in forum Combat Arms Discussions
    Replies: 2
    Last Post: 01-27-2012, 12:57 AM
  3. Simple [Aimbot]
    By tabuzo013 in forum General
    Replies: 8
    Last Post: 10-10-2010, 06:02 PM
  4. Simple aimbot source code
    By yusako in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 23
    Last Post: 10-09-2010, 03:03 PM
  5. [Tutorial] How To make your own simple Aimbot
    By sumsar1812 in forum Battlefield Heroes Hacks
    Replies: 41
    Last Post: 11-01-2009, 02:14 AM

Tags for this Thread