#pragma warning(disable : 4996) //_CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <fstream>
#include <tlhelp32.h>
#include <process.h>
#include <stdint.h>
#include <string>
#include <time.h>
#include <stdio.h>
#include <strsafe.h>
#include <iostream>
#include <vector>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "winmm.lib")
#if defined _M_X64
#pragma comment( lib, "x64\d3dx9.lib" )
#elif defined _M_IX86
#pragma comment( lib, "d3dx9.lib" )
#endif
#include "MinHook.h"
#include "Xor.h"
#include "DirectX.h"
#include "Colors.h"
#include "Declare.h"
#include "CSound.h"
#if defined _M_X64
#pragma comment( lib, "libMinHook-x64-v100-md.lib" )
#pragma comment( lib, "libMinHook-x64-v100-mdd.lib" )
#pragma comment( lib, "libMinHook-x64-v100-mt.lib" )
#pragma comment( lib, "libMinHook-x64-v100-mtd.lib" )
#elif defined _M_IX86
#pragma comment( lib, "libMinHook-x86-v100-md.lib" )
#pragma comment( lib, "libMinHook-x86-v100-mdd.lib" )
#pragma comment( lib, "libMinHook-x86-v100-mt.lib" )
#pragma comment( lib, "libMinHook-x86-v100-mtd.lib" )
#endif
#pragma warning (disable: 4244) //
HMODULE Hand;
bool screenshot_taken = false;
#pragma region VARIABLES
bool first = true;
bool _first = true;
int show = 1;
int selector = 2;
int hackcount = 39;
int aHead[87];
bool is_set_default_value = false;
int vip = 0; //1
bool disable_vip = true;
bool simplehaxs = false;
bool ismsg = false;
int isramleague = true;
#define GradientColor D3DCOLOR_ARGB(200, 0, 0, 0)
#define GradientColor2 D3DCOLOR_ARGB(100, 0, 0, 0)
#define aTextureType 0x594
#define WallPointer 0x2294518 //8B 15 ?? ?? ?? ?? 83 C4 04 89 84 16 ?? ?? ?? ??
#define BPlayerInfo 0x20F9350 //8B 0D ?? ?? ?? ?? 83 C4 04 69 C0 ?? ?? ?? ?? D9 9C 08 ?? ?? ?? ?? 8B 4C 24 ?? 3B CB
float shiftspeed = NULL;
float crouchspeed = NULL;
float nafall[3];
float nobug[24];
float superjump;
bool istagosbala = false;
bool playsounds = false;
LPDIRECT3DTEXTURE9 cMESSAGETOP;
LPDIRECT3DTEXTURE9 cMESSAGEBODY;
LPDIRECT3DTEXTURE9 cMESSAGEBOTTOM;
LPDIRECT3DTEXTURE9 cVIP;
LPDIRECT3DTEXTURE9 cMINIVIP;
LPD3DXSPRITE Sprite;
#pragma endregion
#pragma region FONTSS
DWORD org_scp = 0, retES = 0, jump_DrawIndexedPrimitive;
//LPD3DXFONT Font;
void StartFont(LPDIRECT3DDEVICE9 pDevice)
{
bool bFont = false;
if (Font)
{
Font->Release();
Font = false;
bFont = false;
}
if (!bFont)
{
D3DXCreateFontA(pDevice, 14, 6, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &Font);
bFont = true;
}
}
void WriteText(LPDIRECT3DDEVICE9 pDevice, INT x, INT y, DWORD color, CHAR *text)
{
RECT rect;
SetRect(&rect, x, y, x, y);
int g = 1;
RECT rect1;
SetRect(&rect1, x + g, y, x + g, y);
RECT rect2;
SetRect(&rect2, x - g, y, x - g, y);
RECT rect3;
SetRect(&rect3, x, y + g, x, y + g);
RECT rect4;
SetRect(&rect4, x, y - g, x, y - g);
Font->DrawText(NULL, text, -1, &rect1, DT_NOCLIP | DT_LEFT, Black);
Font->DrawText(NULL, text, -1, &rect2, DT_NOCLIP | DT_LEFT, Black);
Font->DrawText(NULL, text, -1, &rect3, DT_NOCLIP | DT_LEFT, Black);
Font->DrawText(NULL, text, -1, &rect4, DT_NOCLIP | DT_LEFT, Black);
Font->DrawText(NULL, text, -1, &rect, DT_NOCLIP | DT_LEFT, color);
}
#pragma endregion
#pragma region FPS
float fFps = 0.0f;
float fLastTickCount = 0.0f;
float fCurrentTickCount;
char cFrameRate[50] = { 0 };
char* FPS()
{
fCurrentTickCount = clock() * 0.001f;
++fFps;
if ((fCurrentTickCount - fLastTickCount) > 1.0f)
{
fLastTickCount = fCurrentTickCount;
sprintf(cFrameRate, "%d FPS", int(fFps));
fFps = 0;
}
return cFrameRate;
}
char cF[50] = { 0 };
char* inttochar(int g)
{
sprintf(cF, "[ %d ]", g);
return cF;
}
char cF2[50] = { 0 };
char* floattochar(float g)
{
sprintf(cF2, "%d", g);
return cF2;
}
#pragma endregion
#pragma region TIMEDATE
//-----------------------------------------------------------------------------
// Name: TIME()
// Desc: Outputs Current Time in USA Format
//-----------------------------------------------------------------------------
char* TIMES()
{
static char ctime[20] = "";
struct tm * current_tm;
time_t current_time;
time(¤t_time);
current_tm = localtime(¤t_time);
if (current_tm->tm_hour>12)
sprintf(ctime, "Time: %d:%02d:%02d PM", current_tm->tm_hour - 12, current_tm->tm_min, current_tm->tm_sec);
else
sprintf(ctime, "Time: %d:%02d:%02d AM", current_tm->tm_hour, current_tm->tm_min, current_tm->tm_sec);
return ctime;
}
//-----------------------------------------------------------------------------
// Name: DATE()
// Desc: Outputs Current Date in USA Format
//-----------------------------------------------------------------------------
char* DATES()
{
struct tm * current_tm;
time_t current_time; time(¤t_time);
current_tm = localtime(¤t_time);
char *month[] = { "Jan","Feb","Mar","Apr","May","June","July","Aug", "Sept","Oct","Nov","Dec" };
char *logbuf = new char[256];
sprintf(logbuf, "Date: %s %02d, 20%d", month[current_tm->tm_mon], current_tm->tm_mday, current_tm->tm_year - 100);
return logbuf;
}
#pragma endregion
void maxval()
{
if (first)
{
for (int i = 0; i < hackcount; i++) //location y
{
C_Index[i] = i;
C_HackVal[i] = 0;
if (i == 0)
C_Loc[0] = 49;
else
C_Loc[i] = C_Loc[i - 1] + 15;
}
first = false;
}
int superkill = 5; //superkill 0 for off 3 or 5 for availed
int nbd = 1;
//if (C_HackVal[27] == 0)
// superkill -= 3;
int val = 1;
//if (inGame())
//{
// val = 0;
// superkill = 0;
// nbd = 0;
//}
C_HackMaxVal[0] = 0;
C_HackMaxVal[1] = 1;
C_HackMaxVal[2] = 1;
C_HackMaxVal[3] = 1;
C_HackMaxVal[4] = 2;
C_HackMaxVal[5] = 2;
C_HackMaxVal[6] = 1;
C_HackMaxVal[7] = 1;
C_HackMaxVal[8] = 1;
C_HackMaxVal[9] = 1;
C_HackMaxVal[10] = 0;
C_HackMaxVal[11] = 5;
C_HackMaxVal[12] = 7;
C_HackMaxVal[13] = 1;
C_HackMaxVal[14] = 1;
C_HackMaxVal[15] = 0;
C_HackMaxVal[16] = 1;
C_HackMaxVal[17] = 1;
C_HackMaxVal[18] = 1;
C_HackMaxVal[19] = 1;
C_HackMaxVal[20] = 2;
C_HackMaxVal[21] = 1;
C_HackMaxVal[22] = 1;
C_HackMaxVal[23] = 1;
C_HackMaxVal[24] = 1;
C_HackMaxVal[25] = 0;
C_HackMaxVal[26] = 2;
C_HackMaxVal[27] = val;
C_HackMaxVal[28] = superkill;
C_HackMaxVal[29] = 1;
C_HackMaxVal[30] = 1;
C_HackMaxVal[31] = 1;
C_HackMaxVal[32] = 1;
C_HackMaxVal[33] = nbd;
C_HackMaxVal[34] = 1;
C_HackMaxVal[35] = 1;
C_HackMaxVal[36] = 2;
C_HackMaxVal[37] = 1;
C_HackMaxVal[38] = 1;
C_HackMaxVal[39] = 0;
C_HackMaxVal[40] = 1;
C_HackMaxVal[41] = 1;
C_HackMaxVal[42] = 1;
C_HackMaxVal[43] = 0;
C_HackMaxVal[44] = 1;
C_HackMaxVal[45] = 1;
}
//================================================== ================================================== ======================
/

