Still developing but works can be improved more.
Using Win7 32 and an ATI card.

This version uses a Pixelshaders alpha channel to hold constant values.
And Multi Threading to completely remove lag. :huh:

:jackie:

Forgot to test reset LOL! I'm lazy...

Credits:
Uc assorted
UC
GD
aB
more

PHP Code:
//=====================================================================================
#define _CRT_SECURE_NO_WARNINGS
// Roverturbo | www.uc-forum.com

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")

#include <d3dx9.h>
#pragma comment(lib, "d3dx9.lib")

#define D3D_RELEASE(D3D_PTR) if( D3D_PTR ){ D3D_PTR->Release(); D3D_PTR = NULL; }
#define D3DXGetPixel( Pixel, scx, scy, BITSPERPIXEL, pBits, pitch ) \
    
Pixel = ( PBYTE )( ( DWORD pBits + ( ( scy pitch ) \
    + ( 
scx * ( BITSPERPIXEL ) ) ) );

#define GETA(rgb) ((BYTE)((rgb)>>24))
#define GETR(rgb) ((BYTE)((rgb)>>16))
#define GETG(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GETB(rgb) ((BYTE)(rgb))

#define Opfor ((OpforAssualt || OpforGunnermen || OpforSniper || Opfortje)) 
#define OpforAssualt (Stride == 32 && (NumVertices == 3124 && PrimitiveCount == 4132) || (NumVertices == 1970 && PrimitiveCount == 2186) || (NumVertices == 1252 && PrimitiveCount == 1160) || (NumVertices == 470 && PrimitiveCount == 352)) 
#define OpforGunnermen (Stride == 32 && (NumVertices == 2715 && PrimitiveCount == 3588) || (NumVertices == 1620 && PrimitiveCount == 1886) || (NumVertices == 943 && PrimitiveCount == 908) || (NumVertices == 441 && PrimitiveCount == 308)) 
#define OpforSniper (Stride == 32 && (NumVertices == 250 && PrimitiveCount == 304) || (NumVertices == 2818 && PrimitiveCount == 3672) || (NumVertices == 150 && PrimitiveCount == 142) || (NumVertices == 1715 && PrimitiveCount == 1950) || (NumVertices == 1101 && PrimitiveCount == 1066) || (NumVertices == 481 && PrimitiveCount == 350)) || (Stride == 32 && (NumVertices == 2816 && PrimitiveCount == 3642) || (NumVertices == 1773 && PrimitiveCount == 2022) || (NumVertices == 1150 && PrimitiveCount == 1086) || (NumVertices == 435 && PrimitiveCount == 320)) 
#define Opfortje (Stride == 32 && (NumVertices == 3531 && PrimitiveCount == 4526) || (NumVertices == 2188 && PrimitiveCount == 2386) || (NumVertices == 1325 && PrimitiveCount == 1194) || (NumVertices == 499 && PrimitiveCount == 352)) 

#define Marines ((MarinesAssault || MarinesGunnremen || MarinesSniper || Marines1 || Marines2)) 
#define MarinesAssault (Stride == 32 && (NumVertices == 2613 && PrimitiveCount == 3248) || (NumVertices == 1842 && PrimitiveCount == 1978) || (NumVertices == 1144 && PrimitiveCount == 814) || (NumVertices == 1034 && PrimitiveCount == 904) || (NumVertices == 447 && PrimitiveCount == 312)) 
#define MarinesGunnremen (Stride == 32 && (NumVertices == 3597 && PrimitiveCount == 4280) || (NumVertices == 2301 && PrimitiveCount == 2364) || (NumVertices == 1341 && PrimitiveCount == 1132) || (NumVertices == 580 && PrimitiveCount == 380)) 
#define MarinesSniper (Stride == 32 && (NumVertices == 2516 && PrimitiveCount == 2940) || (NumVertices == 681 && PrimitiveCount == 588) || (NumVertices == 106 && PrimitiveCount == 114) || (NumVertices == 1726 && PrimitiveCount == 1760) || (NumVertices == 1020 && PrimitiveCount == 872) || (NumVertices == 587 && PrimitiveCount == 370)) 
#define Marines1 (Stride == 32 && (NumVertices == 689 && PrimitiveCount == 1172) || (NumVertices == 367 && PrimitiveCount == 298) || (NumVertices == 4050 && PrimitiveCount == 4486) || (NumVertices == 308 && PrimitiveCount == 212) || (NumVertices == 2540 && PrimitiveCount == 2444) || (NumVertices == 628 && PrimitiveCount == 670) || (NumVertices == 1488 && PrimitiveCount == 1114) || (NumVertices == 105 && PrimitiveCount == 74) || (NumVertices == 592 && PrimitiveCount == 374)) 
#define Marines2 (Stride == 32 && (NumVertices == 3790 && PrimitiveCount == 4078) || (NumVertices == 2784 && PrimitiveCount == 2384) || (NumVertices == 1572 && PrimitiveCount == 1166) || (NumVertices == 634 && PrimitiveCount == 372) || (NumVertices == 233 && PrimitiveCount == 330)) 

#define Spetz ((SpetzAssualt || SpetzGunnermen || SpetzSniper || Spetz1 || Spetz2)) 
#define SpetzAssualt (Stride == 32 && (NumVertices == 4358 && PrimitiveCount == 4864) || (NumVertices == 3278 && PrimitiveCount == 3188) || (NumVertices == 503 && PrimitiveCount == 704) || (NumVertices == 1633 && PrimitiveCount == 1332) || (NumVertices == 840 && PrimitiveCount == 618) || (NumVertices == 783 && PrimitiveCount == 1168)) 
#define SpetzGunnermen (Stride == 32 && (NumVertices == 4270 && PrimitiveCount == 4804) || (NumVertices == 2755 && PrimitiveCount == 2494) || (NumVertices == 1317 && PrimitiveCount == 1054) || (NumVertices == 809 && PrimitiveCount == 590)) 
#define SpetzSniper (Stride == 32 && (NumVertices == 726 && PrimitiveCount == 556) || (NumVertices == 1315 && PrimitiveCount == 1170) || (NumVertices == 2140 && PrimitiveCount == 2310) || (NumVertices == 3326 && PrimitiveCount == 4336) || (NumVertices == 2578 && PrimitiveCount == 2192) || (NumVertices == 482 && PrimitiveCount == 476) || (NumVertices == 3254 && PrimitiveCount == 4122) || (NumVertices == 1730 && PrimitiveCount == 1938) || (NumVertices == 398 && PrimitiveCount == 410) || (NumVertices == 327 && PrimitiveCount == 500) || (NumVertices == 2388 && PrimitiveCount == 2040) || (NumVertices == 222 && PrimitiveCount == 298) || (NumVertices == 1111 && PrimitiveCount == 986) || (NumVertices == 1186 && PrimitiveCount == 1184) || (NumVertices == 339 && PrimitiveCount == 248) || (NumVertices == 994 && PrimitiveCount == 714)) 
#define Spetz1 (Stride == 32 && (NumVertices == 4242 && PrimitiveCount == 5028) || (NumVertices == 2391 && PrimitiveCount == 2488) || (NumVertices == 1689 && PrimitiveCount == 1422) || (NumVertices == 384 && PrimitiveCount == 250) || (NumVertices == 969 && PrimitiveCount == 708)) 
#define Spetz2 (Stride == 32 && (NumVertices == 793 && PrimitiveCount == 834) || (NumVertices == 3891 && PrimitiveCount == 4598) || (NumVertices == 592 && PrimitiveCount == 532) || (NumVertices == 2510 && PrimitiveCount == 2470) || (NumVertices == 171 && PrimitiveCount == 114) || (NumVertices == 1398 && PrimitiveCount == 1176) || (NumVertices == 384 && PrimitiveCount == 250) || (NumVertices == 384 && PrimitiveCount == 250) || (NumVertices == 994 && PrimitiveCount == 714) || (NumVertices == 529 && PrimitiveCount == 540) || (NumVertices == 353 && PrimitiveCount == 346)) 

#define SAS ((SASAssualt || SASGunnermen || SASSniper || SAS1 || SAS2)) 
#define SASAssualt (Stride == 32 && (NumVertices == 447 && PrimitiveCount == 312) || (NumVertices == 1034 && PrimitiveCount == 904) || (NumVertices == 1842 && PrimitiveCount == 1978) || (NumVertices == 2613 && PrimitiveCount == 3248) || (NumVertices == 1001 && PrimitiveCount == 964) || (NumVertices == 3935 && PrimitiveCount == 5226) || (NumVertices == 960 && PrimitiveCount == 1072) || (NumVertices == 2640 && PrimitiveCount == 3070) || (NumVertices == 212 && PrimitiveCount == 288) || (NumVertices == 214 && PrimitiveCount == 202) || (NumVertices == 1373 && PrimitiveCount == 1256) || (NumVertices == 585 && PrimitiveCount == 440))
#define SASGunnermen (Stride == 32 && (NumVertices == 193 && PrimitiveCount == 140) || (NumVertices == 580 && PrimitiveCount == 380) || (NumVertices == 1341 && PrimitiveCount == 1132) || (NumVertices == 802 && PrimitiveCount == 800) || (NumVertices == 2301 && PrimitiveCount == 2364) || (NumVertices == 275 && PrimitiveCount == 322) || (NumVertices == 3597 && PrimitiveCount == 4280) || (NumVertices == 3716 && PrimitiveCount == 5064) || (NumVertices == 2578 && PrimitiveCount == 2994) || (NumVertices == 1412 && PrimitiveCount == 1330) || (NumVertices == 568 && PrimitiveCount == 470)) 
#define SASSniper (Stride == 32 && (NumVertices == 1615 && PrimitiveCount == 1706) || (NumVertices == 541 && PrimitiveCount == 366) || (NumVertices == 3667 && PrimitiveCount == 4952) || (NumVertices == 2460 && PrimitiveCount == 2882) || (NumVertices == 1479 && PrimitiveCount == 1402) || (NumVertices == 552 && PrimitiveCount == 452))  
#define SAS1 (Stride == 32 && (NumVertices == 634 && PrimitiveCount == 372) || (NumVertices == 1572 && PrimitiveCount == 1166) || (NumVertices == 2784 && PrimitiveCount == 2384) || (NumVertices == 3790 && PrimitiveCount == 4078) || (NumVertices == 3585 && PrimitiveCount == 4858) || (NumVertices == 1498 && PrimitiveCount == 1304) || (NumVertices == 2525 && PrimitiveCount == 3022) || (NumVertices == 695 && PrimitiveCount == 478))  
#define SAS2 (Stride == 32 && (NumVertices == 689 && PrimitiveCount == 1172) || (NumVertices == 367 && PrimitiveCount == 298) || (NumVertices == 4050 && PrimitiveCount == 4486) || (NumVertices == 308 && PrimitiveCount == 212) || (NumVertices == 2540 && PrimitiveCount == 2444) || (NumVertices == 628 && PrimitiveCount == 670) || (NumVertices == 1488 && PrimitiveCount == 1114) || (NumVertices == 105 && PrimitiveCount == 74) || (NumVertices == 592 && PrimitiveCount == 374) || (NumVertices == 3562 && PrimitiveCount == 4784) || (NumVertices == 2509 && PrimitiveCount == 2954) || (NumVertices == 1402 && PrimitiveCount == 1164) || (NumVertices == 628 && PrimitiveCount == 450)) 
#define snow ( Stride == 20 ) 
#define Smoke ((NumVertices == 16384)) 
#define sky ((Stride == 44) && (NumVertices == 20 && PrimitiveCount == 10) || (NumVertices == 12 && PrimitiveCount == 12) || (PrimitiveCount >= 20 && PrimitiveCount <= 30 && NumVertices == 50) || (PrimitiveCount >= 20 && PrimitiveCount <= 30 && PrimitiveCount == 37) || (PrimitiveCount >= 20 && PrimitiveCount <= 30 && PrimitiveCount == 32) || (PrimitiveCount >= 20 && PrimitiveCount <= 30 && PrimitiveCount == 41)) 

//=====================================================================================

typedef HRESULT (WINAPICreateDevice_Prototype)        (LPDIRECT3D9UINTD3DDEVTYPEHWNDDWORDD3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
typedef HRESULT (WINAPIReset_Prototype)               (LPDIRECT3DDEVICE9D3DPRESENT_PARAMETERS*);
typedef HRESULT (WINAPIEndScene_Prototype)            (LPDIRECT3DDEVICE9);
typedef HRESULT (WINAPIDrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9D3DPRIMITIVETYPEINTUINTUINTUINTUINT);

CreateDevice_Prototype         CreateDevice_Pointer         NULL;
Reset_Prototype                Reset_Pointer                NULL;
EndScene_Prototype             EndScene_Pointer             NULL;
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer NULL;

HRESULT WINAPI Direct3DCreate9_VMTable    (VOID);
HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D9UINTD3DDEVTYPEHWNDDWORDD3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE9D3DPRESENT_PARAMETERS*);
HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE9);
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9D3DPRIMITIVETYPEINTUINTUINTUINTUINT);
void WINAPI Aimbotvoid );
HRESULT GenerateTextureIDirect3DDevice9 *pD3Ddev
            
