Quote Originally Posted by anger83 View Post
the whole idea of this was
1. if you don't know what the actual code does do not release it.
2. you are a human so when somebody tell you that you are shit you shouldnt thank him.

And I’m not definitely envy you Sealionone
You am envy my grammar though.

BTW this won't work if you C+P it since this base has a looot of syntax errors and messed up shit.

I fixed it somewhat, it only logs the stride to find basic strides but you can add on other stuff if you need. (this isn't for C+Pers it's a stride logger not chams!)

I commented some lines where there was... random shit.

Code:
UINT m_Stride;
LPDIRECT3DVERTEXBUFFER9 m_StreamData;
UINT m_OffsetInBytes;
bool Stridelogger = false;//WDF this was an int ??? This base is shit..
int stri = 0;

//Wdf ? Not using the font at all ?

LPDIRECT3DTEXTURE9 texRed = NULL;//Only seems to be using texRed so you only need texRed...

//Get rid of all those bytes since you can just do D3DCOLOR and use GenerateTexture which is below (Azorbix made it I think):

HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
    long ret = pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL);
    if (ret != D3D_OK)
        return ret;

    WORD colour16    =    (WORD)(((colour32 >> 28) & 0xF) << 12)
                    |    (WORD)(((colour32 >> 20) & 0xF) << 8)
                    |    (WORD)(((colour32 >> 12) & 0xF) << 4)
                    |    (WORD)(((colour32 >> 4) & 0xF) << 0);

    D3DLOCKED_RECT d3dlr;
    (*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0); 
    WORD *pDst16 = (WORD*)d3dlr.pBits;

    for(int xy = 0; xy < 8*8; xy++)
        *pDst16++ = colour16;  

    (*ppD3Dtex)->UnlockRect(0);  

    return D3D_OK;
}

//Get rid of those other funcs because they aren't even called -_-

HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT nNumVertices,UINT startIndex,UINT nPrimitiveCount)
{//DIP det

//You need to get the current stride somewhere which I assume there was a SSS hook which wasn't C+Ped

if(pDevice->GetStreamSource(0, &m_StreamData, &m_OffsetInBytes, &m_Stride) == D3D_OK)//Get the current stride...
m_StreamData->Release();

if(!texRed){

    GenerateTexture(pDevice, &texRed, D3DCOLOR_XRGB(255, 0, 0));

}
//Get rid of all those checking for keys and put them in a thread also : it was just stri ; WTF?!?

if(m_Stride == stri)
{
    pDevice->SetTexture(0,texRed);
    oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex,  MinVertexIndex, nNumVertices, startIndex, nPrimitiveCount);//Call original func, you need a typedef at the top which you can probably find on any D3D9 hook.
}

return oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex,  MinVertexIndex, nNumVertices, startIndex, nPrimitiveCount);//Return original function

}

void main(LPVOID)//You need to create a new thread.
{

    while(true){

        if(GetAsyncKeyState(VK_F2) < 0){
            Sleep(300);//Sleep for obvious reasons
            StrideLogger = !StrideLogger;
        }

        if(GetAsyncKeyState(VK_NUMPAD7)<0){
            stri++;//Had to add ++ on to this...
            Sleep(300);
        }
        if(GetAsyncKeyState(VK_NUMPAD1)<0){
            stri--;
            Sleep(300);
        }

        Sleep(20);//Sleep at the end to not use as much CPU

    }

}
I may not be ub3r at D3D but I understand enough to fix some of this.
The code is not completely fixed but anybody who knows some D3D can probably add the rest to find the strides.