i want to share code that looked (remove dot after "m")m.ediafire.com/view/w8bctiyg5gmrcaf/img_20042015_070018.png
maybe new meth heads improve this.
i dont say im done with this game.
it dont make it grow if i only warm it under my ass.. so here it is, with d3d9 aimbot <<-- big thanks to lvous and Heisa for it
i think you need to decomment DistX on mouse_event(move) and comment out sharper mouse x move(because of update) or you can update mem addr.
Code:
/* +========================================================================+
* | lavastyle dll. created on 12.03.2015(d.m.y) |
* | if you want to support lava: |
* | bitcoin: 3Gjui4Lg6P8q66Y8ifvJTRVxiDTvKxrDdn |
* | litecoin: LZQjV29aS1r6CDKSiDo3ZtDyVPrcWHSnb6 |
* | dogecoin: D5brvjzJne99wmn4PhmbuUPAXwuMMryi9s |
* |------------------------------------------------------------------------|
* | |
* | directx9 deteour template from: |
* | http://www.mpgh.net/forum/showthread.php?t=836580 |
* +========================================================================+
* \=-=-=-=-=-=-=--=--`no recoil lived over 3 or 2 updates
*/
//#include "LAVA_FLOW.h"
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
//#include "detours/detours.h" //detours 1.5
#include "detours.h" //detours 3.0 (google microsoft detours)
#pragma comment (lib, "detours.lib") //detours 3.0
#include <vector>
#include <fstream>
#include <Iphlpapi.h>
#include <Assert.h>
#pragma comment(lib, "iphlpapi.lib")
#include <sstream>
#include <string>
#include <tlhelp32.h>
#include <tchar.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
#include <Psapi.h>
#pragma comment(lib, "Psapi.lib")
// get stride
IDirect3DVertexBuffer9 *pStreamData;
UINT XOffset = 0;
UINT Stride = 0;
// get pshader
IDirect3DPixelShader9* pShader;
UINT psData;
//get vshader
IDirect3DVertexShader9* vShader;
UINT vsData;
//get viewport
D3DVIEWPORT9 viewport;
//==========================================================================================================================
signed int __stdcall hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 Device, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT primCount);
typedef HRESULT(__stdcall* DrawIndexedPrimitive_t)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
DrawIndexedPrimitive_t OrigDrawIndexedPrimitive;
signed int __stdcall hkEndScene(LPDIRECT3DDEVICE9 Device);
typedef HRESULT (__stdcall* EndScene_t)(LPDIRECT3DDEVICE9);
EndScene_t OrigEndScene;
//==========================================================================================================================
LPDIRECT3DTEXTURE9 g_pTexRed = NULL;
LPDIRECT3DTEXTURE9 g_pTexOrange = NULL;
LPDIRECT3DTEXTURE9 g_pTexTur = NULL;
LPD3DXFONT g_pFont = NULL;
LPD3DXLINE g_pLine = NULL;
// settings
DWORD aimkey = 0x43; //aimkey (google Virtual-Key Codes)
int aimfov=25; //aim fov in %
int aimheight=50; //adjust aim height, 0 = feet
double aimsmooth=1.2; //aim smooth (mouse accel messes with aiming)
const BYTE red[ 58 ] = {
0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
};
const BYTE orange[ 58 ] = {
0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xFF, 0x00
};
const BYTE tur[60] = {
0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00
};
D3DCOLOR fontRed = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR fontGreen = D3DCOLOR_ARGB(255, 0, 255, 0);
D3DCOLOR fontBlue = D3DCOLOR_ARGB(255, 0, 0, 255);
D3DCOLOR fontWhite = D3DCOLOR_ARGB(255, 255, 255, 255);
D3DCOLOR fontBlack = D3DCOLOR_ARGB(255, 0, 0, 0);
IDirect3DTexture9* Primitive = NULL;
void DrawString(int x, int y, DWORD color, const char *fmt, ...) {
RECT FontPos = { x, y, x + 120, y + 16 };
char buf[1024] = {'\0'};
va_list va_alist;
va_start(va_alist, fmt);
vsprintf(buf, fmt, va_alist);
va_end(va_alist);
g_pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}
void DrawFilledRectangle(int x, int y, int w, int h, D3DCOLOR color, LPDIRECT3DDEVICE9 d3dDevice) {
D3DRECT rct = {x, y, x + w, y + h};
d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
}
void DrawFilledCircle(int x, int y, int size, D3DCOLOR color, LPDIRECT3DDEVICE9 d3dDevice) {
int w;
int h;
int xx;
int yy;
if (size == 1) {
xx = x;
yy = y + 7;
w = 1;
h = 5;
for (int i = 0; i < 5; i++) {
if (i != 0) {
xx++;
if (i < 2) {
yy -= 2;
h += 4;
} else {
yy--;
h += 2;
}
if (i == 3/* || i == 4*/) {
D3DRECT rct = {xx, yy, xx + w, yy + h};
d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
xx++;
} else if (i == 4) {
for (int j= 0; j < 4; j++) {
D3DRECT rct = {xx, yy, xx + w, yy + h};
d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
xx++;
}
}
}
D3DRECT rct = {xx, yy, xx + w, yy + h};
d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
}
for (int i = 0; i < 4; i++) {
xx++;
yy++;
h -= 2;
if (i > 2) {
yy++;
h -= 2;
} else if (i == 1 || i == 2) {
// doing nothing its normal
} else {
D3DRECT rct = {xx, yy, xx + w, yy + h};
d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
xx++;
}
D3DRECT rct = {xx, yy, xx + w, yy + h};
d3dDevice->Clear(1, &rct, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
}
}
}
void WriteToMemory(uintptr_t address, char* value, int bytes) {
//unsigned long oldProdection; // <<-- if you do not use dll injector
//VirtualProtect((LPVOID)(address), bytes, PAGE_EXECUTE_READWRITE, &oldProdection); // <<-- if you do not use dll injector
memcpy((LPVOID)address, value, bytes);
//VirtualProtect((LPVOID)(address), bytes, oldProdection, NULL); // <<-- if you do not use dll injector
}
RECT rect;
RECT client_rect;
BOOL cb_wireframe = FALSE;
BOOL cb_menu = FALSE;
BOOL cb_third_menu = FALSE;
int menu_mouse_pos = 0;
int menu_mouse_pos_x = 0;
int menu_w = 0;
int menu_w_max = 200;
int menu_h = 198;
int title_h = 22;
int time_to_flow = 1;
char *menu_items[11] = {
"german head",
"us head",
"soviet head",
"hold c ^^ near enemy",
"crosshair",
"faster aim",
"quick aim without gun",
"-------------------",
"semi 2 auto",
"3-rd person view",
"sounds mod"};
BOOL b_menu_items[11] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
int menu_size = 11;
int third_menu_w = 200;
int third_menu_h = 20;
char *third_menu_items[1] = {"1 person when zoom"};
BOOL b_third_menu_items[1] = {FALSE};
int third_menu_size = 1;
struct ModelInfo_t {
D3DXVECTOR3 Position2D;
D3DXVECTOR3 Position3D;
float CrosshairDistance;
};
std::vector<ModelInfo_t*>ModelInfo;
struct D3DTLVERTEX {
float x, y, z, rhw;
DWORD color;
};
float GetDistance( float Xx, float Yy, float xX, float yY ) {
return sqrt( ( yY-Yy ) * ( yY-Yy ) + ( xX-Xx ) * ( xX-Xx ) );
}
//void DrawLine( IDirect3DDevice9* m_pD3Ddev, float X, float Y, float X2, float Y2, float Width, D3DCOLOR Color ) {
// D3DTLVERTEX qV[2] = {
// { (float)X , (float)Y, 0.0f, 1.0f, Color},
// { (float)X2 , (float)Y2 , 0.0f, 1.0f, Color},
// };
//
// const DWORD D3DFVF_TL = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;
// m_pD3Ddev->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
// m_pD3Ddev->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
// m_pD3Ddev->SetFVF( D3DFVF_TL );
// m_pD3Ddev->SetTexture( 0, Primitive );
// m_pD3Ddev->DrawPrimitiveUP( D3DPT_LINELIST, 2, qV, sizeof( D3DTLVERTEX ) );
//}
void DrawLine(IDirect3DDevice9* m_pD3Ddev, float Xa, float Ya, float Xb, float Yb, float dwWidth, D3DCOLOR Color) {
if (!g_pLine)
D3DXCreateLine(m_pD3Ddev, &g_pLine);
D3DXVECTOR2 vLine[2]; // Two points
g_pLine->SetAntialias(0); // To smooth edges
g_pLine->SetWidth(dwWidth); // Width of the line
g_pLine->Begin();
vLine[0][0] = Xa; // Set points into array
vLine[0][1] = Ya;
vLine[1][0] = Xb;
vLine[1][1] = Yb;
g_pLine->Draw(vLine, 2, Color); // Draw with Line, number of lines, and color
g_pLine->End(); // finish
}
void Worldtoscreen(LPDIRECT3DDEVICE9 Device) {
ModelInfo_t* pModel = new ModelInfo_t;
D3DXMATRIX ProjMatrix, ViewMatrix, WorldMatrix;
D3DXVECTOR3 VectorMiddle(0, 0, 0), ScreenMiddle(0, 0, 0);
Device->GetViewport(&viewport);
Device->GetVertexShaderConstantF(204, ProjMatrix, 4);
Device->GetVertexShaderConstantF(223, ViewMatrix, 4);
D3DXMatrixIdentity(&WorldMatrix);
D3DXMatrixTranspose(&ViewMatrix, &ViewMatrix);
D3DXMatrixTranspose(&ProjMatrix, &ProjMatrix);
D3DXVec3Project(&VectorMiddle, &pModel->Position3D, &viewport, &ProjMatrix, &ViewMatrix, &WorldMatrix);
// if (VectorMiddle.z < 1.0f && ProjMatrix._44 < 1.0f) //not sure
// {
pModel->Position2D.x = VectorMiddle.x;
pModel->Position2D.y = VectorMiddle.y;
pModel->Position2D.z = VectorMiddle.z;
//}
ModelInfo.push_back(pModel);
}
BOOL aim_key_down = FALSE;
DOUBLE last_x = 0;
DWORD shit;
DWORD hPlayerDLL;
BOOL crosshair_on_enemy = FALSE;
int distx;
int old_distx = 0;
int new_distx = 1;
float disty;
HRESULT __stdcall myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 Device, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex, UINT nVertices, UINT sIndex, UINT pCount) {
//get stride
if(Device->GetStreamSource(0, &pStreamData, &XOffset, &Stride) == D3D_OK)
if( pStreamData != NULL ){ pStreamData->Release(); pStreamData = NULL; }
//get psdata
if (SUCCEEDED(Device->GetPixelShader(&pShader)))
if (pShader != NULL)
if (SUCCEEDED(pShader->GetFunction(NULL, &psData)))
if (pShader != NULL){ pShader->Release(); pShader = NULL; }
//get vsdata
if (SUCCEEDED(Device->GetVertexShader(&vShader)))
if (vShader != NULL)
if (SUCCEEDED(vShader->GetFunction(NULL, &vsData)))
if (vShader != NULL){ vShader->Release(); vShader = NULL; }
Device->SetRenderState(D3DRS_LIGHTING, false); //d3d lighting off
Device->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255));
Device->SetRenderState( D3DRS_FOGENABLE, false );
if (nVertices == 8 && pCount == 12) {
Device->SetRenderState( D3DRS_ZENABLE, false );
Device->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
Device->SetTexture( 1, g_pTexRed );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Device->SetRenderState( D3DRS_ZENABLE, true );
Device->SetTexture( 1, g_pTexRed );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
}
if (cb_wireframe == TRUE) {
if (Stride == 28/*nVertices != 4*/) {
Device->SetRenderState(D3DRS_ZENABLE, true);
Device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
Device->SetTexture( 0, NULL );
Device->SetTexture( 1, NULL );
Device->SetTexture( 2, NULL );
Device->SetTexture( 3, NULL );
Device->SetTexture( 4, NULL );
Device->SetTexture( 5, NULL );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
}
}
if (Stride == 40) {
Device->SetRenderState( D3DRS_ZENABLE, false );
Device->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
Device->SetTexture( 1, g_pTexRed );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Device->SetRenderState( D3DRS_ZENABLE, true );
Device->SetTexture( 1, g_pTexRed );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
}
/* soviet head */
if (b_menu_items[2] == TRUE) {
if (nVertices == 1938 || nVertices == 2245) {
Device->SetRenderState( D3DRS_ZENABLE, false );
Device->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
Device->SetTexture( 1, g_pTexTur );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Device->SetRenderState( D3DRS_ZENABLE, true );
Device->SetTexture( 1, g_pTexTur );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Worldtoscreen(Device);
}
}
/* us head */
if (b_menu_items[1] == TRUE) {
if (nVertices == 2060 || nVertices == 2263) {
Device->SetRenderState( D3DRS_ZENABLE, false );
Device->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
Device->SetTexture( 1, g_pTexTur );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Device->SetRenderState( D3DRS_ZENABLE, true );
Device->SetTexture( 1, g_pTexTur );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Worldtoscreen(Device);
}
}
/* german head */
if (b_menu_items[0] == TRUE) {
if ((nVertices == 2063 && pCount == 2500) || (nVertices == 2245 && pCount == 3970)) {
Device->SetRenderState( D3DRS_ZENABLE, false );
Device->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
Device->SetTexture( 1, g_pTexTur );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Device->SetRenderState( D3DRS_ZENABLE, true );
Device->SetTexture( 1, g_pTexTur );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Worldtoscreen(Device);
}
}
// soviet granata
if ((nVertices == 2509 && pCount == 3964) || (nVertices == 629 && pCount == 563)) {
Device->SetRenderState( D3DRS_ZENABLE, false );
Device->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
Device->SetTexture( 1, g_pTexOrange );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
Device->SetRenderState( D3DRS_ZENABLE, true );
Device->SetTexture( 1, g_pTexOrange );
OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
}
return OrigDrawIndexedPrimitive(Device, Type, BaseVertexIndex, MinIndex, nVertices, sIndex, pCount);
}
HRESULT __stdcall myEndScene(LPDIRECT3DDEVICE9 Device) {
if(g_pTexRed == NULL) D3DXCreateTextureFromFileInMemory(Device, (LPCVOID)&red, sizeof(red), &g_pTexRed);
if(g_pTexOrange == NULL) D3DXCreateTextureFromFileInMemory(Device, (LPCVOID)&orange, sizeof(orange), &g_pTexOrange);
if(g_pTexTur == NULL) D3DXCreateTextureFromFileInMemory(Device, (LPCVOID)&tur, sizeof(tur), &g_pTexTur);
if(g_pLine == NULL) D3DXCreateLine(Device, &g_pLine);
if(g_pFont == NULL) D3DXCreateFont(Device, 15, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana", &g_pFont);
DrawString(10, 5, 0xFF00FF00, "home key - menu, delete - toggle, arrow keys - move");
if (cb_menu == TRUE) {
DrawFilledRectangle(0, 100, menu_w, menu_h + title_h, fontBlue, Device);
DrawFilledRectangle(menu_mouse_pos_x * menu_w, 100 + title_h + (menu_mouse_pos * (menu_h / menu_size)), menu_w, menu_h / menu_size, fontWhite, Device);
if (menu_w == menu_w_max){
DrawString(10, 100, 0xFF00CC00, "lavas ILU codename magma");
for (int i = 0; i < menu_size; i++) {
if (i == menu_mouse_pos) DrawString(10, 100 + title_h + (i * (menu_h / menu_size)), 0xFF000000, menu_items[i]);
else DrawString(10, 100 + title_h + (i * (menu_h / menu_size)), 0xFFFFFFFF, menu_items[i]);
if (b_menu_items[i] == TRUE) DrawFilledCircle(menu_w - 25, 100 + title_h + (i * (menu_h / menu_size)) -1, 1, fontGreen, Device);
}
if (cb_third_menu == TRUE) {
if (menu_mouse_pos_x == 0) DrawFilledRectangle(menu_w, 282, third_menu_w, third_menu_h, fontBlue, Device);
if (menu_mouse_pos_x == 1) DrawString(menu_w +10, 285, 0xFF000000, third_menu_items[0]);
else DrawString(menu_w +10, 285, 0xFFFFFFFF, third_menu_items[0]);
if (b_third_menu_items[0] == TRUE) DrawFilledCircle(2 * menu_w - 25, 100 + title_h + (9 * (menu_h / menu_size)) -1, 1, fontGreen, Device);
}
}
}
if (b_menu_items[4] == TRUE) {
GetClientRect(FindWindowA(0, "H&G"), &rect);
DrawLine(Device, rect.left + rect.right /2 -12, rect.bottom /2 -12, rect.right /2 -2, rect.bottom /2 -2, 2, (crosshair_on_enemy == FALSE ? fontWhite : fontGreen));
DrawLine(Device, rect.left + rect.right /2 +12, rect.bottom /2 -12, rect.right /2 +2, rect.bottom /2 -2, 2, (crosshair_on_enemy == FALSE ? fontWhite : fontGreen));
DrawLine(Device, rect.left + rect.right /2 -12, rect.bottom /2 +12, rect.right /2 -2, rect.bottom /2 +2, 2, (crosshair_on_enemy == FALSE ? fontWhite : fontGreen));
DrawLine(Device, rect.left + rect.right /2 +12, rect.bottom /2 +12, rect.right /2 +2, rect.bottom /2 +2, 2, (crosshair_on_enemy == FALSE ? fontWhite : fontGreen));
/*DrawFilledRectangle(rect.left + rect.right / 2 - 11, rect.bottom / 2, 20, 1, fontWhite, Device);
DrawFilledRectangle(rect.left + rect.right / 2 -1, rect.bottom / 2 - 10, 1, 20, fontWhite, Device); */
}
/*if (ModelInfo2.size() != NULL) {
for (size_t i = 0; i < ModelInfo.size(); i += 1) {
DrawString((int)ModelInfo2[i]->Position2D.x, (int)ModelInfo2[i]->Position2D.y, 0xFFFF00FF, "fog");
}
}*/
//if (ModelInfo.size() != NULL) {
if (ModelInfo.size() != NULL) {
UINT BestTarget = -1;
DOUBLE fClosestPos = 99999999;
for (size_t i = 0; i < ModelInfo.size(); i += 1) {
//get screen center
float ScreenCenterX = viewport.Width / 2.0f;
float ScreenCenterY = viewport.Height / 2.0f;
//aimfov
float radiusx = aimfov * (ScreenCenterX / 100);
float radiusy = aimfov * (ScreenCenterY / 100);
//get crosshairdistance
ModelInfo[i]->CrosshairDistance = GetDistance(ModelInfo[i]->Position2D.x, ModelInfo[i]->Position2D.y, ScreenCenterX, ScreenCenterY);
//if in fov
//if (ModelInfo[i]->Position2D.x >= ScreenCenterX - radiusx && ModelInfo[i]->Position2D.x <= ScreenCenterX + radiusx && ModelInfo[i]->Position2D.y >= ScreenCenterY - radiusy && ModelInfo[i]->Position2D.y <= ScreenCenterY + radiusy) {
//get closest/nearest target to crosshair
if (ModelInfo[i]->CrosshairDistance < fClosestPos) {
fClosestPos = ModelInfo[i]->CrosshairDistance;
BestTarget = i;
}
//}
//drawpoint on targets (Esp)
DrawString((int)ModelInfo[i]->Position2D.x, (int)ModelInfo[i]->Position2D.y, 0xFFFF00FF, "Z: %i", (int)(ModelInfo[i]->Position2D.z * 1000000 - 990000 - 3603));
//new_distx = (int)(ModelInfo[i]->Position2D.z * 1000000 - 990000 - 3603);
}
//if nearest target to crosshair
if (BestTarget != -1) {
GetClientRect(FindWindowA(0, "H&G"), &rect);
DrawLine(Device, rect.right /2, rect.bottom /2, ModelInfo[BestTarget]->Position2D.x, ModelInfo[BestTarget]->Position2D.y, 1, fontBlue);
//double DistX = (double)ModelInfo[BestTarget]->Position2D.x - viewport.Width / 2.0f;
double DistY = (double)ModelInfo[BestTarget]->Position2D.y - viewport.Height / 2.0f;
DrawString(10, 20, 0xFFAA00FF, " %f", ModelInfo[BestTarget]->Position2D.x - viewport.Width / 2.0f);
DistY -= (999 - (int)(ModelInfo[BestTarget]->Position2D.z * 100000 - 99000)) / 2.1; // 2.1 is for 800x600 make it less if you have bigger res like 1.2 maybe was for 1650x1280
distx = (ModelInfo[BestTarget]->Position2D.x - viewport.Width / 2.0f);
DrawString(200, 45, 0xFFAA00FF, " %f", ModelInfo[BestTarget]->Position2D.x);
//aimsmooth
distx /= aimsmooth;
DistY /= aimsmooth;
if ((GetAsyncKeyState(aimkey) & 0x8000)) {
mouse_event(MOUSEEVENTF_MOVE, 0/*(DWORD)DistX*/, (DWORD)DistY, NULL, NULL); //doaim, move mouse to x & y
// moving mouse x in mem for more accurate
shit = *(DWORD*)(hPlayerDLL + 0xBF8734);
float f_distx = (0.0012822152966337 * distx);
if (GetAsyncKeyState(VK_RBUTTON) & 0x8000) {
//if (std::abs(distx) > 1000) {
*(float*)(shit + 0x4B8) += f_distx /2 * -1;
//}
} else *(float*)(shit + 0x4B8) += f_distx * -1;
}
}
ModelInfo.clear();
}
return OrigEndScene(Device);
}
//----------------------------------------------------------------------------------------------------------
bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask) {
for(;*szMask;++szMask,++pData,++bMask)
if(*szMask=='x' && *pData!=*bMask )
return false;
return (*szMask) == NULL;
}
DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask) {
for(DWORD i=0; i < dwLen; i++)
if( bCompare( (BYTE*)( dwAddress+i ),bMask,szMask) )
return (DWORD)(dwAddress+i);
return 0;
}
int spawned_changed;
BOOL mouse_up = FALSE;
BOOL rigth_mouse_down = FALSE;
int old_headshot_val = 0;
// START SOUNDS
BOOL b_first_blood = FALSE;
BOOL one_minute = FALSE;
BOOL ten = FALSE;
BOOL nine = FALSE;
BOOL eight = FALSE;
BOOL seven = FALSE;
BOOL six = FALSE;
BOOL five = FALSE;
BOOL four = FALSE;
BOOL three = FALSE;
BOOL two = FALSE;
BOOL one = FALSE;
int old_ammo_count = 0;
int rand_reload_sound = 0;
BOOL reloading = FALSE;
DWORD dw_no_recoil;
DWORD dw_faster_aim;
char buffer[33];
void got_spawned() {
DWORD pointed;
int i_rand;
for (;; Sleep(10)) {
if (b_menu_items[10] == TRUE) {
if (*(int*)(hPlayerDLL + 0xBF9090) != spawned_changed) {
spawned_changed = *(int*)(hPlayerDLL + 0xBF9090);
// getting sleep time
srand (time(NULL));
i_rand = rand() % 6 + 4; // <-- secconds
Sleep(i_rand * 1000);
//Sleep(3500);
// choiceing file
srand (time(NULL));
rand_reload_sound = rand() % 3 + 1;
PlaySound(NULL, 0, 0);
if (i_rand == 1) {
PlaySound("sound_mod\\start\\benefit_nice.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (i_rand == 2) {
PlaySound("sound_mod\\start\\im_gonna_get_medieval.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (i_rand == 3) {
PlaySound("sound_mod\\start\\many_babes_little_time.wav", NULL, SND_FILENAME || SND_ASYNC);
}
}
}
}
}
void lavaaaa() {
MessageBoxA(0, "it seems its working :)", "seccond-meth", 0);
DWORD *vtbl;
DWORD hD3D = 0;
do {
//MessageBoxA(0, "getting d3d9", "third-meth", 0);
hD3D = (DWORD)GetModuleHandleA("d3d9.dll");
Sleep(10);
} while (!hD3D);
DWORD adre = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
do {
hPlayerDLL = (DWORD)GetModuleHandleA("player.dll");
Sleep(10);
} while (!hPlayerDLL);
dw_no_recoil = FindPattern(hPlayerDLL, 0x328000, (PBYTE)"\x75\x7C\x80\x7D\xEF\x00", "xxxxxx");
dw_faster_aim = FindPattern(hPlayerDLL, 0x328000, (PBYTE)"\x0F\xB6\xC0\x50\x6A\x01\xE8", "xxxxxxx") - 0x44;
if (dw_no_recoil) {
WriteToMemory((dw_no_recoil), "\xEB\x7C", 2);
}
//WriteToMemory((hPlayerDLL + 0x1D71A2), "\xEB\x0D", 2);
//WriteToMemory((hPlayerDLL + 0x1D716D), "\xEB\x75", 2);
//WriteToMemory((hPlayerDLL + 0x18CBDB), "\xEB\x75", 2);
if (adre) {
memcpy(&vtbl, (void*)(adre + 2), 4);
//ms detours 3.0
OrigDrawIndexedPrimitive = (HRESULT(__stdcall*)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT))vtbl[82];
OrigEndScene = (HRESULT(__stdcall*)(LPDIRECT3DDEVICE9))vtbl[42];
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)OrigDrawIndexedPrimitive, myDrawIndexedPrimitive);
DetourAttach(&(PVOID&)OrigEndScene, myEndScene);
DetourTransactionCommit();
}
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&got_spawned, 0, 0, 0);
//CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&nice_aim, 0, 0, 0);
for (;;) {
/*
if (GetAsyncKeyState(VK_DELETE) && 1) {
MessageBoxA(0, "you like meth", "third-meth", 0);
}*/
if (b_menu_items[8] == TRUE) {
if (FindWindowA(0, "H&G") == GetForegroundWindow()) {
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
mouse_event(0x00000004, 0, 0, 0, 0);
mouse_event(0x00000002, 0, 0, 0, 0);
if (mouse_up == true) {
mouse_up = false;
}
} else {
if (mouse_up == false) {
mouse_event(0x00000004, 0, 0, 0, 0);
mouse_up = true;
}
}
}
}
// 1-st person aim when zoom
if (b_menu_items[9] == TRUE && b_third_menu_items[0] == TRUE) {
if (GetAsyncKeyState(VK_RBUTTON) & 0x8000) {
if (rigth_mouse_down == FALSE) {
rigth_mouse_down = TRUE;
WriteToMemory((hPlayerDLL + 0x1C00A9), "\xF6\x86\xDF\x00\x00\x00\x08", 7);
}
} else if (rigth_mouse_down == TRUE) {
rigth_mouse_down = FALSE;
WriteToMemory((hPlayerDLL + 0x1C00A9), "\xC6\x86\xDF\x00\x00\x00\x08", 7);
}
}
if (b_menu_items[10] == TRUE) {
if (one == FALSE) {
DWORD ppointed = *(DWORD*)(hPlayerDLL + 0xBF970C);
if (*(int*)(ppointed + 0x128) == 59 && one_minute == FALSE) {
PlaySound("sound_mod\\start\\one_minute.wav", NULL, SND_FILENAME || SND_ASYNC);
one_minute = TRUE;
} else if (*(int*)(ppointed + 0x128) == 9 && ten == FALSE) {
PlaySound("sound_mod\\start\\ten.wav", NULL, SND_FILENAME || SND_ASYNC);
ten = TRUE;
} else if (*(int*)(ppointed + 0x128) == 8 && nine == FALSE) {
PlaySound("sound_mod\\start\\nine.wav", NULL, SND_FILENAME || SND_ASYNC);
nine = TRUE;
} else if (*(int*)(ppointed + 0x128) == 7 && eight == FALSE) {
PlaySound("sound_mod\\start\\eight.wav", NULL, SND_FILENAME || SND_ASYNC);
eight = TRUE;
} else if (*(int*)(ppointed + 0x128) == 6 && seven == FALSE) {
PlaySound("sound_mod\\start\\seven.wav", NULL, SND_FILENAME || SND_ASYNC);
seven = TRUE;
} else if (*(int*)(ppointed + 0x128) == 5 && six == FALSE) {
PlaySound("sound_mod\\start\\six.wav", NULL, SND_FILENAME || SND_ASYNC);
six = TRUE;
} else if (*(int*)(ppointed + 0x128) == 4 && five == FALSE) {
PlaySound("sound_mod\\start\\five.wav", NULL, SND_FILENAME || SND_ASYNC);
five = TRUE;
} else if (*(int*)(ppointed + 0x128) == 3 && four == FALSE) {
PlaySound("sound_mod\\start\\four.wav", NULL, SND_FILENAME || SND_ASYNC);
four = TRUE;
} else if (*(int*)(ppointed + 0x128) == 2 && three == FALSE) {
PlaySound("sound_mod\\start\\three.wav", NULL, SND_FILENAME || SND_ASYNC);
three = TRUE;
} else if (*(int*)(ppointed + 0x128) == 1 && two == FALSE) {
PlaySound("sound_mod\\start\\two.wav", NULL, SND_FILENAME || SND_ASYNC);
two = TRUE;
} else if (*(int*)(ppointed + 0x128) == 0 && two == TRUE && one == FALSE) {
PlaySound("sound_mod\\start\\one.wav", NULL, SND_FILENAME || SND_ASYNC);
one = TRUE;
}
}
DWORD pointed;
/* sp
DWORD pointed = *(DWORD*)(hPlayerDLL + 0x00BF74C8);
pointed = *(DWORD*)(pointed + 0x8);
pointed = *(DWORD*)(pointed + 0x158);
pointed = *(DWORD*)(pointed + 0x184);
pointed = *(DWORD*)(pointed + 0x58);
if (old_headshot_val != *(int*)(pointed + 0x2C)) {
old_headshot_val = *(int*)(pointed + 0x2C);
PlaySound(NULL, 0, 0);
PlaySound("holy_shit.wav", NULL, SND_FILENAME);
}*/
pointed = *(DWORD*)(hPlayerDLL + 0x00BF98C0);
pointed = *(DWORD*)(pointed + 0x394);
pointed = *(DWORD*)(pointed + 0x258);
//pointed = *(DWORD*)(pointed + 0x704);
//pointed = *(DWORD*)(pointed + 0x5F4);
if ((pointed != NULL) && old_headshot_val != *(int*)(pointed + 0x2C)) {
old_headshot_val = *(int*)(pointed + 0x2C);
if (b_first_blood == FALSE) {
PlaySound(NULL, 0, 0);
PlaySound("sound_mod\\first_blood.wav", NULL, SND_FILENAME || SND_ASYNC);
b_first_blood = TRUE;
} else {
srand (time(NULL));
rand_reload_sound = rand() % 7 + 1;
PlaySound(NULL, 0, 0);
if (rand_reload_sound == 1) {
PlaySound("sound_mod\\head_hunter.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (rand_reload_sound == 2) {
PlaySound("sound_mod\\now_you_see_me_now_ur_dead.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (rand_reload_sound == 3) {
PlaySound("sound_mod\\smells_rotten.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (rand_reload_sound == 4) {
PlaySound("sound_mod\\sdie_bitch.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (rand_reload_sound == 5) {
PlaySound("sound_mod\\beautiful.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (rand_reload_sound == 6) {
PlaySound("sound_mod\\gotta_hurt.wav", NULL, SND_FILENAME || SND_ASYNC);
} else if (rand_reload_sound == 7) {
PlaySound("sound_mod\\damn_im_good.wav", NULL, SND_FILENAME || SND_ASYNC);
}
}
}
// saying reloading (old one)
//pointed = *(DWORD*)(hPlayerDLL + 0xBF9470);
//if (*(int*)(pointed + 0xCC) != old_ammo_count) {
// if (*(int*)(pointed + 0xCC) > old_ammo_count) {
// // starting to reload starting sound
// PlaySound(NULL, 0, 0);
// PlaySound("sound_mod\\first_blood.wav", NULL, SND_FILENAME || SND_ASYNC);
// }
// old_ammo_count = *(int*)(pointed + 0xCC);
//}
//if (reloading == FALSE) {
// pointed = *(DWORD*)(hPlayerDLL + 0xBF98C0);
// if (*(int*)(pointed + 0x374) != 0) {
// pointed = *(DWORD*)(hPlayerDLL + 0xBF98C0);
// if (*(int*)(pointed + 0xCC) == 0) {
// // playing reload sound
// // taking random sound
// srand (time(NULL));
// rand_reload_sound = rand() % 6 + 1;
// std::string talk_reload = "sound_mod\\reload\\reloading";
// talk_reload += itoa(rand_reload_sound, buffer, 10);
// talk_reload += ".wav";
// PlaySound(talk_reload.c_str(), NULL, SND_FILENAME || SND_ASYNC);
// reloading = TRUE;
// }
// } else {
// pointed = *(DWORD*)(hPlayerDLL + 0xBF98C0);
// if (*(int*)(pointed + 0xCC) == 0) {
// // playing reload sound
// // taking random sound
// srand (time(NULL));
// rand_reload_sound = rand() % 5 + 1;
// std::string talk_reload = "sound_mod\\frag_out\\granata";
// talk_reload += itoa(rand_reload_sound, buffer, 10);
// talk_reload += ".wav";
// PlaySound(talk_reload.c_str(), NULL, SND_FILENAME || SND_ASYNC);
// reloading = TRUE;
// }
// }
//} else {
// pointed = *(DWORD*)(hPlayerDLL + 0xBF98C0);
// if (*(int*)(pointed + 0xCC) != 0) {
// if (reloading == TRUE) reloading = FALSE;
// }
//}
}
if (GetAsyncKeyState(0x58) & 1) cb_wireframe = !cb_wireframe;
else if (GetAsyncKeyState(VK_HOME) & 1) {
if (cb_menu == FALSE) {
menu_w = 0;
cb_menu = TRUE;
} else {
for (int i = 0; i < menu_w_max; i++){
Sleep(time_to_flow);
menu_w--;
}
cb_menu = FALSE;
}
if (cb_menu == TRUE) {
for (int i = 0; i < menu_w_max; i++){
Sleep(time_to_flow);
menu_w++;
}
}
} else if (cb_menu == TRUE) {
if (GetAsyncKeyState(VK_DOWN) & 1) {
if (menu_mouse_pos_x == 0) {
if (menu_mouse_pos == menu_size -1) menu_mouse_pos = 0;
else menu_mouse_pos++;
}
} else if (GetAsyncKeyState(VK_UP) & 1) {
if (menu_mouse_pos_x == 0) {
if (menu_mouse_pos == 0) menu_mouse_pos = menu_size -1;
else menu_mouse_pos--;
}
} else if (GetAsyncKeyState(VK_RIGHT) & 1) {
if (menu_mouse_pos == 9 && b_menu_items[9] == TRUE) menu_mouse_pos_x = 1;
} else if (GetAsyncKeyState(VK_LEFT) & 1) {
if (menu_mouse_pos_x == 1) menu_mouse_pos_x = 0;
} else if (GetAsyncKeyState(VK_DELETE) & 1) {
if (menu_mouse_pos_x == 0) {
b_menu_items[menu_mouse_pos] = !b_menu_items[menu_mouse_pos];
/*if (menu_mouse_pos == 3) {
if (b_menu_items[3] == TRUE) {
WriteToMemory((hPlayerDLL + 0x1FC54B), "\x90\x90", 2);
WriteToMemory((hPlayerDLL + 0x1FC553), "\xC6\x81\xDF\x00\x00\x00\x30", 7);
WriteToMemory((hPlayerDLL + 0x1FC55A), "\xEB\x0D", 2);
} else if (b_menu_items[3] == FALSE) {
WriteToMemory((hPlayerDLL + 0x1FC54B), "\x75\x3D", 2);
WriteToMemory((hPlayerDLL + 0x1FC553), "\x80\xB9\xDF\x00\x00\x00\x40", 7);
WriteToMemory((hPlayerDLL + 0x1FC55A), "\x74\x0A", 2);
}
} else */if (menu_mouse_pos == 5) {
if (b_menu_items[5] == TRUE) {
// fater aim
WriteToMemory((dw_faster_aim + 0x5C), "\xE9\xB2\x00\x00\x00\x90\x90\x90", 8);
} else if (b_menu_items[5] == FALSE) {
WriteToMemory((dw_faster_aim + 0x5C), "\x75\x36\xD9\x05\x68\x99\x43\x03", 8);
}
} else if (menu_mouse_pos == 6) {
if (b_menu_items[6] == TRUE) {
// quick aim
WriteToMemory((dw_faster_aim), "\xE9\x0E\x01\x00\x00\x90", 6);
} else if (b_menu_items[6] == FALSE) {
WriteToMemory((dw_faster_aim), "\x0F\x84\xB9\x00\x00\x00", 6);
}
} else if (menu_mouse_pos == 7) {
//if (b_menu_items[7] == TRUE) {
// // stable aim
// WriteToMemory((dw_faster_aim + 0x21), "\x6A\x00", 2);
//} else if (b_menu_items[7] == FALSE) {
// WriteToMemory((dw_faster_aim + 0x21), "\x6A\x01", 2);
//}
} else if (menu_mouse_pos == 9) {
// 3d person view
if (b_menu_items[9] == TRUE) {
WriteToMemory((hPlayerDLL + 0x1C00A9), "\xC6\x86\xDF\x00\x00\x00\x08", 7);
cb_third_menu = TRUE;
} else if (b_menu_items[9] == FALSE) {
WriteToMemory((hPlayerDLL + 0x1C00A9), "\xF6\x86\xDF\x00\x00\x00\x08", 7);
cb_third_menu = FALSE;
}
}
} else if (menu_mouse_pos_x == 1) {
if (menu_mouse_pos == 9) {
b_third_menu_items[0] = !b_third_menu_items[0];
}
}
}
}
Sleep(10);
}
}
void fukHng() {
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&lavaaaa, 0, 0, 0);
//lavaaaa();
}