IDirect3DTexture9 **ppD3DtexDWORD colour32 );
HRESULT CreateMyShader(IDirect3DPixelShader9 **Shader_NameIDirect3DDevice9 *Deviceint redint greenint blueint alpha );
VOID WINAPI ScannerLPBYTE Bitsint pitchDWORD ScanWidthDWORD ScanHeight );
DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID);

struct MyColor
{
    
BYTE A,R,G,B;
};

struct Entities
{
    
DWORD X;
    
DWORD Y;
};

PDWORD Direct3D_VMTable NULL;
LPDIRECT3DDEVICE9 pDevice;
LPDIRECT3DSURFACE9 pRenderSurf NULL;
LPDIRECT3DSURFACE9 oDStencilSurface NULL;
LPDIRECT3DSURFACE9 oSurface NULL;
LPDIRECT3DTEXTURE9 tBlue NULL;
BOOL bFrameReady FALSE;
BOOL bDrawn FALSE;
LPDIRECT3DPIXELSHADER9 Color[MAX_PATH];
LPDIRECT3DPIXELSHADER9 Color2 NULL;
BOOL InitShaders FALSE;
int Color_Ctr 0;
MyColor Colors = {0x0};
Entities Ents[255];
int iNumOfColors 0;
BYTE Init 0x0;
DWORD Box_Size 10;
D3DVIEWPORT9 pView;