pedef HRESULT(APIENTRY *SetStreamSource_t)(IDirect3DDevice9*, UINT, IDirect3DVertexBuffer9*, UINT, UINT);
//HRESULT APIENTRY SetStreamSource_hook(IDirect3DDevice9*, UINT, IDirect3DVertexBuffer9*, UINT, UINT);
//SetStreamSource_t SetStreamSource_orig = 0;
/

pedef HRESULT(APIENTRY *SetTexture_t)(IDirect3DDevice9*, DWORD, IDirect3DBaseTexture9 *);
//HRESULT APIENTRY SetTexture_hook(IDirect3DDevice9*, DWORD, IDirect3DBaseTexture9 *);
//SetTexture_t SetTexture_orig = 0;
typedef HRESULT(APIENTRY* Present_t) (IDirect3DDevice9*, const RECT *, const RECT *, HWND, const RGNDATA *);
HRESULT APIENTRY Present_hook(IDirect3DDevice9*, const RECT *, const RECT *, HWND, const RGNDATA *);
Present_t Present_orig = 0;
/

pedef HRESULT(APIENTRY* EndScene_t) (IDirect3DDevice9*);
//HRESULT APIENTRY EndScene_hook(IDirect3DDevice9*);
//EndScene_t EndScene_orig = 0;
/

