Hook

From x, 3 Years ago, written in C, viewed 821 times.
URL http://paste.security-portal.cz/view/36c3aeb5 Embed
Download Paste or View Raw
  1.     //Hacked Created by Vitrix Maggot//
  2.     //Thanks to Alex//
  3.  
  4.     #include <windows.h>
  5.     #include <mmsystem.h>
  6.     #include <stdio.h>
  7.     #include <fstream>
  8.     #include <cSuport.h>
  9.     #include "cReplace.h"
  10.     #include <cFullhack.h>
  11.     #include <d3d9.h>
  12.     #include <d3dx9.h>
  13.     #include <time.h>
  14.     #pragma comment(lib, "d3d9.lib")
  15.     #pragma comment(lib, "d3dx9.lib")
  16.     #pragma warning (disable:4996 4244)
  17.     //----------------------------------------------------------------------------------------------------------------------------------
  18.     #define HOOK(func,addy) o##func = (t##func)CreateDetour((DWORD)hk##func,(DWORD)addy,Detour_Type_0xB8,7)//Quick Hook using CreateDetour UC-FORUM
  19.     #define UNHOOK(func,addy) o##func = (t##func)CreateDetour((DWORD)o##func,(DWORD)addy,Detour_Type_0xB8,7)//Quick Unook using CreateDetour UC-FORUM
  20.     LPDIRECT3DTEXTURE9 Megaze, Blooderz, Nightmarez, Avenged, Sevenfold, TujuhX, Bondan, Fadetoblack;
  21.     #define ES 0 //EndScene
  22.     #define DIP 1 //DrawIndexedPrimitive
  23.     #define RES 2 //Reset
  24.     #define E8 2 //Reset
  25.     #define ZE 3 //Reset
  26.     #define DrawIndex 0x002B
  27.     #define EndS 0x0023
  28.     //----------------------------------------------------------------------------------------------------------------------------------
  29.     BYTE _Menu[] = { 0x89, 0x50, 0x4E, 0x47, 0xD, 0xA, 0x1A, 0xA, 0x0, 0x0, 0x0, 0xD, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xA2, 0x0, 0x0, 0x0, 0x33, 0x8, 0x6, 0x0, 0x0, 0x0, 0x14, 0xC8, 0xD3, 0xFD, 0x0, 0x0, 0x0, 0x4, 0x67, 0x41, 0x4D, 0x41, 0x0, 0x0, 0xB1, 0x8F, 0xB, 0xFC, 0x61, 0x5, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4B, 0x47, 0x44, 0x0, 0xFF, 0x0, 0xFF, 0x0, 0xFF, 0xA0, 0xBD, 0xA7, 0x93, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xB, 0x13, 0x0, 0x0, 0xB, 0x13, 0x1, 0x0, 0x9A, 0x9C, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4D, 0x45, 0x7, 0xDC, 0x3, 0x2, 0xB, 0x26, 0x18, 0x98, 0x66, 0x30, 0x3C, 0x0, 0x0, 0x20, 0x0, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, 0xED, 0x7D, 0x77, 0x94, 0x5C, 0xD7, 0x79, 0xDF, 0xEF, 0xDE, 0xD7, 0xE6, 0x4D, 0xDD, 0xA9, 0x3B, 0xDB, 0xB, 0x16, 0xBD, 0x10, 0x24, 0x1, 0xA, 0x24, 0x44, 0x52, 0x2C, 0xA2, 0x28, 0x4A, 0x14, 0x49, 0x49, 0x94, 0x25, 0xCB, 0xB6, 0x64, 0xC7, 0xB1, 0x12, 0xCB, 0x76, 0xDA, 0xC9, 0x49, 0x72, 0x4E, 0x1C, 0xB7, 0x28, 0x47, 0x91, 0x63, 0xC7, 0x39, 0x2E, 0xD1, 0xB1, 0x23, 0x59, 0x51, 0x73, 0x62, 0x35, 0xCB, 0xA4, 0x2D, 0x91, 0x14, 0x45, 0x52, 0xA4, 0xA, 0x41, 0x12, 0x80, 0x0, 0x12, 0x1D, 0x8B, 0xC5, 0xF6, 0xBE, 0x3B, 0xE5, 0xB5, 0xFB, 0xDE, 0xBB, 0x37, 0x7F, 0xCC, 0x9B, 0xC1, 0x60, 0x38, 0x33, 0x3B, 0x4B, 0x90, 0x94, 0xAD, 0x93, 0xC1, 0x99, 0xB3, 0x8B, 0xDD, 0x79, 0xEF, 0x7D, 0xE5, 0xF7, 0xD5, 0x7B, 0xEF, 0xB7, 0x4, 0x6F, 0xFC, 0x8B, 0x74, 0xF0, 0x19, 0xD1, 0xE6, 0x1A, 0x81, 0xFF, 0xFF, 0xFA, 0xA9, 0x7F, 0x91, 0x7F, 0x24, 0xF7, 0xDC, 0x8, 0xB8, 0x3F, 0x4D, 0xF2, 0xFB, 0x87, 0xC2, 0x27, 0x79, 0x33, 0x69, 0x24, 0x6F, 0x2, 0xF1, 0xE4, 0xD, 0x14, 0xBC, 0xF8, 0x29, 0x5, 0xE0, 0x4F, 0x92, 0x4F, 0xF2, 0x93, 0xA0, 0x91, 0xBC, 0x1, 0xC4, 0x77, 0xF2, 0xFD, 0x66, 0x9, 0x17, 0x9B, 0xFC, 0xFF, 0x9B, 0xA5, 0x24, 0xB2, 0x9, 0x59, 0x8A, 0xE, 0x3E, 0xD7, 0x8E, 0x2F, 0xF1, 0x13, 0xE4, 0xED, 0x5A, 0x74, 0xF3, 0xA6, 0x0, 0xB1, 0x99, 0x22, 0x36, 0xFA, 0xBA, 0x11, 0xC1, 0xA2, 0x3, 0xA6, 0xC5, 0x4F, 0x58, 0x51, 0x1B, 0xF1, 0xF6, 0x7A, 0x78, 0x3F, 0xF1, 0x26, 0x2, 0x92, 0x74, 0xC8, 0x67, 0x3B, 0x7A, 0xAE, 0x89, 0x46, 0xF9, 0x75, 0x24, 0x9E, 0x34, 0x7C, 0xDF, 0xF8, 0xDE, 0x8, 0x74, 0x9D, 0x2, 0x50, 0x4, 0xF7, 0x7B, 0xB3, 0xC3, 0x72, 0x33, 0xF0, 0x35, 0xFB, 0x7E, 0xB3, 0xC5, 0x58, 0x3B, 0x3E, 0xDF, 0x2C, 0x6F, 0x4F, 0x3A, 0xE0, 0xB1, 0x53, 0x9D, 0x88, 0xD7, 0x52, 0x6C, 0xCA, 0xAF, 0x23, 0x8, 0xAB, 0x6F, 0xDA, 0xF0, 0xB5, 0x15, 0x18, 0x9B, 0x9, 0xBD, 0x13, 0xC5, 0xF0, 0x26, 0x8C, 0xBF, 0x91, 0xF9, 0x55, 0x2B, 0xE5, 0x74, 0x62, 0x70, 0xA2, 0x3, 0x20, 0x92, 0x26, 0x7C, 0x8A, 0x6, 0xDE, 0x3A;
  30.     //------------------------------------------------------------------------------------------------------------------
  31.     LPD3DXFONT g_pFont = NULL;
  32.     LPD3DXFONT g_pFont2 = NULL;
  33.     D3DVIEWPORT9 g_ViewPort;
  34.     //------------------------------------------------------------------------------------------------------------------
  35.     LPDIRECT3DDEVICE9 npDevice;
  36.     LPDIRECT3DTEXTURE9 txHeader;
  37.     LPD3DXSPRITE bbSprite;
  38.     D3DXVECTOR3 pHeader;
  39.     //------------------------------------------------------------------------------------------------------------------
  40.     bool CekHook=false;
  41.     bool pertamax=true;
  42.     int Comander = 0;
  43.     int Rezpect = 0;
  44.     int Comander1 = 0;
  45.     int Rezpect1 = 0;
  46.     int tandasilang = 0;
  47.     int Tutor = 0;
  48.     int wew = 1;
  49.     int d3d = 1;
  50.     int uyeh = 0;
  51.     int player = 1;
  52.     int fullhack = 0;
  53.     int replace = 0;
  54.     int baret = 0;
  55.     int Charakter = 0;
  56.     int rm = 0;
  57.     int DC = 0;
  58.     int info = 0;
  59.     int group = 0;
  60.     int Replaceeeeeeeeeeeeeeeee=0;
  61.     int mp3 = 0;
  62.     int memek=0;
  63.     int kontolllllllll=0;
  64.     int Hack1 = 0;
  65.     int Hack2 = 0;
  66.     int Hack3 = 0;
  67.     int Hack4 = 0;
  68.     int Hack5 = 0;
  69.     int Hack6 = 0;
  70.     int Hack7 = 0;
  71.     int Hack8 = 0;
  72.     int Hack9 = 0;
  73.     int Hack10 = 0;
  74.     int Hack11 = 0;
  75.     int Hack12 = 0;
  76.     int Hack13 = 0;
  77.     int Hack14 = 0;
  78.     int CH_PATEN = 0;
  79.     int Minfo = 0;
  80.     int azzzzz=0;
  81.     int Kontoless=0;
  82.     int nenennnnnnn=0;
  83.     //----------------------------------------------------------------------------------------------------------------------------------
  84.     #define SMOKE ( Stride == 24 && NumVertices == 256 ||(Stride == 24 && NumVertices == 192))
  85.     #define Dino ((primCount == 57) || (primCount == 161) || (primCount == 186) || (primCount == 197) || (primCount == 349) || (primCount == 495) || (primCount == 955) || (NumVertices == 2517 && primCount == 57) || (NumVertices == 3721 && primCount == 275) || (NumVertices == 0 && primCount == 52) || (NumVertices == 0 && primCount == 105) || (NumVertices ==0 && primCount == 186) || (NumVertices == 0 && primCount == 197) || (primCount == 579) || (primCount == 488))
  86.     #define K400 ((NumVertices == 1002 && primCount == 980))
  87.     #define C5 ((NumVertices == 772 && primCount == 849))
  88.     #define CT ( NumVertices == 490 || NumVertices == 221 || NumVertices == 611|| NumVertices == 102 ||(primCount == 526) || (primCount == 84) || (primCount == 64) || NumVertices == 67 || NumVertices == 92 || NumVertices == 95 || NumVertices == 114 || NumVertices == 504 || NumVertices == 108 || NumVertices == 398 || NumVertices == 520 || NumVertices == 684 || (primCount == 56) || (primCount == 93) )
  89.     #define Badan ((primCount == 16 || primCount == 28 || primCount == 50 || primCount == 52 || primCount == 76 || primCount == 130))
  90.     #define Tero ((NumVertices == 88 && primCount == 130) || (NumVertices == 142 && primCount == 266)|| (NumVertices == 472 && primCount == 304) || (NumVertices == 384 && primCount == 346) || (NumVertices == 348 && primCount == 520) || (NumVertices == 596 && primCount == 590)|| (NumVertices == 628 && primCount == 748) || (NumVertices == 3487 && primCount == 1737)|| (NumVertices == 3487 && primCount == 1766) || (NumVertices == 262 && primCount == 196) || (NumVertices == 142 && primCount == 266) || (NumVertices == 244 && primCount == 406) || (NumVertices == 1846 && primCount == 414) || (NumVertices == 528 && primCount == 540) || (NumVertices == 520 && primCount == 593) || (NumVertices == 2728 && primCount == 1344) || (NumVertices == 1091 && primCount == 1390) || (NumVertices == 1095 && primCount == 1460) || (NumVertices == 1846 && primCount == 2090) || (NumVertices == 2263 && primCount == 45) || (NumVertices == 370 && primCount == 278) || (NumVertices == 482 && primCount == 390) || (NumVertices == 734 && primCount == 688) || (NumVertices == 2263 && primCount == 1023) || (NumVertices == 812 && primCount == 1246) || (NumVertices == 2263 && primCount == 1434) || (NumVertices == 2041 && primCount == 1561) || (NumVertices == 1530 && primCount == 1534) || (NumVertices == 749 && primCount == 1374) || (NumVertices == 1831 && primCount == 1267) || (NumVertices == 2010 && primCount == 426) || (NumVertices == 287 && primCount == 396) || (NumVertices == 1831 && primCount == 341) || (NumVertices == 1831 && primCount == 278) || (NumVertices == 185 && primCount == 254) || (NumVertices == 74 && primCount == 66) || (NumVertices == 56 && primCount == 40) || (NumVertices == 185 && primCount == 271) || (NumVertices == 45 && primCount == 56) || (NumVertices == 92 && primCount == 56) || (NumVertices == 611 && primCount == 114) || (NumVertices == 611 && primCount == 526) || (NumVertices == 18 && primCount == 12) || (NumVertices == 96 && primCount == 92) || (NumVertices == 99 && primCount == 61) || (NumVertices == 133 && primCount == 205)|| (NumVertices == 245 && primCount == 276) || (NumVertices == 398 && primCount == 487) || (NumVertices == 26 && primCount == 20) || (NumVertices == 1204 && primCount == 241) || (NumVertices == 80 && primCount == 52) || (NumVertices == 1204 && primCount == 124) || (NumVertices == 113 && primCount == 139) || (NumVertices == 1204 && primCount == 56) || (NumVertices == 684 && primCount == 740) || (NumVertices == 1204 && primCount == 42) || (NumVertices == 45 && primCount == 56) || (NumVertices == 1204 && primCount == 35) || (NumVertices == 334 && primCount == 360) || (NumVertices == 175 && primCount == 246) || (NumVertices == 195 && primCount == 109) || (NumVertices == 71 && primCount == 120) || (NumVertices == 88 && primCount == 130) || (NumVertices == 201 && primCount == 157) || (NumVertices == 224 && primCount == 200) || (NumVertices == 296 && primCount == 166) || (NumVertices == 1353 && primCount == 386) || (NumVertices == 18 && primCount == 20) || (NumVertices == 41 && primCount == 30) || (NumVertices == 62 && primCount == 67) || (NumVertices == 152 && primCount == 168) || (NumVertices == 202 && primCount == 174) || (NumVertices == 237 && primCount == 395) || (NumVertices == 647 && primCount == 716) || (NumVertices == 727 && primCount == 936) || (NumVertices == 90 && primCount == 136) || (NumVertices == 120 && primCount == 170) || (NumVertices == 142 && primCount == 128) || (NumVertices == 218 && primCount == 322) || (NumVertices == 285 && primCount == 94) || (NumVertices == 1316 && primCount == 1574) || (NumVertices == 1316 && primCount == 134) || (NumVertices == 56 && primCount == 158) || (NumVertices == 73 && primCount == 112) || (NumVertices == 143 && primCount == 94) || (NumVertices == 246 && primCount == 120) || (NumVertices == 353 && primCount == 464) || (NumVertices == 381 && primCount == 234) || (NumVertices == 547 && primCount == 700) || (NumVertices == 1353 && primCount == 1404))
  91.     //----------------------------------------------------------------------------------------------------------------------------------
  92.     char *pProcessWindowTitle = "Point Blank";
  93.     char *pProcessWindowClass = "I3VIEWER";
  94.     //----------------------------------------------------------------------------------------------------------------------------------
  95.     #define PI 3.14159265
  96.     ID3DXLine *g_pLine;
  97.     //----------------------------------------------------------------------------------------------------------------------------------
  98.     D3DRECT RectA;
  99.     D3DRECT RectB;
  100.     D3DVIEWPORT9
  101.     Viewport;
  102.     //----------------------------------------------------------------------------------------------------------------------------------
  103.     D3DCOLOR
  104.     HairColor = D3DCOLOR_ARGB(255, 255, 000, 000);
  105.     //----------------------------------------------------------------------------------------------------------------------------------
  106.     DWORD dwProcessID;
  107.     HANDLE hProcess;
  108.     //----------------------------------------------------------------------------------------------------------------------------------
  109.     using namespace std;
  110.     ofstream infile;
  111.     ofstream myfile;
  112.     //----------------------------------------------------------------------------------------------------------------------------------
  113.     #define MENUMAXITEMS 100
  114.     #define MENUFOLDER 1
  115.     #define ANJING 1
  116.     #define MENUTEXT 2
  117.     #define MENUITEM 3
  118.     #define MENUWEWITEM 10
  119.     #define MENUINFO 0
  120.     //----------------------------------------------------------------------------------------------------------------------------------
  121.     int Mpos=0; // current highlighted menuitem
  122.     int Mmax=0; // number of menu items
  123.     int Mxofs =160; // offset for option text
  124.     int Mysize=15; // heigh of a menuline
  125.     int Mvisible=1;
  126.     //----------------------------------------------------------------------------------------------------------------------------------
  127.     extern int Mpos;
  128.     extern int Mmax;
  129.     extern int Mxofs;
  130.     extern int Mysize;
  131.     extern int Mvisible;
  132.     extern char Mtitle[];
  133.     extern char *Moptfolder[];
  134.     extern char *Moptonoff[];
  135.     extern char *optColor1[11];
  136.     extern char *optColor2[11];
  137.     extern char *Secondary[4];
  138.     //----------------------------------------------------------------------------------------------------------------------------------
  139.     void MenuAddItem(char *txt, char **opt, int *var, int maxvalue, int typ);
  140.     void MenuAddText (char *txt, char *opt="");
  141.     void MenuShow(int x, int y, ID3DXFont* g_pFont);
  142.     void MenuNav(void);
  143.     //----------------------------------------------------------------------------------------------------------------------------------
  144.     #define MCOLOR_TITLE D3DCOLOR_ARGB(255, 000, 255, 000)
  145.     #define MCOLOR_CURRENT D3DCOLOR_ARGB(255, 000, 255, 000)
  146.     #define MCOLOR_TEXT D3DCOLOR_ARGB(255, 000, 255, 000)
  147.     #define MCOLOR_ACTIVE D3DCOLOR_ARGB(255, 000, 255, 000)
  148.     #define MENUCOLOR_TITLE D3DCOLOR_ARGB(255, 255, 240, 0)
  149.     #define MCOLOR_FOLDER D3DCOLOR_ARGB(255, 000, 255, 000)
  150.     #define MCOLOR_INACTIVE D3DCOLOR_ARGB(255, 173, 173, 173)
  151.     //----------------------------------------------------------------------------------------------------------------------------------
  152.     bool Generate = true;
  153.     //WARNA-WARNA
  154.     #define MAROON D3DCOLOR_ARGB(255, 142, 30, 0)
  155.     #define LGRAY D3DCOLOR_ARGB(255, 174, 174, 174)
  156.     #define WHITE D3DCOLOR_ARGB(255, 255, 255, 255)
  157.     #define RED D3DCOLOR_ARGB(255, 255, 000, 000)
  158.     #define GREEN D3DCOLOR_ARGB(255, 000, 255, 000)
  159.     #define BLUE D3DCOLOR_ARGB(255, 000, 000, 255)
  160.     #define BLACK D3DCOLOR_ARGB(150, 000, 000, 000)
  161.     #define mBLACK D3DCOLOR_ARGB(100, 000, 000, 205)
  162.     #define PURPLE D3DCOLOR_ARGB(255, 125, 000, 255)
  163.     #define GREY D3DCOLOR_ARGB(255, 128, 128, 128)
  164.     #define YELLOW D3DCOLOR_ARGB(255, 255, 255, 000)
  165.     #define ORANGE D3DCOLOR_ARGB(255, 255, 125, 000)
  166.     #define PINK D3DCOLOR_ARGB(255, 255, 050, 250)
  167.     #define CYAN D3DCOLOR_ARGB(255, 000, 255, 255)
  168.     #define WHITE2 D3DCOLOR_ARGB(100, 255, 255, 255)
  169.     #define RED2 D3DCOLOR_ARGB(100, 255, 000, 000)
  170.     #define GREEN2 D3DCOLOR_ARGB(100, 000, 255, 000)
  171.     #define BLUE2 D3DCOLOR_ARGB(100, 000, 000, 255)
  172.     #define BLACK2 D3DCOLOR_ARGB(100, 000, 000, 000)
  173.     #define PURPLE2 D3DCOLOR_ARGB(100, 125, 000, 255)
  174.     #define GREY2 D3DCOLOR_ARGB(100, 128, 128, 128)
  175.     #define YELLOW2 D3DCOLOR_ARGB(100, 255, 255, 000)
  176.     #define ORANGE2 D3DCOLOR_ARGB(100, 255, 125, 000)
  177.     #define PINK2 D3DCOLOR_ARGB(100, 255, 050, 250)
  178.     #define CYAN2 D3DCOLOR_ARGB(100, 000, 255, 255)
  179.     #define Biru D3DCOLOR_ARGB( 250, 25, 220, 251)
  180.     #define Biru D3DCOLOR_ARGB( 250, 25, 220, 251)
  181.     LPDIRECT3DTEXTURE9 White,Red,Green,Blue,Black,Purple,Grey,Yellow,Orange,Pink,Cyan;
  182.     //----------------------------------------------------------------------------------------------------------------------------------
  183.     LPDIRECT3DVERTEXBUFFER9 Stream_Data;
  184.     UINT Offset = 0;
  185.     UINT Stride = 0;
  186.     UINT texnum = 0;
  187.     //----------------------------------------------------------------------------------------------------------------------------------
  188.     RECT rect;
  189.     RECT rect2;
  190.     RECT rect3;
  191.     //----------------------------------------------------------------------------------------------------------------------------------
  192.     struct{
  193.     int *var;
  194.     int maxvalue;
  195.     int typ;
  196.     char *txt;
  197.     char **opt;
  198.     }
  199.     //----------------------------------------------------------------------------------------------------------------------------------
  200.     MENU[MENUMAXITEMS];
  201.     //----------------------------------------------------------------------------------------------------------------------------------
  202.     void MenuAddItem(char *txt, char **opt, int *var, int maxvalue, int typ){
  203.     MENU[Mmax].typ=typ;
  204.     MENU[Mmax].txt=txt;
  205.     MENU[Mmax].opt=opt;
  206.     MENU[Mmax].var=var;
  207.     MENU[Mmax].maxvalue=maxvalue;
  208.     Mmax++;
  209.     }
  210.  
  211.     void MenuAddText(char *txt, char *opt){
  212.     MENU[Mmax].typ=MENUTEXT;
  213.     MENU[Mmax].txt=txt;
  214.     MENU[Mmax].opt=(char **)opt;
  215.     MENU[Mmax].var=0;
  216.     MENU[Mmax].maxvalue=0;
  217.     Mmax++;
  218.     }
  219.     VOID __stdcall CMenuItem_DrawCronersBox(INT xx,INT yy,INT hh,INT ww,LPDIRECT3DDEVICE9 pDevice)
  220.     {
  221.     D3DRECT rec;
  222.     FLOAT x,y,w,h;
  223.  
  224.     struct vertex
  225.     {
  226.     FLOAT x,y,z,t;
  227.     DWORD Color;
  228.     };
  229.  
  230.     vertex V[8];
  231.  
  232.     x = (float)xx; y = (float)yy; h = (float)hh; w = (float)ww;
  233.  
  234.     V[0].Color = V[1].Color = V[2].Color = V[3].Color = D3DCOLOR_ARGB( 000, 00, 00, 00 );
  235.     V[4].Color = V[5].Color = V[6].Color = V[7].Color = D3DCOLOR_ARGB( 000, 00, 00, 00 );
  236.  
  237.     V[0].z = V[1].z = V[2].z = V[3].z = 0;
  238.     V[4].z = V[5].z = V[6].z = V[7].z = 0;
  239.     V[0].t = V[1].t = V[2].t = V[3].t = 0;
  240.     V[4].t = V[5].t = V[6].t = V[7].t = 0;
  241.  
  242.     V[0].x = V[1].x = x;
  243.     V[0].y = V[2].y = y + h;
  244.     V[1].y = V[3].y = y;
  245.     V[2].x = V[3].x = x + w;
  246.     V[4].x = V[5].x = x;
  247.     V[4].y = V[6].y = y + h;
  248.     V[5].y = V[7].y = y;
  249.     V[6].x = V[7].x = x + w;
  250.  
  251.     pDevice->SetTexture(0, NULL);
  252.     pDevice->SetPixelShader( NULL );
  253.     pDevice->SetRenderState(D3DRS_CLIPPING,FALSE);
  254.     pDevice->SetFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1);
  255.     pDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP,2,V,sizeof(vertex));
  256.  
  257.     rec.x1 = xx;rec.y1 = yy;rec.x2 = xx+ww;rec.y2 = yy+1;
  258.     //pDevice->Clear(1,&rec,D3DCLEAR_TARGET,D3DCOLOR_ARGB(255, 255, 255, 000),0,0);
  259.     rec.x1 = xx;rec.y1 = hh+yy;rec.x2 = xx+ww;rec.y2 = hh+yy+1;
  260.     //pDevice->Clear(1,&rec,D3DCLEAR_TARGET,D3DCOLOR_ARGB(255, 255, 255, 000),0,0);
  261.     rec.x1 = xx;rec.y1 = yy;rec.x2 = xx+1;rec.y2 = yy+hh;
  262.     //pDevice->Clear(1,&rec,D3DCLEAR_TARGET,D3DCOLOR_ARGB(255, 255, 255, 000),0,0);
  263.     rec.x1 = xx+ww;rec.y1 = yy;rec.x2 = xx+ww+1;rec.y2 = yy+hh;
  264.     //pDevice->Clear(1,&rec,D3DCLEAR_TARGET,D3DCOLOR_ARGB(255, 255, 255, 000),0,0);
  265.  
  266.     return;
  267.     }
  268.     //----------------------------------------------------------------------------------------------------------------------------------
  269.     void MenuShow(int x, int y, ID3DXFont *pFont){
  270.     int i, val;
  271.     DWORD color;
  272.     SetRect( &rect, x+Mxofs/3, y, x+Mxofs /2 , y );
  273.     if (!Mvisible) return;
  274.  
  275.     if (Mtitle[0]) {
  276.  
  277.     pFont->DrawText(NULL,Mtitle,-1,&rect,DT_NOCLIP | DT_TOP, MCOLOR_CURRENT);
  278.  
  279.     y+=Mysize;
  280.     }
  281.  
  282.     for (i=0; i<Mmax; i++) {
  283.  
  284.     val=(MENU[i].var)?(*MENU[i].var):0;
  285.  
  286.     if (i==Mpos){
  287.     color=BLUE;
  288.     CMenuItem_DrawCronersBox((INT)x - 0,(INT)y - 1,15,198, npDevice);
  289.     }
  290.     else if (MENU[i].typ==MENUFOLDER)
  291.     color=MCOLOR_FOLDER;
  292.     else if (MENU[i].typ==ANJING)
  293.     color=MCOLOR_INACTIVE;
  294.     else if (MENU[i].typ==MENUTEXT)
  295.     color=MCOLOR_TEXT;
  296.     else
  297.     color=(val)?YELLOW:WHITE;
  298.     SetRect( &rect3, x, y, x , y );
  299.     SetRect( &rect2, x+Mxofs, y, x+Mxofs , y );
  300.     pFont->DrawText(NULL,MENU[i].txt,-1,&rect3, DT_NOCLIP,color);
  301.     if (MENU[i].opt) {
  302.     if (MENU[i].typ==MENUTEXT)
  303.     pFont->DrawText(NULL,(char *)MENU[i].opt,-1,&rect2, DT_NOCLIP | DT_RIGHT, color);
  304.     else
  305.     pFont->DrawText(NULL,(char *)MENU[i].opt[val],-1,&rect2, DT_NOCLIP | DT_LEFT, color);
  306.     }
  307.     y+=Mysize;
  308.     }
  309.     }
  310.     //------------------------------------------------------------------------------//
  311.     void MenuNav(void){
  312.     //------------------------------------------------------------------------------//
  313.     if (GetAsyncKeyState(VK_INSERT)&1) Mvisible=(!Mvisible);
  314.     if (!Mvisible) return;
  315.     //------------------------------------------------------------------------------//
  316.     if (GetAsyncKeyState(VK_UP)&1) {
  317.     do {
  318.     Mpos--;
  319.     if (Mpos<0) Mpos=Mmax-1;
  320.     } while (MENU[Mpos].typ==MENUTEXT);
  321.     //------------------------------------------------------------------------------//
  322.     } else if (GetAsyncKeyState(VK_DOWN)&1) {
  323.     do {
  324.     Mpos++;
  325.     if (Mpos==Mmax) Mpos=0;
  326.     } while (MENU[Mpos].typ==MENUTEXT);
  327.     } else if (MENU[Mpos].var) {
  328.     int dir=0;
  329.     //------------------------------------------------------------------------------//
  330.     if (GetAsyncKeyState(VK_LEFT )&1 && *MENU[Mpos].var > 0 ) dir=-1;
  331.     //------------------------------------------------------------------------------//
  332.     if (GetAsyncKeyState(VK_RIGHT)&1 && *MENU[Mpos].var < (MENU[Mpos].maxvalue-1)) dir=1;
  333.     if (dir) {
  334.     *MENU[Mpos].var += dir;
  335.     if (MENU[Mpos].typ==MENUFOLDER) Mmax=0;
  336.     }
  337.     }
  338.     }
  339.     //----------------------------------------------------------------------------------------------------------------------------------
  340.     void Anjing()
  341.     {
  342.     bool isFindWindow = true;
  343.     HWND hWnd = NULL;
  344.  
  345.     while(isFindWindow)
  346.     {
  347.     if((hWnd = FindWindowA(pProcessWindowClass, pProcessWindowTitle)) != NULL) // jika window ditemukan
  348.     {
  349.     isFindWindow = false;
  350.     }
  351.     Sleep(500);
  352.     }
  353.  
  354.     GetWindowThreadProcessId(hWnd, &dwProcessID);
  355.     hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, dwProcessID);
  356.     }
  357.     //----------------------------------------------------------------------------------------------------------------------------------
  358.     #define Detour_Type_0xE9 1
  359.     #define Detour_Type_0xB8 2
  360.     #define Detour_Type_0x68 3
  361.     DWORD CreateDetour(DWORD dwThread,DWORD dwAdress,DWORD dwType,DWORD dwSize)
  362.     {
  363.     DWORD dwDetour,dwProtect,i;
  364.     if (dwAdress&&dwThread&&dwSize>= dwSize)
  365.     {
  366.     dwDetour = (DWORD)VirtualAlloc(0,dwSize+dwSize,0x1000,0x40);
  367.     if (dwDetour&&VirtualProtect((VOID*)dwAdress,dwSize,0x40,&dwProtect))
  368.     {
  369.     for (i=0;i<dwSize;i++)
  370.     {
  371.     *(BYTE*)(dwDetour+i)=*(BYTE*)(dwAdress+i);
  372.     }
  373.     switch (dwType)
  374.     {
  375.     case Detour_Type_0xE9:
  376.     {
  377.     *(BYTE*)(dwDetour+dwSize+0)=0xE9;
  378.     *(DWORD*)(dwDetour+dwSize+1)=(dwAdress-dwDetour-dwSize);
  379.     *(BYTE*)(dwAdress+0)=0xE9;
  380.     *(DWORD*)(dwAdress+1)=(dwThread-dwAdress-dwSize);
  381.     }
  382.     break;
  383.     case Detour_Type_0xB8:
  384.     {
  385.     *(BYTE*)(dwDetour+dwSize+0)=0xB8;
  386.     *(DWORD*)(dwDetour+dwSize+1)=(dwAdress+dwSize);
  387.     *(WORD*)(dwDetour+dwSize+5)=0xE0FF;
  388.     *(BYTE*)(dwAdress+0)=0xB8;
  389.     *(DWORD*)(dwAdress+1)=(dwThread);
  390.     *(WORD*)(dwAdress+5)=0xE0FF;
  391.     }
  392.     break;
  393.     case Detour_Type_0x68:
  394.     {
  395.     *(BYTE*)(dwDetour+dwSize+0)=0x68;
  396.     *(DWORD*)(dwDetour+dwSize+1)=(dwAdress+dwSize);
  397.     *(WORD*)(dwDetour+dwSize+5)=0xC3;
  398.     *(BYTE*)(dwAdress+0)=0x68;
  399.     *(DWORD*)(dwAdress+1)=(dwThread);
  400.     *(WORD*)(dwAdress+5)=0xC3;
  401.     }
  402.     break;
  403.     }
  404.     VirtualProtect((VOID*)dwAdress,dwSize,dwProtect,&dwProtect);
  405.     VirtualProtect((VOID*)dwDetour,dwSize+dwSize,0x20,&dwProtect);
  406.     return dwDetour;
  407.     }
  408.     }
  409.     Sleep(10);
  410.     return (0);
  411.     }
  412.     //----------------------------------------------------------------------------------------------------------------------------------
  413.     typedef HRESULT (WINAPI* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
  414.     tEndScene oEndScene = NULL;
  415.     //----------------------------------------------------------------------------------------------------------------------------------
  416.     typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
  417.     tDrawIndexedPrimitive oDrawIndexedPrimitive = NULL;
  418.     //----------------------------------------------------------------------------------------------------------------------------------
  419.     typedef HRESULT(WINAPI* tReset)(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters);
  420.     tReset oReset = NULL;
  421.     //----------------------------------------------------------------------------------------------------------------------------------
  422.     void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
  423.     {
  424.     RECT FontRect = { x, y, x+500, y+30 };
  425.     font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
  426.     }
  427.     //----------------------------------------------------------------------------------------------------------------------------------
  428.     void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
  429.     {
  430.     D3DRECT rec = { x, y, x + w, y + h };
  431.     pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
  432.     }
  433.     //----------------------------------------------------------------------------------------------------------------------------------
  434.     void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
  435.     {
  436.  
  437.     D3DXVECTOR2 Line[128];
  438.     float Step = PI * 2.0 / numSides;
  439.     int Count = 0;
  440.     for (float a=0; a < PI*2.0; a += Step)
  441.     {
  442.     float X1 = radius * cos(a) + X;
  443.     float Y1 = radius * sin(a) + Y;
  444.     float X2 = radius * cos(a+Step) + X;
  445.     float Y2 = radius * sin(a+Step) + Y;
  446.     Line[Count].x = X1;
  447.     Line[Count].y = Y1;
  448.     Line[Count+1].x = X2;
  449.     Line[Count+1].y = Y2;
  450.     Count += 2;
  451.     }
  452.     g_pLine->Begin();
  453.     g_pLine->Draw(Line,Count,Color);
  454.     g_pLine->End();
  455.     }
  456.     //----------------------------------------------------------------------------------------------------------------------------------
  457.     char Megaze1(void* address, int* val, char bytes)
  458.     {
  459.     DWORD Comander, Rezpect;
  460.     VirtualProtect(address, bytes, PAGE_EXECUTE_WRITECOPY, &Comander);
  461.     memcpy(address, val, bytes);
  462.     VirtualProtect(address,bytes,Comander,&Rezpect);
  463.     return(0);
  464.     }
  465.  
  466.     //----------------------------------------------------------------------------------------------------------------------------------
  467.     char Mtitle [] = "";
  468.     char *Moptfolder [] = {"Open", "Close"};
  469.     char *Moptonoff [] = {"Off", "On"};
  470.     char *optColor1 [11] = {"Off","Red","Blue","Green","Yellow","Pink","White","Black","Orange","Cyan","Purple"};
  471.     char *optColor2 [11] = {"Off","Red","Blue","Green","Yellow","Pink","White","Black","Orange","Cyan","Purple"};
  472.     char *Secondary [4] ={"Off","Immi Uzzi","Glock 18","R.B 454 SS8M+S"};
  473.     char *Mele [4] ={"Off","Fang Blade","Combat Machete","Mini Axe"};
  474.     //----------------------------------------------------------------------------------------------------------------------------------
  475.     void RebuildMenu(void)
  476.     {
  477.     //MenuAddText(" Alexxxxx~Menu");
  478.     MenuAddText(" RezaBeye77~D3D");
  479.     MenuAddText(" RezaBeye77~D3D ");
  480.     MenuAddText(" RezaBeye77~D3D");
  481.     MenuAddItem("Wallhack Chams" , Moptfolder , &memek , 2 , MENUFOLDER);
  482.     if (memek)
  483.     {
  484.     MenuAddItem("CT & Tero",optColor1, &Hack2,11,MENUITEM); //Hack2_a
  485.     }
  486.     {
  487.     MenuAddItem("Wallhack Weapon" , Moptfolder , &kontolllllllll , 2 , MENUFOLDER);
  488.     if (kontolllllllll)
  489.     {
  490.     MenuAddItem("Weapon",optColor2, &Hack12, 11, MENUITEM);
  491.     }
  492.     MenuAddItem("Wallhack Other" , Moptfolder , &nenennnnnnn , 2 , MENUFOLDER);
  493.     if (nenennnnnnn)
  494.     {
  495.     MenuAddItem("Clean",Moptonoff, &Hack1, 2, MENUITEM);
  496.     MenuAddItem("Asus",Moptonoff, &Hack6, 2, MENUITEM);
  497.     MenuAddItem("FullDot",Moptonoff, &Hack14, 2, MENUITEM); //Wireframe
  498.     MenuAddItem("Wireframe",Moptonoff, &Kontoless, 3, MENUITEM);
  499.     MenuAddItem("No Smoke",Moptonoff, &Hack9, 2, MENUITEM);
  500.     MenuAddItem("No Fog",Moptonoff, &Hack10, 2, MENUITEM);
  501.     MenuAddItem("Crosshair",Moptonoff, &Hack11, 2, MENUWEWITEM);
  502.     // MenuAddText(" Note:" ,*optinfo1);
  503.     }}
  504.     MenuAddItem("Player Hack " , Moptfolder , &fullhack , 2 , MENUFOLDER);
  505.     if (fullhack)
  506.     {
  507.     MenuAddItem("Anti Program Ilegal" , Moptonoff, &azzzzz, 2, MENUITEM);
  508.     MenuAddItem("Auto HS" , Moptonoff, &CH_Hetsotttttttttttttt, 2, MENUITEM);
  509.     MenuAddItem("Damage UP + " , Moptonoff, &CH_Damagetod, 2, MENUITEM);
  510.     MenuAddItem("Invisible Time" , Moptonoff, &CH_INVI, 2, MENUITEM);
  511.     MenuAddItem("Pasang Defuse" ,Moptonoff, &CH_Defusepasang, 2, MENUITEM);
  512.     MenuAddItem("Enemy Kick" , Moptonoff, &CH_Kick, 2, MENUITEM);
  513.     }
  514.     MenuAddItem("Replace Weapon" , Moptfolder , &Replaceeeeeeeeeeeeeeeee , 2 , MENUFOLDER);
  515.     if (Replaceeeeeeeeeeeeeeeee)
  516.     {
  517.     MenuAddItem("Secondary" , Secondary, &CH_Secondary, 4, MENUITEM);
  518.     MenuAddItem("Mele" , Mele, &CH_Mele, 4, MENUITEM);
  519.     }
  520.     }
  521.     //----------------------------------------------------------------------------------------------------------------------------------
  522.  
  523.     PBYTE HookVTableFunction( PDWORD* dwVTable, PBYTE dwHook, INT Index )
  524.     {
  525.     DWORD dwOld = 0;
  526.     VirtualProtect((void*)((*dwVTable) + (Index) ), 0, PAGE_EXECUTE_READWRITE, &dwOld);
  527.  
  528.     PBYTE pOrig = ((PBYTE)(*dwVTable)[Index]);
  529.     (*dwVTable)[Index] = (DWORD)dwHook;
  530.  
  531.     VirtualProtect((void*)((*dwVTable) + (Index)), 0, dwOld, &dwOld);
  532.  
  533.     return pOrig;
  534.     }
  535.     //----------------------------------------------------------------------------------------------------------------------------------
  536.     HRESULT RaffiTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
  537.     {
  538.     if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
  539.     return E_FAIL;
  540.  
  541.     WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
  542.     |(WORD)(((colour32>>20)&0xF)<<8)
  543.     |(WORD)(((colour32>>12)&0xF)<<4)
  544.     |(WORD)(((colour32>>4)&0xF)<<0);
  545.  
  546.  
  547.     D3DLOCKED_RECT d3dlr;
  548.     (*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
  549.     WORD *pDst16 = (WORD*)d3dlr.pBits;
  550.  
  551.     for(int xy=0; xy < 8*8; xy++)
  552.     *pDst16++ = colour16;
  553.  
  554.     (*ppD3Dtex)->UnlockRect(0);
  555.  
  556.     return S_OK;
  557.     }
  558.     //----------------------------------------------------------------------------------------------------------------------------------
  559.     PBYTE ProtectHook( PDWORD* dwVTable, PBYTE dwHook, INT Index )
  560.     {
  561.     DWORD d = 0;
  562.     DWORD ds = 0;
  563.     VirtualProtect((PVOID*)((*dwVTable) + (Index*4)), 4, PAGE_EXECUTE_READWRITE, &d);
  564.     Sleep(-0);
  565.     PBYTE pOrig = ((PBYTE)(*dwVTable)[Index]);
  566.     (*dwVTable)[Index] = (DWORD)dwHook;
  567.     memcpy(pOrig, dwVTable, ds);
  568.     Sleep(-0);
  569.     VirtualProtect((PVOID*)((*dwVTable) + (Index*4)), 4, d, &ds);
  570.     Sleep(-0);
  571.     VirtualProtect((void*)(dwVTable), 4, PAGE_EXECUTE_READWRITE, &d);
  572.     memcpy(pOrig,(void*)(pOrig), 4);
  573.     VirtualProtect((void*)(dwHook), 4, d, &ds);
  574.     return pOrig;
  575.     }
  576.     //----------------------------------------------------------------------------------------------------------------------------------
  577.     #pragma warning(disable:4700)
  578.     HMODULE dwD3D9 = GetModuleHandle("d3d9.dll");
  579.     DWORD BaseD3D= NULL;
  580.     //----------------------------------------------------------------------------------------------------------------------------------
  581.     void DrawString(int x, int y, DWORD color, const char *fmt, ...)
  582.     {
  583.     RECT FontPos = { x, y, x + 30, y + 20 };
  584.     char buf[1024] = {'\0'};
  585.     va_list va_alist;
  586.  
  587.     va_start(va_alist, fmt);
  588.     vsprintf(buf, fmt, va_alist);
  589.     va_end(va_alist);
  590.  
  591.     g_pFont2->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
  592.     }
  593.     //----------------------------------------------------------------------------------------------------------------------------------
  594.     void Jam(int x,int y,D3DCOLOR color)
  595.     {
  596.     static float TimeElapsed = 0;
  597.     static char FinalString[MAX_PATH];
  598.     static time_t TimeValue;
  599.     static tm* timeinfo;
  600.  
  601.     RECT FontPos = { x, y, x + 200, y + 16 };
  602.  
  603.     time ( &TimeValue );
  604.     timeinfo = localtime ( &TimeValue );
  605.     if(timeinfo->tm_hour>12)
  606.     sprintf(FinalString, " [Time : %d:%02d:%02d PM] ",timeinfo->tm_hour - 12,timeinfo->tm_min,timeinfo->tm_sec);
  607.     else
  608.     sprintf(FinalString, " [Time : %d:%02d:%02d AM] ",timeinfo->tm_hour, timeinfo->tm_min,timeinfo->tm_sec);
  609.     g_pFont->DrawTextA(NULL, FinalString, -1, &FontPos, DT_NOCLIP, color);
  610.     }
  611.     //----------------------------------------------------------------------------------------------------------------------------------
  612.     void Tanggal(int x,int y,D3DCOLOR color)
  613.     {
  614.     static char cdate[20] = "" ;
  615.     struct tm * current_tm;
  616.  
  617.     RECT FontPos = { x, y, x + 200, y + 16 };
  618.  
  619.     time_t current_time;
  620.     time (&current_time);
  621.     current_tm = localtime (&current_time);
  622.     sprintf( cdate, " [Date : %d-%d-%02d] ",current_tm->tm_mon+1,current_tm->tm_mday,current_tm->tm_year-100+2000);
  623.     g_pFont->DrawTextA(NULL, cdate, -1, &FontPos, DT_NOCLIP, color);
  624.     }
  625.     //----------------------------------------------------------------------------------------------------------------------------------
  626.     void DrawBox(LPDIRECT3DDEVICE9 pDevice, int x, int y, int w, int h, D3DCOLOR Color)
  627.     {
  628.     struct Vertex
  629.     {
  630.     float x,y,z,ht;
  631.     DWORD Color;
  632.     }
  633.  
  634.     V[4] =
  635.     {
  636.     {(float)x,(float)(y+h), 0.0f, 0.0f, Color},
  637.     {(float)x,(float)y, 0.0f, 0.0f, Color},
  638.     {(float)(x+w),(float)(y+h), 0.0f, 0.0f, Color},
  639.     {(float)(x+w),(float)y, 0.0f, 0.0f, Color}
  640.     };
  641.  
  642.     pDevice->SetTexture(0, NULL);
  643.     pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
  644.     pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
  645.     pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,V,sizeof(Vertex));
  646.     }
  647.  
  648.     void DrawBorder(LPDIRECT3DDEVICE9 device, int x, int y, int w, int h, int s, DWORD Color)
  649.     {
  650.     DrawBox(device, x, y-1, w, s, Color );
  651.     DrawBox(device, x-1, y, s, h, Color );
  652.     DrawBox(device, (x+w), y, s, h, Color );
  653.     DrawBox(device, x, (y+h), w, s, Color );
  654.     }
  655.     void DrawSprite(LPDIRECT3DDEVICE9 pDevice)
  656.     {
  657.  
  658.     pHeader.x=10.0f; pHeader.y=-1.0f; pHeader.z=0.0f;
  659.  
  660.     if(txHeader == NULL)D3DXCreateTextureFromFileInMemoryEx(pDevice,&_Menu,sizeof(_Menu),240,85,D3DX_DEFAULT,0,D3DFMT_UNKNOWN,D3DPOOL_MANAGED,D3DX_DEFAULT,D3DX_DEFAULT,0,NULL,NULL,&txHeader);
  661.     if(bbSprite == NULL)D3DXCreateSprite(pDevice, &bbSprite);
  662.  
  663.     bbSprite->Begin(D3DXSPRITE_ALPHABLEND);
  664.     bbSprite->Draw(txHeader, 0, 0, &pHeader, 0xFFFFFFFF);
  665.     bbSprite->End();
  666.     }
  667.  
  668.     HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
  669.     {
  670.     myfile << "EndScene Telah di Hook\n";
  671.     __asm PUSHAD;
  672.     while(!npDevice) {
  673.     npDevice = pDevice;
  674.     }
  675.     //----------------------------------------------------------------------------------------------------------------------------------
  676.     if(bbSprite == NULL)D3DXCreateSprite(pDevice, &bbSprite);
  677.  
  678.  
  679.     if (Generate)
  680.     {
  681.     RaffiTexture(pDevice, &Blooderz , D3DCOLOR_ARGB(255,255,255,0));
  682.     RaffiTexture(pDevice, &TujuhX , D3DCOLOR_ARGB(255,255,192,203));
  683.     RaffiTexture(pDevice, &White, WHITE2);
  684.     RaffiTexture(pDevice, &Red, RED2);
  685.     RaffiTexture(pDevice, &Green, GREEN2);
  686.     RaffiTexture(pDevice, &Blue, BLUE2);
  687.     RaffiTexture(pDevice, &Black, BLACK2);
  688.     RaffiTexture(pDevice, &Purple, PURPLE2);
  689.     RaffiTexture(pDevice, &Grey, GREY2);
  690.     RaffiTexture(pDevice, &Yellow, YELLOW2);
  691.     RaffiTexture(pDevice, &Orange, ORANGE2);
  692.     RaffiTexture(pDevice, &Pink, PINK2);
  693.     RaffiTexture(pDevice, &Cyan, CYAN2);
  694.     Generate = false;
  695.     }
  696.  
  697.     D3DVIEWPORT9 viewP;
  698.     pDevice->GetViewport( &viewP );
  699.     DWORD ScreenCenterX = viewP.Width / 2;
  700.     DWORD ScreenCenterY = viewP.Height / 2;
  701.  
  702.     if ( Hack11 == 1 ){
  703.  
  704.  
  705.     D3DRECT rec6 = {ScreenCenterX-18, ScreenCenterY, ScreenCenterX+ 18, ScreenCenterY+1};
  706.     D3DRECT rec7 = {ScreenCenterX, ScreenCenterY-18, ScreenCenterX+ 1,ScreenCenterY+18};
  707.     pDevice->Clear(1, &rec6, D3DCLEAR_TARGET,BLUE, 0, 0);
  708.     pDevice->Clear(1, &rec7, D3DCLEAR_TARGET,BLUE, 0, 0);
  709.     D3DRECT rec8 = {ScreenCenterX-15, ScreenCenterY, ScreenCenterX+ 15, ScreenCenterY+1};
  710.     D3DRECT rec9 = {ScreenCenterX, ScreenCenterY-15, ScreenCenterX+ 1,ScreenCenterY+15};
  711.     pDevice->Clear(1, &rec8, D3DCLEAR_TARGET,LGRAY, 0, 0);
  712.     pDevice->Clear(1, &rec9, D3DCLEAR_TARGET,LGRAY, 0, 0);
  713.     D3DRECT rec10 = {ScreenCenterX-12, ScreenCenterY, ScreenCenterX+ 12, ScreenCenterY+1};
  714.     D3DRECT rec11 = {ScreenCenterX, ScreenCenterY-12, ScreenCenterX+ 1,ScreenCenterY+12};
  715.     pDevice->Clear(1, &rec10, D3DCLEAR_TARGET,GREEN, 0, 0);
  716.     pDevice->Clear(1, &rec11, D3DCLEAR_TARGET,GREEN, 0, 0);
  717.     D3DRECT rec12 = {ScreenCenterX-9, ScreenCenterY, ScreenCenterX+ 9, ScreenCenterY+1};
  718.     D3DRECT rec13 = {ScreenCenterX, ScreenCenterY-9, ScreenCenterX+ 1,ScreenCenterY+9};
  719.     pDevice->Clear(1, &rec12, D3DCLEAR_TARGET,YELLOW, 0, 0);
  720.     pDevice->Clear(1, &rec13, D3DCLEAR_TARGET,YELLOW, 0, 0);
  721.     D3DRECT rec14 = {ScreenCenterX-6, ScreenCenterY, ScreenCenterX+ 6, ScreenCenterY+1};
  722.     D3DRECT rec15 = {ScreenCenterX, ScreenCenterY-6, ScreenCenterX+ 1,ScreenCenterY+6};
  723.     pDevice->Clear(1, &rec14, D3DCLEAR_TARGET,ORANGE, 0, 0);
  724.     pDevice->Clear(1, &rec15, D3DCLEAR_TARGET,ORANGE, 0, 0);
  725.     D3DRECT rec16 = {ScreenCenterX-3, ScreenCenterY, ScreenCenterX+ 3, ScreenCenterY+1};
  726.     D3DRECT rec17 = {ScreenCenterX, ScreenCenterY-3, ScreenCenterX+ 1,ScreenCenterY+3};
  727.     pDevice->Clear(1, &rec16, D3DCLEAR_TARGET,RED, 0, 0);
  728.     pDevice->Clear(1, &rec17, D3DCLEAR_TARGET,RED, 0, 0);
  729.  
  730.     }
  731.     //----------------------------------------------------------------------------------------------------------------------------------
  732.     if(g_pFont == NULL) D3DXCreateFont(pDevice, 20, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Comic Sans MS", &g_pFont); //Create fonts
  733.     if(g_pFont2 == NULL) D3DXCreateFont(pDevice, 20, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Comic Sans MS", &g_pFont2); //Create fonts
  734.     if(g_pLine == NULL) D3DXCreateLine(pDevice, &g_pLine);
  735.  
  736.     pDevice->GetViewport(&g_ViewPort);
  737.     pDevice->GetViewport(&g_ViewPort);
  738.  
  739.     DrawString(419, 1, GREEN, "+==|| ** STAR * CHILD ** ||==+");
  740.     Tanggal(-1,1,0xFF00FF00);//x,y
  741.     Jam(200,1,0xFF00FF00);//x,y
  742.     DrawSprite(pDevice);
  743.     if(uyeh == 0)
  744.     {
  745.  
  746.     if (Mmax==0)
  747.     RebuildMenu();
  748.     MenuShow(50,65,g_pFont); //y,x
  749.     MenuNav();
  750.  
  751.     }
  752.     __asm POPAD;
  753.     return oEndScene(pDevice);
  754.     }
  755.     //------------------------------------------------------------------------------------------------------------------------------------
  756.     HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
  757.     {
  758.     myfile << "DIP is hooked\n";
  759.     if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
  760.     Stream_Data->Release();
  761.     //----------------------------------------------------------------------------------------------------------------------------------
  762.     if ( Hack1 == 1 ) // WALLHACK
  763.     {
  764.     if((Tero || CT || Dino || Badan || C5 || CT)){
  765.  
  766.     pDevice->SetRenderState( D3DRS_LIGHTING, false);
  767.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  768.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  769.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  770.     }
  771.     else{
  772.     pDevice->SetRenderState(D3DRS_AMBIENT, false);
  773.     }
  774.     }
  775.  
  776.     if ( Hack2 == 1 ) // WALL MINI INDO
  777.     {
  778.     if((Tero || CT || Dino || Badan || C5 || CT))
  779.     {
  780.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  781.     pDevice->SetTexture(0, Red);
  782.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  783.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  784.     pDevice->SetTexture(0, Red);
  785.     }
  786.     }
  787.     if ( Hack2 == 2 ) // WALL MINI INDO
  788.     {
  789.     if((Tero || CT || Dino || Badan || C5 || CT))
  790.     {
  791.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  792.     pDevice->SetTexture(0, Blue);
  793.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  794.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  795.     pDevice->SetTexture(0, Blue);
  796.     }
  797.     }
  798.     if ( Hack2 ==3 ) // WALL MINI INDO
  799.     {
  800.     if((Tero || CT || Dino || Badan || C5 || CT))
  801.     {
  802.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  803.     pDevice->SetTexture(0, Green);
  804.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  805.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  806.     pDevice->SetTexture(0, Green);
  807.     }
  808.     }
  809.     if ( Hack2 ==4 ) // WALL MINI INDO
  810.     {
  811.     if((Tero || CT || Dino || Badan || C5 || CT))
  812.     {
  813.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  814.     pDevice->SetTexture(0, Yellow);
  815.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  816.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  817.     pDevice->SetTexture(0, Yellow);
  818.     }
  819.     }
  820.     if ( Hack2 == 5 ) // WALL MINI INDO
  821.     {
  822.     if((Tero || CT || Dino || Badan || C5 || CT))
  823.     {
  824.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  825.     pDevice->SetTexture(0, Pink);
  826.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  827.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  828.     pDevice->SetTexture(0, Pink);
  829.     }
  830.     }
  831.     if ( Hack2 == 6 ) // WALL MINI INDO
  832.     {
  833.     if((Tero || CT || Dino || Badan || C5 || CT))
  834.     {
  835.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  836.     pDevice->SetTexture(0, White);
  837.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  838.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  839.     pDevice->SetTexture(0, White);
  840.     }
  841.     }
  842.     if ( Hack2 == 7 ) // WALL MINI INDO
  843.     {
  844.     if((Tero || CT || Dino || Badan || C5 || CT))
  845.     {
  846.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  847.     pDevice->SetTexture(0, Black);
  848.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  849.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  850.     pDevice->SetTexture(0, Black);
  851.     }
  852.     }
  853.     if ( Hack2 == 8 ) // WALL MINI INDO
  854.     {
  855.     if((Tero || CT || Dino || Badan || C5 || CT))
  856.     {
  857.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  858.     pDevice->SetTexture(0, Orange);
  859.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  860.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  861.     pDevice->SetTexture(0, Orange);
  862.     }
  863.     }
  864.     if ( Hack2 == 9 ) // WALL MINI INDO
  865.     {
  866.     if((Tero || CT || Dino || Badan || C5 || CT))
  867.     {
  868.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  869.     pDevice->SetTexture(0, Cyan);
  870.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  871.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  872.     pDevice->SetTexture(0, Cyan);
  873.     }
  874.     }
  875.     if ( Hack2 == 10 ) // WALL MINI INDO
  876.     {
  877.     if((Tero || CT || Dino || Badan || C5 || CT))
  878.     {
  879.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  880.     pDevice->SetTexture(0, Purple);
  881.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  882.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  883.     pDevice->SetTexture(0, Purple);
  884.     }
  885.     }
  886.     //----------------------------------------------------------------------------------------------------------------------------------
  887.     if (Hack14==1)//FullDot
  888.     {
  889.     if((Stride == 44 || Stride == 52 ))
  890.     {
  891.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  892.     pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
  893.     pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_POINT );
  894.     ( D3DFILL_FORCE_DWORD );
  895.     }
  896.     else{
  897.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  898.     pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
  899.     }
  900.     }
  901.     //----------------------------------------------------------------------------------------------------------------------------------
  902.     if (Hack12==1)//WH Weapon
  903.     {
  904.     if((Stride == 32))
  905.     {
  906.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  907.     pDevice->SetTexture(0, Red);
  908.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  909.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  910.     pDevice->SetTexture(0, Red);
  911.     }
  912.     }
  913.     if (Hack12==2)//WH Weapon
  914.     {
  915.     if((Stride == 32))
  916.     {
  917.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  918.     pDevice->SetTexture(0, Blue);
  919.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  920.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  921.     pDevice->SetTexture(0, Blue);
  922.     }
  923.     }
  924.     if (Hack12==3)//WH Weapon
  925.     {
  926.     if((Stride == 32))
  927.     {
  928.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  929.     pDevice->SetTexture(0, Green);
  930.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  931.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  932.     pDevice->SetTexture(0, Green);
  933.     }
  934.     }
  935.     if (Hack12==4)//WH Weapon
  936.     {
  937.     if((Stride == 32))
  938.     {
  939.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  940.     pDevice->SetTexture(0, Yellow);
  941.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  942.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  943.     pDevice->SetTexture(0, Yellow);
  944.     }
  945.     }
  946.     if (Hack12==5)//WH Weapon
  947.     {
  948.     if((Stride == 32))
  949.     {
  950.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  951.     pDevice->SetTexture(0, Pink);
  952.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  953.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  954.     pDevice->SetTexture(0, Pink);
  955.     }
  956.     }
  957.     if (Hack12==6)//WH Weapon
  958.     {
  959.     if((Stride == 32))
  960.     {
  961.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  962.     pDevice->SetTexture(0, White);
  963.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  964.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  965.     pDevice->SetTexture(0, White);
  966.     }
  967.     }
  968.     if (Hack12==7)//WH Weapon
  969.     {
  970.     if((Stride == 32))
  971.     {
  972.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  973.     pDevice->SetTexture(0, Black);
  974.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  975.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  976.     pDevice->SetTexture(0, Black);
  977.     }
  978.     }
  979.     if (Hack12==8)//WH Weapon
  980.     {
  981.     if((Stride == 32))
  982.     {
  983.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  984.     pDevice->SetTexture(0, Orange);
  985.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  986.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  987.     pDevice->SetTexture(0, Orange);
  988.     }
  989.     }
  990.     if (Hack12==9)//WH Weapon
  991.     {
  992.     if((Stride == 32))
  993.     {
  994.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  995.     pDevice->SetTexture(0, Cyan);
  996.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  997.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  998.     pDevice->SetTexture(0, Cyan);
  999.     }
  1000.     }
  1001.     if (Hack12==10)//WH Weapon
  1002.     {
  1003.     if((Stride == 32))
  1004.     {
  1005.     pDevice->SetRenderState(D3DRS_ZENABLE, false);
  1006.     pDevice->SetTexture(0, Purple);
  1007.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  1008.     pDevice->SetRenderState(D3DRS_ZENABLE, true);
  1009.     pDevice->SetTexture(0, Purple);
  1010.     }
  1011.     }
  1012.     if(Kontoless==1)
  1013.     {
  1014.     if((Stride == 52 || Stride == 44))
  1015.     {
  1016.     pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
  1017.     pDevice->SetTexture(0, Green);
  1018.     pDevice->SetTexture(0, Green);
  1019.     }
  1020.     else{
  1021.     pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
  1022.     }
  1023.     }
  1024.  
  1025.     if( Hack5 )
  1026.     {
  1027.     if ((Stride == 24) || (Stride == 23))
  1028.     {
  1029.     DWORD dwOldZEnable;
  1030.     pDevice->GetRenderState(D3DRS_ZENABLE,&dwOldZEnable);
  1031.     pDevice->SetRenderState(D3DRS_ZENABLE,D3DZB_FALSE);
  1032.     oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  1033.     pDevice->SetRenderState(D3DRS_ZENABLE,dwOldZEnable);
  1034.     }
  1035.     }
  1036.  
  1037.     if( Hack6 == 1 ) // Wall ASUS
  1038.     {
  1039.     if (Stride == 40)
  1040.     {
  1041.     pDevice->SetRenderState( D3DRS_SRCBLEND, 3 );
  1042.     pDevice->SetRenderState( D3DRS_DESTBLEND, 4 );
  1043.     pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
  1044.     }}
  1045.  
  1046.  
  1047.     if( Hack9 == 1 ) // No Smoke
  1048.     {
  1049.     if( Stride == 24 && NumVertices == 256 ||(Stride == 24 && NumVertices == 192))
  1050.     {
  1051.     return D3D_OK;
  1052.     }}
  1053.  
  1054.     if( Hack10 == 1 ) // NO FOG
  1055.     {
  1056.     pDevice->SetRenderState(D3DRS_FOGENABLE, false);
  1057.     }
  1058.     return oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  1059.     }
  1060.     //----------------------------------------------------------------------------------------------------------------------------------
  1061.     HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
  1062.     {
  1063.     myfile << "Reset is hooked\n";
  1064.     if( g_pFont )
  1065.     g_pFont->OnLostDevice();
  1066.  
  1067.     if( g_pLine )
  1068.     g_pLine->OnLostDevice();
  1069.  
  1070.     HRESULT iReturnValue = oReset(pDevice, pPresentationParameters);
  1071.  
  1072.     if(iReturnValue == D3D_OK) {
  1073.  
  1074.     if( g_pFont )
  1075.     g_pFont->OnResetDevice();
  1076.  
  1077.     if( g_pLine )
  1078.     g_pLine->OnResetDevice();
  1079.     }
  1080.  
  1081.     return iReturnValue;
  1082.     }
  1083.     //----------------------------------------------------------------------------------------------------------------------------------
  1084.     LRESULT CALLBACK MsgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){return DefWindowProc(hwnd, uMsg, wParam, lParam);}
  1085.     void DX_Init(DWORD* table)
  1086.     {
  1087.     WNDCLASSEX wc = {sizeof(WNDCLASSEX),CS_CLASSDC,MsgProc,0L,0L,GetModuleHandle(NULL),NULL,NULL,NULL,NULL,"DX",NULL};
  1088.     RegisterClassEx(&wc);
  1089.     HWND hWnd = CreateWindow("DX",NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
  1090.     LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );
  1091.     D3DPRESENT_PARAMETERS d3dpp;
  1092.     ZeroMemory( &d3dpp, sizeof(d3dpp) );
  1093.     d3dpp.Windowed = TRUE;
  1094.     d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
  1095.     d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
  1096.     LPDIRECT3DDEVICE9 pd3dDevice;
  1097.     pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pd3dDevice);
  1098.     DWORD* pVTable = (DWORD*)pd3dDevice;
  1099.     pVTable = (DWORD*)pVTable[0];
  1100.     table[ES] = pVTable[42];
  1101.     table[DIP] = pVTable[82];
  1102.     DestroyWindow(hWnd);
  1103.     }
  1104.     //----------------------------------------------------------------------------------------------------------------------------------
  1105.     bool hooked = false;
  1106.     DWORD WINAPI LoopFunction(LPVOID lpParam)
  1107.     {
  1108.     if( hooked == false) {
  1109.     DWORD VTable[3] = {0};
  1110.  
  1111.     while(LoadLibraryA("d3d9.dll")==NULL) {
  1112.     Sleep(100);
  1113.     }
  1114.     DX_Init(VTable);
  1115.     HOOK(EndScene,VTable[ES]); //Hook EndScene as a device discovery hook
  1116.     while(!npDevice) {
  1117.     Sleep(50);
  1118.     }
  1119.     UNHOOK(EndScene, VTable[ES]);
  1120.     void* d3DIP = (void*)(dwD3D9 + (DWORD) + (DWORD) + (DWORD) + (PDWORD)BaseD3D + 1024);//0x4FF50A4B[82]
  1121.     void* d3ES = (void*)(dwD3D9 + (DWORD) + (DWORD) + (DWORD) + (PDWORD)BaseD3D + 1036);//0x4FF19FEA[42]
  1122.     {
  1123.     int i;
  1124.     for (i = 0 ; i <= 0 ; i++){
  1125.     DWORD d,ds;
  1126.     VirtualProtect((void*)(d3ES), 4, PAGE_EXECUTE_READWRITE, &d);
  1127.     memcpy(d3ES,(void*)(d3ES), 4);
  1128.     VirtualProtect((void*)(d3ES), 4, d, &ds);
  1129.     }
  1130.     }
  1131.     int C;
  1132.     for (C = 0 ; C <= 0 ; C++){
  1133.     {
  1134.     DWORD d,ds;
  1135.     VirtualProtect((void*)(d3DIP), 4, PAGE_EXECUTE_READWRITE, &d);
  1136.     memcpy(d3DIP,(void*)(d3DIP), 4);
  1137.     VirtualProtect((void*)(d3DIP), 4, d, &ds);
  1138.     }
  1139.     }
  1140.     //------------------//
  1141.     CreateDetour((DWORD)hkDrawIndexedPrimitive, (DWORD)d3DIP*C,Detour_Type_0xB8,7);
  1142.     CreateDetour((DWORD)hkEndScene, (DWORD)d3ES*C,Detour_Type_0xB8,7);
  1143.  
  1144.  
  1145.     *(PDWORD)&oDrawIndexedPrimitive = VTable[DIP];
  1146.     *(PDWORD)&oEndScene = VTable[ES];
  1147.     //-----------------//
  1148.     hooked = true;
  1149.     }
  1150.     Sleep(10);
  1151.     void* d3DIP = (void*)(dwD3D9 + (DWORD) + (DWORD) + (DWORD) + (PDWORD)BaseD3D + 1024);//0x4FF505B0[82]
  1152.     void* d3ES = (void*)(dwD3D9 + (DWORD) + (DWORD) + (DWORD) + (PDWORD)BaseD3D + 1036);//0x4FF50260[42]
  1153.     {
  1154.     DWORD Dark,ds;
  1155.     VirtualProtect((void*)(d3ES), 4, PAGE_EXECUTE_READWRITE, &Dark);
  1156.     memcpy((void*)d3ES, (const void*)d3ES, 4);
  1157.     VirtualProtect((void*)(d3ES), 4, Dark, &ds);
  1158.     }
  1159.     int i;
  1160.     for (i = 0 ; i <= 15 ; i++){
  1161.     {
  1162.     DWORD d,ds;
  1163.     VirtualProtect((void*)(d3DIP), 4, PAGE_EXECUTE_READWRITE, &d);
  1164.     memcpy((void*)d3DIP, (const void*)d3DIP, 4);
  1165.     VirtualProtect((void*)(d3DIP), 4, d, &ds);
  1166.     }
  1167.     }
  1168.     for (i = 0 ; i <= 15 ; i++){
  1169.     if(memcmp((void *)d3DIP, (void *)d3DIP, 82) == 0 ) // Protect Hook Draw Indexed Primitive
  1170.     ProtectHook((LPDWORD*)npDevice, (PBYTE)d3DIP, 82);
  1171.     }
  1172.  
  1173.     for (i = 0 ; i <= 15 ; i++){
  1174.     if(memcmp((void *)d3ES, (void *)d3ES, 42) == 0 ) // Protect Hook End Scene
  1175.     ProtectHook((LPDWORD*)npDevice, (PBYTE)d3ES, 42);
  1176.     }
  1177.     {
  1178.     Sleep(100);
  1179.     }
  1180.     return 0;
  1181.     }
  1182.     /*_____________________________________________________________________________*/
  1183.     BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
  1184.     {
  1185.     if(dwReason == DLL_PROCESS_ATTACH) {
  1186.     CreateThread(0, 0,LoopFunction, 0, 0, 0);
  1187.     CreateThread(0, 0, (LPTHREAD_START_ROUTINE)UndetectHack, 0, 0, 0);
  1188.     CreateThread(0, 0, (LPTHREAD_START_ROUTINE)BarusReplace, 0, 0, 0);
  1189.     }
  1190.     return TRUE;
  1191.     }

Replies to Hook rss

Title Name Language When
Re: Hook Colossal Cassowary c 1 Year ago.

Reply to "Hook"

Here you can reply to the paste above