//=====================================================================================

BOOL WINAPI DllMain(HINSTANCE hinstModuleDWORD dwReasonLPVOID lpvReserved)
{
  if(
dwReason == DLL_PROCESS_ATTACH)
  {
    
DisableThreadLibraryCalls(hinstModule);

    if(
Direct3DCreate9_VMTable() == D3D_OK)
    return 
TRUE;
  }

  return 
FALSE;
}

//=====================================================================================

HRESULT WINAPI Direct3DCreate9_VMTable(VOID)
{
  
LPDIRECT3D9 Direct3D_Object Direct3DCreate9(D3D_SDK_VERSION);

  if(
Direct3D_Object == NULL)
  return 
D3DERR_INVALIDCALL;
  
  
Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
  
Direct3D_Object->Release();

  
DWORD dwProtect;

  if(
VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(
PDWORD)&CreateDevice_Pointer Direct3D_VMTable[16];
    *(
PDWORD)&Direct3D_VMTable[16] = (DWORD)CreateDevice_Detour;

    if(
VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return 
D3DERR_INVALIDCALL;
  }
  else
  return 
D3DERR_INVALIDCALL;

  return 
D3D_OK;
}

//=====================================================================================

HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D9 Direct3D_ObjectUINT AdapterD3DDEVTYPE DeviceTypeHWND FocusWindow
                    
DWORD BehaviorFlagsD3DPRESENT_PARAMETERSPresentationParameters
                    
LPDIRECT3DDEVICE9Returned_Device_Interface)
{
  
HRESULT Returned_Result CreateDevice_Pointer(Direct3D_ObjectAdapterDeviceTypeFocusWindowBehaviorFlags
                                              
PresentationParametersReturned_Device_Interface);
   
  
DWORD dwProtect;

  if(
VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(
PDWORD)&Direct3D_VMTable[16] = *(PDWORD)&CreateDevice_Pointer;
    
CreateDevice_Pointer           NULL;

    if(
VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return 
D3DERR_INVALIDCALL;
  }
  else
  return 
D3DERR_INVALIDCALL;

  if(
Returned_Result == D3D_OK)
  {
    
Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_Device_Interface;

    *(
PDWORD)&Reset_Pointer                = (DWORD)Direct3D_VMTable[16];
    *(
PDWORD)&EndScene_Pointer             = (DWORD)Direct3D_VMTable[42];
    *(
PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[82];

    if(
CreateThread(NULL0VirtualMethodTableRepatchingLoopToCounterExtensionRepatchingNULL0NULL) == NULL)
    return 
D3DERR_INVALIDCALL;
  }
    
  return 
Returned_Result;
}

//=====================================================================================

HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE9 Device_InterfaceD3DPRESENT_PARAMETERSPresentationParameters)
{
    if( 
tBlue != NULL )
        
D3D_RELEASEtBlue )

    if( 
InitShaders == TRUE )
    {
        for( 
int i 0;255;i++ )
            
D3D_RELEASEColor[i] )

        
InitShaders FALSE;
    }

  return 