pedef HRESULT(APIENTRY *Reset_t)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
//HRESULT APIENTRY Reset_hook(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
//Reset_t Reset_orig = 0;
//================================================== ================================================== ======================
void DrawMenu(LPDIRECT3DDEVICE9 pDevice)
{
if (GetAsyncKeyState(VK_INSERT) & 1)show = (!show);
if (show)
{
int w = 200;
int Xbox = 39 - 5;
int Ybox = 6 - 3;
int BoxWidth = 8;
int BoxHeight = 8;
int item = 100 + 15;
StartFont(pDevice);
//title
//Gradient(20, 21, w, 25, TGray, GradientColor, GradientOrientation::Horizontal, pDevice);
DrawBox(20, 21, w, 25, TGray, GradientColor, pDevice);
DrawBorder(20, 21, w, 25, 1, Black, pDevice);
WriteText(pDevice, 30, 27, White, "IvanNillo{D3D}");
WriteText(pDevice, 178, 27, White, FPS());
//body
//Gradient(20, 46, w, 200 + item, TGray, GradientColor, GradientOrientation::Horizontal, pDevice);
DrawBox(20, 46, w, 475 + item, TGray, GradientColor, pDevice);
DrawBorder(20, 46, w, 475 + item, 1, Black, pDevice);
//info(w + 10, w, pDevice);
maxval(); //delare maxvalue per cheat
if (GetAsyncKeyState(VK_DOWN) & 1)
{
selector++;
if (selector == hackcount + 1)
{
selector = 2;
}
else
{
for (int i = 0; i < hackcount; i++)
if (selector == C_Index[i] + 1)
if (C_HackMaxVal[i] == 0)
selector++;
}
if (playsounds) playsoundmem((LPCSTR)MOVE);
}
if (GetAsyncKeyState(VK_UP) & 1)
{
selector--;
if (selector == 1)
selector = hackcount;
else
{
for (int i = hackcount; i > 0; i--)
if (selector == C_Index[i] + 1)
if (C_HackMaxVal[i] == 0)
selector--;
}
if (playsounds) playsoundmem((LPCSTR)MOVE);
}
int superkilltype = 27;
int superkillvalue = 28;
int nbd = 33;
for (int i = superkilltype; i <= superkillvalue; i++)
if (selector == C_Index[i] + 1)
if (C_HackMaxVal[i] == 0)
selector++;
DrawBox(21, C_Loc[selector - 1] - 1, w - 2, 17 / 2, D3DCOLOR_ARGB(255, 58, 38, 13), D3DCOLOR_ARGB(255, 58, 38, 13), pDevice);
DrawBox(21, (C_Loc[selector - 1] - 1) + (17 / 2), w - 2, 17 / 2, D3DCOLOR_ARGB(255, 36, 27, 14), D3DCOLOR_ARGB(255, 36, 27, 14), pDevice);
DrawBorder(21, C_Loc[selector - 1] - 1, w - 2, 17, 1, D3DCOLOR_ARGB(255, 211, 153, 57), pDevice);
if (selector == C_Index[superkilltype] + 1 || selector == C_Index[superkillvalue] + 1 || selector == C_Index[nbd] + 1)
{
DrawBox(21 + w + 5, C_Loc[selector - 1] - 2.5, ((w + 10) / 2) + 40, 20, Black, Red, pDevice);
WriteText(pDevice, 21 + w + 5 + 5, C_Loc[selector - 1], Yellow, "ACTIVATE ONLY IN LOBBY");
}
int stw = 40;
if (selector == C_Index[stw] + 1)
{
DrawBox(21 + w + 5, C_Loc[selector - 1] - 2.5, (w + 10) / 2, 20, Black, Red, pDevice);
WriteText(pDevice, 21 + w + 5 + 5, C_Loc[selector - 1], Yellow, "DO NOT USE RIFLE");
}
if (GetAsyncKeyState(VK_RIGHT)<0)
{
for (int i = 0; i < hackcount; i++)
{
if (selector == C_Index[i] + 1)
{
C_HackVal[i] += 1;
if (C_HackVal[i] > C_HackMaxVal[i])
{
C_HackVal[i] = 0;
}
Sleep(170);
}
if (selector == C_Index[superkilltype] + 1)
{
//if (!inGame())
//{
// C_HackVal[superkillvalue] = 0;
//}
//else if (inGame())
//{
C_HackVal[superkilltype] -= 1;
if (C_HackVal[superkilltype] < 0)
{
C_HackVal[superkilltype] += 1;
}
//}
}
}
if (playsounds) playsoundmem((LPCSTR)SWITCH);
}
if (GetAsyncKeyState(VK_LEFT)<0)
{
for (int i = 0; i < hackcount; i++)
{
if (selector == C_Index[i] + 1)
{
C_HackVal[i] -= 1;
if (C_HackVal[i] < 0)
{
C_HackVal[i] = C_HackMaxVal[i];
}
Sleep(170);
}
if (selector == C_Index[superkilltype] + 1)
{
//if (!inGame())
//{
// C_HackVal[superkillvalue] = 0;
//}
//else if (inGame())
//{
C_HackVal[superkilltype] += 1;
if (C_HackVal[superkilltype] > C_HackMaxVal[i])
{
C_HackVal[superkilltype] = C_HackMaxVal[i];
}
//}
}
}
if (playsounds) playsoundmem((LPCSTR)SWITCH);
}
int ctr = 0;
#pragma region D3D HACK
//================================================== =================
WriteText(pDevice, 30, C_Loc[ctr], Yellow, "[D3D HACK]");
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " CrossHair");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " CrossHair");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Wall Hack");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Wall Hack");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Player Chams");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Player Chams");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Chams Color 1");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 185.50, C_Loc[ctr], Red, "[RED]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Chams Color 1");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 15 + 156.5, C_Loc[ctr], Green, "[GREEN]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " Chams Color 1");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 15 + 145.75, C_Loc[ctr], Yellow, "[YELLOW]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Chams Color 2");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 185.50, C_Loc[ctr], Red, "[RED]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Chams Color 2");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 15 + 156.5, C_Loc[ctr], Green, "[GREEN]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " Chams Color 2");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 15 + 145.75, C_Loc[ctr], Yellow, "[YELLOW]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " See Ghost");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " See Ghost");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Wire Frame");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Wire Frame");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " No Sky");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " No Sky");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Full Bright");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Full Bright");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
#pragma endregion
#pragma region AIMBOTHACK
//================================================== =================
WriteText(pDevice, 30, C_Loc[ctr], Yellow, "[ AIMBOTHACK ]");
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Aimbot");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Aimbot");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 175, C_Loc[ctr], Green, "[AUTO]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " Aimbot");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 160, C_Loc[ctr], Green, "[LMOUSE]"); break;
case 3: WriteText(pDevice, 30, C_Loc[ctr], White, " Aimbot");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 160, C_Loc[ctr], Green, "[RMOUSE]"); break;
case 4: WriteText(pDevice, 30, C_Loc[ctr], White, " Aimbot");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 175, C_Loc[ctr], Green, "[SHIFT]"); break;
case 5: WriteText(pDevice, 30, C_Loc[ctr], White, " Aimbot");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 184, C_Loc[ctr], Green, "[ALT]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 177, C_Loc[ctr], Green, "[HEAD]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 177, C_Loc[ctr], Green, "[NECK]"); break;
case 3: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 176, C_Loc[ctr], Green, "[BODY]"); break;
case 4: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 169, C_Loc[ctr], Green, "[LHAND]"); break;
case 5: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 169, C_Loc[ctr], Green, "[RHAND]"); break;
case 6: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 169, C_Loc[ctr], Green, "[LFOOT]"); break;
case 7: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Position");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 169, C_Loc[ctr], Green, "[RFOOT]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Mode");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 153, C_Loc[ctr], Green, "[DISTANCE]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Aim Mode");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 143, C_Loc[ctr], Green, "[CROSSHAIR]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Visible Check");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Visible Check");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
#pragma endregion
#pragma region PlayerHack
//================================================== =================
WriteText(pDevice, 30, C_Loc[ctr], Yellow, "[ PlayerHack ]");
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Team"); // enemy friend both
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Team");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Bone");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Bone");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Line");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Line");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Health Bar");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Health Bar");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Box");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Box");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 192, C_Loc[ctr], Green, "[2D]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Box");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 192, C_Loc[ctr], Green, "[3D]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Name");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Name");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Distance");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Distance");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP C4");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP C4");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Rank");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " ESP Rank");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
#pragma endregion
#pragma region MEMORY
//================================================== =================
WriteText(pDevice, 30, C_Loc[ctr], Yellow, "[ MEMORY ]");
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Always Head");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Always Head");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 168, C_Loc[ctr], Green, "[SILVER]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " Always Head");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 175, C_Loc[ctr], Green, "[GOLD]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill Type");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 176, C_Loc[ctr], Green, "[BODY]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill Type");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 177, C_Loc[ctr], Green, "[HEAD]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: if (C_HackVal[ctr - 1] == 0)
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Body]");
else
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Head]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: if (C_HackVal[ctr - 1] == 0)
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Body]");
else
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Head]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 183, C_Loc[ctr], Green, "[Lvl1]"); break;
case 2: if (C_HackVal[ctr - 1] == 0)
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Body]");
else
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Head]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
//if (C_HackVal[ctr - 1] == 0)
// WriteText(pDevice, 180, C_Loc[ctr], Green, "[MAX]");
//else
WriteText(pDevice, 183, C_Loc[ctr], Green, "[Lvl2]");
break;
case 3: if (C_HackVal[ctr - 1] == 0)
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Body]");
else
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Head]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 183, C_Loc[ctr], Green, "[Lvl3]");
break;
case 4: if (C_HackVal[ctr - 1] == 0)
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Body]");
else
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Head]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 183, C_Loc[ctr], Green, "[Lvl4]");
break;
case 5: if (C_HackVal[ctr - 1] == 0)
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Body]");
else
WriteText(pDevice, 30, C_Loc[ctr], White, " Superkill [Head]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 180, C_Loc[ctr], Green, "[MAX]");
break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Walk Through Wall [V]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Walk Through Wall [V]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Fly Hack [Hold Space]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Fly Hack [Hold Space]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Super Jump [Space]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Super Jump [Space]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " No Fall Damage");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " No Fall Damage");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " No Bug Damage");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " No Bug Damage");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Movement Speed [Shift]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Movement Speed [Shift]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Crouch Speed [Ctrl]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Crouch Speed [Ctrl]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " God Mode");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " God Mode");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 184, C_Loc[ctr], Green, "[INVI]"); break;
case 2: WriteText(pDevice, 30, C_Loc[ctr], White, " God Mode");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 156, C_Loc[ctr], Green, "[ANTI INVI]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Teleport High [Num 8]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Teleport High [Num 8]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
ctr += 1;
switch (C_HackVal[ctr])
{
case 0: WriteText(pDevice, 30, C_Loc[ctr], White, " Teleport Ground [Num 2]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, White, Black, pDevice);
WriteText(pDevice, 185, C_Loc[ctr], White, "[OFF]"); break;
case 1: WriteText(pDevice, 30, C_Loc[ctr], White, " Teleport Ground [Num 2]");
DrawBox(Xbox, C_Loc[ctr] + Ybox, BoxWidth, BoxHeight, Green, Black, pDevice);
WriteText(pDevice, 190, C_Loc[ctr], Green, "[ON]"); break;
}
#pragma endregion
//for (int i = 0; i < hackcount; i++)
// WriteText(pDevice, 21 + w + 5 + 5, C_Loc[i], Yellow, inttochar(i));
}
}
//================================================== ================================================== ===================
HRESULT APIENTRY Present_hook(IDirect3DDevice9* pDevice, const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion)
{
DrawMenu(pDevice);
return Present_orig(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
//================================================== ================================================== ======================
//================================================== ================================================== ======================
HANDLE(WINAPI * Real_CreateFile) (
LPCWSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile) = CreateFileW;
HANDLE WINAPI Routed_CreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
char buffer[500];
wcstombs(buffer, lpFileName, 500);
if (strcmp(buffer + strlen(buffer) - 4, ".jpg") == 0)//find gm_complaint_x.jpg
{
if (screenshot_taken == false)
{
//wallhack = 0; //too late
//Log("buffer == %s", buffer);//log jpg
screenshot_taken = true;
}
}
return Real_CreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
}
//================================================== ================================================== ======================
DWORD WINAPI RosD3D(__in LPVOID lpParameter)
{
HMODULE dDll = NULL;
while (!dDll)
{
dDll = GetModuleHandleA("d3d9.dll");
Sleep(100);
}
CloseHandle(dDll);
IDirect3D9* d3d = NULL;
IDirect3DDevice9* d3ddev = NULL;
HWND tmpWnd = CreateWindowA("BUTTON", "RosD3D", WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, NULL, NULL, Hand, NULL);
if (tmpWnd == NULL)
{
//Log("[DirectX] Failed to create temp window");
return 0;
}
d3d = Direct3DCreate9(D3D_SDK_VERSION);
if (d3d == NULL)
{
DestroyWindow(tmpWnd);
//Log("[DirectX] Failed to create temp Direct3D interface");
return 0;
}
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = tmpWnd;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
HRESULT result = d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, tmpWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
if (result != D3D_OK)
{
d3d->Release();
DestroyWindow(tmpWnd);
//Log("[DirectX] Failed to create temp Direct3D device");
return 0;
}
// We have the device, so walk the vtable to get the address of all the dx functions in d3d9.dll
#if defined _M_X64
DWORD64* dVtable = (DWORD64*)d3ddev;
dVtable = (DWORD64*)dVtable[0];
#elif defined _M_IX86
DWORD* dVtable = (DWORD*)d3ddev;
dVtable = (DWORD*)dVtable[0]; // == *d3ddev
#endif
//Log("[DirectX] dVtable: %x", dVtable);
//for(int i = 0; i < 95; i++)
//{
//Log("[DirectX] vtable[%i]: %x, pointer at %x", i, dVtable[i], &dVtable[i]);
//}
// Detour functions x86 & x64
if (MH_Initialize() != MH_OK) { return 1; }
if (MH_CreateHook((DWORD_PTR*)dVtable[17], &Present_hook, reinterpret_cast<void**>(&Present_orig)) != MH_OK) { return 1; }
if (MH_EnableHook((DWORD_PTR*)dVtable[17]) != MH_OK) { return 1; }
//if (MH_CreateHook((DWORD_PTR*)dVtable[42], &EndScene_hook, reinterpret_cast<void**>(&EndScene_orig)) != MH_OK) { return 1; }
//if (MH_EnableHook((DWORD_PTR*)dVtable[42]) != MH_OK) { return 1; }
//if (MH_CreateHook((DWORD_PTR*)dVtable[100], &SetStreamSource_hook, reinterpret_cast<void**>(&SetStreamSource_orig)) != MH_OK) { return 1; }
//if (MH_EnableHook((DWORD_PTR*)dVtable[100]) != MH_OK) { return 1; }
//if (MH_CreateHook((DWORD_PTR*)dVtable[65], &SetTexture_hook, reinterpret_cast<void**>(&SetTexture_orig)) != MH_OK) { return 1; }
//if (MH_EnableHook((DWORD_PTR*)dVtable[65]) != MH_OK) { return 1; }
//if (MH_CreateHook((DWORD_PTR*)dVtable[16], &Reset_hook, reinterpret_cast<void**>(&Reset_orig)) != MH_OK) { return 1; }
//if (MH_EnableHook((DWORD_PTR*)dVtable[16]) != MH_OK) { return 1; }
HMODULE mod = LoadLibrary(TEXT("Kernel32.dll"));
void* ptr = GetProcAddress(mod, "CreateFileW");
MH_CreateHook(ptr, Routed_CreateFile, reinterpret_cast<void**>(&Real_CreateFile));
MH_EnableHook(ptr);
d3ddev->Release();
d3d->Release();
DestroyWindow(tmpWnd);
return 1;
}
//================================================== ================================================== ======================
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
Hand = hModule;
DisableThreadLibraryCalls(hModule);
MessageBoxA(0, "Make By:{IvanNillo}", "CFPH HACK2.0", 0);
CreateThread(0, 0, RosD3D, 0, 0, 0);
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
Font->Release();
break;
}
return TRUE;
}