Reset_Pointer(Device_InterfacePresentationParameters);
}

//=====================================================================================

HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9 Device_Interface)
{
    
Device_Interface->GetViewport( &pView );
    if( 
Init == 0x0 )
    {
        
pDevice Device_Interface;
        
CreateThread(NULLNULL, (LPTHREAD_START_ROUTINE)AimbotNULL0NULL);
        
Init 0x1;
    }

    if( 
bDrawn == TRUE )
        
bFrameReady TRUE;

    if( 
tBlue == NULL )
        
GenerateTextureDevice_Interface, &tBlue
            
D3DCOLOR_ARGB25500255 ) );

    if( 
InitShaders == FALSE )
    {
        for( 
int i 0;255;i++ )
            
CreateMyShader( &Color[i], Device_Interface2020255);

        
InitShaders TRUE;
    }

    if( 
bDrawn == TRUE )
    {
        for( 
int i 0iNumOfColorsi++ )
        {
            
DWORD Exp_x Ents[i].X;
            
DWORD Exp_y Ents[i].Y;
            
D3DRECT HBOX;                        

            
HBOX.x1 Exp_x Box_Size;
            
HBOX.y1 Exp_y Box_Size;
            
HBOX.x2 Exp_x Box_Size;
            
HBOX.y2 Exp_y - (Box_Size 1);

            
Device_Interface->Clear1, &HBOXD3DCLEAR_TARGET
                
D3DCOLOR_ARGB25520128255 ), 0,  );

            
HBOX.x1 Exp_x Box_Size;
            
HBOX.y1 Exp_y + (Box_Size 1);
            
HBOX.x2 Exp_x Box_Size;
            
HBOX.y2 Exp_y Box_Size;

            
Device_Interface->Clear1, &HBOXD3DCLEAR_TARGET
                
D3DCOLOR_ARGB25520128255 ), 0,  ); 

            
HBOX.x1 Exp_x Box_Size;
            
HBOX.y1 Exp_y Box_Size;
            
HBOX.x2 Exp_x - (Box_Size 1);
            
HBOX.y2 Exp_y Box_Size;

            
Device_Interface->Clear1, &HBOXD3DCLEAR_TARGET
                
D3DCOLOR_ARGB25520128255 ), 0,  ); 

            
HBOX.x1 Exp_x + (Box_Size 1);
            
HBOX.y1 Exp_y Box_Size;
            
HBOX.x2 Exp_x Box_Size;
            
HBOX.y2 Exp_y Box_Size;

            
Device_Interface->Clear1, &HBOXD3DCLEAR_TARGET
                
D3DCOLOR_ARGB25520128255 ), 0,  ); 
        }
    }
  return 
EndScene_Pointer(Device_Interface);
}

//=====================================================================================

HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9 Device_InterfaceD3DPRIMITIVETYPE TypeINT BaseIndex
                                           
UINT MinIndexUINT NumVerticesUINT StartIndexUINT PrimitiveCount)
{
  
LPDIRECT3DVERTEXBUFFER9 Stream_Data;
  
UINT Offset 0;
  
UINT Stride 0;
  
LPDIRECT3DPIXELSHADER9 pShade NULL;
  
D3DSURFACE_DESC Desc;
  
DWORD IsInGame;

  if(
Device_Interface->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
  
Stream_Data->Release();

  
IsInGame = *(PDWORD)0x0074E35C;

  if( 
Opfor || Marines || Spetz || SAS )
  {
      if( 
bFrameReady == FALSE && IsInGame )
      {
          
Device_Interface->GetPixelShader( &pShade );
          
Device_Interface->GetRenderTarget0, &oSurface );

          
oSurface->GetDesc( &Desc );

          if( 
Desc.Width == pView.Width && Desc.Height == pView.Height )
          {
              
Device_Interface->SetRenderTarget0pRenderSurf );
              
Device_Interface->SetPixelShaderColor[Color_Ctr] );

              
Device_Interface->SetRenderStateD3DRS_ZENABLEFALSE );

              
DrawIndexedPrimitive_PointerDevice_InterfaceTypeBaseIndex
                  
MinIndexNumVerticesStartIndexPrimitiveCount );

              
Device_Interface->SetRenderStateD3DRS_ZENABLETRUE );

              
DrawIndexedPrimitive_PointerDevice_InterfaceTypeBaseIndex
                  
MinIndexNumVerticesStartIndexPrimitiveCount );
              
              
Device_Interface->SetRenderTarget0oSurface );
              
Device_Interface->SetPixelShaderpShade );

              
bDrawn TRUE;

              if( 
Color_Ctr 255 )
                    
Color_Ctr++;
          }

          
D3D_RELEASEoSurface );
          
D3D_RELEASEpShade );
      }

      
Device_Interface->SetRenderStateD3DRS_ZENABLEFALSE );
      
Device_Interface->SetTexture0tBlue );

      
DrawIndexedPrimitive_Pointer(Device_Interface
        
TypeBaseIndexMinIndexNumVerticesStartIndexPrimitiveCount);

      
Device_Interface->SetRenderStateD3DRS_ZENABLETRUE );

      return 
DrawIndexedPrimitive_Pointer(Device_Interface
        
TypeBaseIndexMinIndexNumVerticesStartIndexPrimitiveCount);
  }
  return 
DrawIndexedPrimitive_Pointer(Device_InterfaceTypeBaseIndexMinIndexNumVerticesStartIndexPrimitiveCount);
}

//=====================================================================================

DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID Param)
{
  
UNREFERENCED_PARAMETER(Param); 

  while(
1)
  {
    
Sleep(100);

    *(
PDWORD)&Direct3D_VMTable[16] = (DWORD)Reset_Detour;
    *(
PDWORD)&Direct3D_VMTable[42] = (DWORD)EndScene_Detour;
    *(
PDWORD)&Direct3D_VMTable[82] = (DWORD)DrawIndexedPrimitive_Detour;
  }

  return 
1;
}

//=====================================================================================
 
void WINAPI Aimbotvoid )
{
    
LPDIRECT3DSURFACE9 pSurf NULL;
    
D3DLOCKED_RECT lRect;
    
D3DVIEWPORT9 Viewport;
    
PBYTE pBits NULL;
    
int BITSPERPIXEL 32;
    
PBYTE Pixel;

    
pDevice->GetViewport( &Viewport );

    
pDevice->CreateOffscreenPlainSurfaceUINT(Viewport.Width), UINT(Viewport.Height), 
                
D3DFMT_A8R8G8B8D3DPOOL_SYSTEMMEM, &pSurfNULL );

    
pDevice->CreateRenderTargetUINT(Viewport.Width), UINT(Viewport.Height),
                
D3DFMT_A8R8G8B8D3DMULTISAMPLE_NONE0TRUE, &pRenderSurfNULL );

    while( 
)
    {
        if( 
pDevice != NULL && bFrameReady == TRUE )
        {
            
pDevice->GetViewport( &Viewport );
            
pDevice->GetRenderTargetDatapRenderSurfpSurf );
            if( 
pSurf->LockRect( &lRectNULL
                
D3DLOCK_NOSYSLOCK D3DLOCK_DONOTWAIT ) == S_OK )
            {
                
Scanner( ( LPBYTE lRect.pBitslRect.Pitch
                    
Viewport.WidthViewport.Height );

                
pSurf->UnlockRect();
            }

            if( 
pRenderSurf->LockRect( &lRectNULL
                
D3DLOCK_NOSYSLOCK D3DLOCK_DONOTWAIT ) == S_OK )
            {
                for( 
DWORD scy 1Lscy Viewport.Heightscy++ )
                {
                    for( 
DWORD scx 1Lscx Viewport.Widthscx++ )
                    {
                        
Pixel = ( PBYTE lRect.pBits;
                        
Pixel += ( ( scy lRect.Pitch 
                                + ( 
scx * ( BITSPERPIXEL ) ) );

                        
Pixel[3] = 0x00;
                        
Pixel[2] = 0x00;
                        
Pixel[1] = 0x00;
                        
Pixel[0] = 0x00;
                    }
                }

                
pRenderSurf->UnlockRect();
            }
            
Color_Ctr 0;
            
bFrameReady FALSE;
            
bDrawn FALSE;
        }
        
Sleep10 );
    }
}

//=====================================================================================

HRESULT GenerateTextureIDirect3DDevice9 *pD3Ddev
            
IDirect3DTexture9 **ppD3DtexDWORD colour32 )
{
    if( 
FAILEDpD3Ddev->CreateTexture8810
        
D3DFMT_A4R4G4B4D3DPOOL_MANAGEDppD3DtexNULL ) ) )
            return 
E_FAIL;
     
    
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, &d3dlr00);
    
WORD *pDst16 = (WORD*)d3dlr.pBits;
    for(
int xy=0xy 8*8xy++)
    *
pDst16++ = colour16;
    (*
ppD3Dtex)->UnlockRect(0);
    return 
S_OK;
}

HRESULT CreateMyShader(IDirect3DPixelShader9 **Shader_NameIDirect3DDevice9 *Deviceint redint greenint blueint alpha )
{
    
ID3DXBuffer *MyBuffer NULL;
    
char MyShader256 ];
    
sprintfMyShader"ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0, c0", (float)red/(float)255, (float)green/(float)255, (float)blue/(float)255, (float)alpha/(float)255 );
    
D3DXAssembleShaderMyShadersizeofMyShader ), NULLNULL0, &MyBuffer NULL );
    if( 
FAILEDDevice->CreatePixelShader((const DWORD*)MyBuffer ->GetBufferPointer(), Shader_Name)) )return E_FAIL;
    return 
S_OK;
}

VOID WINAPI GetColorMyColor pCol )
{
    if( 
pCol->0xFF )
        
pCol->R++;
    
    if( 
pCol->>= 0xFF )
    {
        
pCol->G++;
        
pCol->0x0;
    }

    if( 
pCol->>= 0xFF )
    {
        
pCol->B++;
        
pCol->0x0;
        
pCol->0x0;
    }

    if( 
pCol->>= 0xFF )
    {
        
pCol->0x0;
        
pCol->0x0;
        
pCol->0x0;
    }
}

VOID WINAPI ScannerLPBYTE Bitsint pitchDWORD ScanWidthDWORD ScanHeight )
{
    
DWORD BITSPERPIXEL 32// ARGB 32Bits/Pixel
    
PBYTE Pixel;
    
iNumOfColors 0;
    
Colors.0x7F;
    
Colors.0x00;
    
Colors.0x00;
    
int nPosx;
    
int nPosy;
    
int lPosx;
    
int lPosy;
    
BOOL FirstPixel;
    
iNumOfColors Color_Ctr;

    for( 
int i 0Color_Ctri++ )
    {
        
GetColor( &Colors );
        
nPosx 0;
        
nPosy 0;
        
FirstPixel FALSE;
        
Ents[i].0;
        
Ents[i].0;

        for( 
DWORD scy 1Lscy ScanHeightscy++ )
        {
            for( 
DWORD scx 1Lscx ScanWidthscx++ )
            {
                
Pixel = ( PBYTE Bits;
                
Pixel += ( ( scy pitch 
                        + ( 
scx * ( BITSPERPIXEL ) ) );

                if( *(
PDWORD)Pixel != NULL )
                {
                    if( 
Pixel[3] == )
                    {
                        
Pixel[3] = 0xFF;
                        
Pixel[2] = Colors.R;
                        
Pixel[1] = Colors.G;
                        
Pixel[0] = Colors.B;

                        if( 
FirstPixel == FALSE )
                        {
                            
nPosx scx;
                            
nPosy scy;
                            
FirstPixel TRUE;
                        }
                        else
                        {
                            
lPosx scx;
                            
lPosy scy;
                        }
                    }
                }
            }
        }
        
Ents[i].= (nPosx lPosx) / 2;
        
Ents[i].= (nPosy lPosy) / 2;
    }