如果有谁需要sxefeng和大宝的作弊器的原代码我可以发给大家。 #pragma once
#ifndef HEADER_H
#define HEADER_H
#pragma comment(lib,"OpenGL32.lib")
#pragma comment(lib,"GLu32.lib")
#pragma comment(lib,"GLaux.lib")
#pragma warning(disable:4700)
#pragma warning(disable:4805)
#pragma warning(disable:4312)
#include <Windows.h>
#include <stdio.h>
#include <process.h>
#include <math.h>
#include <shellapi.h>
#include <wininet.h>
#include <gl\gl.h>在发大宝的都只发一部分#define _WIN32_WINNT 0x0500
#include<windows.h>
#include<stdio.h>
#include<math.h>
#include"Headers/Mosquito.h"
#include"Headers/DynamicFunctions.h"
#include"Headers/CalculateScreen.h"
#include"Headers/Config.h"
#define PROGRAM_CAPTION "Mosquito"
#define PROGRAM_INFORMATION PROGRAM_CAPTION " Information"
#define PROGRAM_AUTHOR "ViscountPherget"
#define M_PI 3.14159265358979323846 //matches value in gcc v2 math.h
HWND handle_window;
DWORD process_identifier;
HANDLE handle_process;
HDC handle_device_context;
RECT rect_window;
extern int screen_center_x;
extern int screen_center_y;
settings_struct settings[20];
PDWORD hud_player_info_pointer_pointer;
PDWORD hud_player_info_pointer_pointer_cs16 = (PDWORD)0x01950658;
PDWORD ref_params_pointer_pointer;
PDWORD ref_params_pointer_pointer_hl_steam = (PDWORD)0x01D0F99F;
PDWORD cl_entity_pointer_pointer;
PDWORD cl_entity_pointer_pointer_hl_steam = (PDWORD)0x01EF4F84;
PDWORD model_pointer_pointer;
PDWORD model_pointer_pointer_hl_steam = (PDWORD)0x02F4E4D4;
PDWORD fov_pointer_pointer;
PDWORD fov_pointer_pointer_hl_steam = (PDWORD)0x0190EBE8;
PDWORD hud_player_info_pointer;
PDWORD ref_params_pointer;
PDWORD cl_entity_pointer;
PDWORD model_pointer;
PDWORD fov_pointer;
hud_player_info_t hud_player_info_struct[32];
char player_name[MAX_SCOREBOARDNAME];
char player_model[MAX_QPATH];
ref_params_t ref_params_struct;
cl_entity_t cl_entity_struct[32];
model_t model_struct[2];
float zoom;
void Initialize();
void Mosquito();
BYTE GetCurrentTeam(hud_player_info_t*);
double CalculateDistance(float*,float*);
bool IsValidTarget(float*);
void AimAtTarget(BYTE,float*);
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
LoadLibrary("user32.dll");
if(!GetFirstDynamicFunctions())
{
return 0;
}
char mutex_caption[128];
sprintf(mutex_caption,"%s by %s (mutex)",PROGRAM_CAPTION,PROGRAM_AUTHOR);
DynamicCreateMutexA(0,true,mutex_caption);
if(DynamicGetLastError()!=ERROR_ALREADY_EXISTS)
{
Initialize();
}
else
{
DynamicCreateMutexA(0,true,"MessageBox (mutex)");
if(DynamicGetLastError()!=ERROR_ALREADY_EXISTS)
{
DynamicMessageBoxA(0,"The program is already running.",PROGRAM_INFORMATION,MB_ICONINFORMATION|MB_SETFOREGROUND|MB_TOPMOST);
}
else
{
DynamicSetForegroundWindow(DynamicFindWindowA("#32770",PROGRAM_INFORMATION));
}
}
return 0;
}
void Initialize()
{
char config_file_extension[] = "ini";
char config_file_name[253];
int i;
LoadLibrary("gdi32.dll");
if(!GetSecondDynamicFunctions())
{
return;
}
strcpy(settings[AIMBOT_BUTTON].description,"//0 = off, 1-5 = mouse button 1-5, 6 = aim always");
strcpy(settings[AIMBOT_BUTTON].value,"aimbot_button");
settings[AIMBOT_BUTTON].data = 1;
settings[AIMBOT_BUTTON].range[SETTINGS_MAXIMUM] = 6;
settings[AIMBOT_BUTTON].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[AIMBOT_DRAW_VECTOR].description,"//0 = off, 1 = on, draws a point where the aimbot aims");
strcpy(settings[AIMBOT_DRAW_VECTOR].value,"aimbot_draw_vector");
settings[AIMBOT_DRAW_VECTOR].data = 1;
settings[AIMBOT_DRAW_VECTOR].range[SETTINGS_MAXIMUM] = 1;
settings[AIMBOT_DRAW_VECTOR].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[AIMBOT_INVERSE].description,"//0 = normal, 1 = inverse, for inverse mouse");
strcpy(settings[AIMBOT_INVERSE].value,"aimbot_inverse");
settings[AIMBOT_INVERSE].data = 0;
settings[AIMBOT_INVERSE].range[SETTINGS_MAXIMUM] = 1;
settings[AIMBOT_INVERSE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[AIMBOT_METHOD].description,"//0 = SetCursorPos, 1 = ClipCursor, 2 = mouse_event, method of aiming");
strcpy(settings[AIMBOT_METHOD].value,"aimbot_method");
settings[AIMBOT_METHOD].data = 2;
settings[AIMBOT_METHOD].range[SETTINGS_MAXIMUM] = 2;
settings[AIMBOT_METHOD].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[AIMBOT_OFFSET_X].description,"//offset from player origin on the x-axis");
strcpy(settings[AIMBOT_OFFSET_X].value,"aimbot_offset_x");
settings[AIMBOT_OFFSET_X].data = 0;
settings[AIMBOT_OFFSET_X].range[SETTINGS_MAXIMUM] = 500;
settings[AIMBOT_OFFSET_X].range[SETTINGS_MINIMUM] = -500;
strcpy(settings[AIMBOT_OFFSET_Y].description,"//offset from player origin on the y-axis");
strcpy(settings[AIMBOT_OFFSET_Y].value,"aimbot_offset_y");
settings[AIMBOT_OFFSET_Y].data = 5;
settings[AIMBOT_OFFSET_Y].range[SETTINGS_MAXIMUM] = 500;
settings[AIMBOT_OFFSET_Y].range[SETTINGS_MINIMUM] = -500;
strcpy(settings[AIMBOT_OFFSET_Z].description,"//offset from player origin on the z-axis");
strcpy(settings[AIMBOT_OFFSET_Z].value,"aimbot_offset_z");
settings[AIMBOT_OFFSET_Z].data = 22;
settings[AIMBOT_OFFSET_Z].range[SETTINGS_MAXIMUM] = 500;
settings[AIMBOT_OFFSET_Z].range[SETTINGS_MINIMUM] = -500;
strcpy(settings[AIMBOT_SCAN_X].description,"//horizontal scan range from center");
strcpy(settings[AIMBOT_SCAN_X].value,"aimbot_scan_x");
settings[AIMBOT_SCAN_X].data = 120;
settings[AIMBOT_SCAN_X].range[SETTINGS_MAXIMUM] = 32767;
settings[AIMBOT_SCAN_X].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[AIMBOT_SCAN_Y].description,"//vertical scan range from center");
strcpy(settings[AIMBOT_SCAN_Y].value,"aimbot_scan_y");
settings[AIMBOT_SCAN_Y].data = 90;
settings[AIMBOT_SCAN_Y].range[SETTINGS_MAXIMUM] = 32767;
settings[AIMBOT_SCAN_Y].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_BOX].description,"//0 = off, 1 = static, 2 = dynamic, 3 = bounding box, shows a box on players");
strcpy(settings[ESP_BOX].value,"esp_box");
settings[ESP_BOX].data = 3;
settings[ESP_BOX].range[SETTINGS_MAXIMUM] = 3;
settings[ESP_BOX].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_BOX_LINE_SIZE].description,"//1 - 4 possible, size of the box line, line style only for size 1");
strcpy(settings[ESP_BOX_LINE_SIZE].value,"esp_box_line_size");
settings[ESP_BOX_LINE_SIZE].data = 2;
settings[ESP_BOX_LINE_SIZE].range[SETTINGS_MAXIMUM] = 4;
settings[ESP_BOX_LINE_SIZE].range[SETTINGS_MINIMUM] = 1;
strcpy(settings[ESP_BOX_LINE_STYLE].description,"//0 = solid, 1 = dashed, 2 = dotted, 3 = dash-dot, 4 = dash-dot-dot");
strcpy(settings[ESP_BOX_LINE_STYLE].value,"esp_box_line_style");
settings[ESP_BOX_LINE_STYLE].data = 0;
settings[ESP_BOX_LINE_STYLE].range[SETTINGS_MAXIMUM] = 4;
settings[ESP_BOX_LINE_STYLE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_BOX_SIZE].description,"//size of the box");
strcpy(settings[ESP_BOX_SIZE].value,"esp_box_size");
settings[ESP_BOX_SIZE].data = 20;
settings[ESP_BOX_SIZE].range[SETTINGS_MAXIMUM] = 200;
settings[ESP_BOX_SIZE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_DISTANCE].description,"//0 = off, 1 = on, shows distance to players in meters");
strcpy(settings[ESP_DISTANCE].value,"esp_distance");
settings[ESP_DISTANCE].data = 1;
settings[ESP_DISTANCE].range[SETTINGS_MAXIMUM] = 1;
settings[ESP_DISTANCE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_GAITSEQUENCE].description,"//0 = off, 1 = on, shows moving status of players");
strcpy(settings[ESP_GAITSEQUENCE].value,"esp_gaitsequence");
settings[ESP_GAITSEQUENCE].data = 1;
settings[ESP_GAITSEQUENCE].range[SETTINGS_MAXIMUM] = 1;
settings[ESP_GAITSEQUENCE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_NAME].description,"//0 = off, 1 = on, shows player names");
strcpy(settings[ESP_NAME].value,"esp_name");
settings[ESP_NAME].data = 1;
settings[ESP_NAME].range[SETTINGS_MAXIMUM] = 1;
settings[ESP_NAME].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_SEQUENCE].description,"//0 = off, 1 = on, shows action status of players");
strcpy(settings[ESP_SEQUENCE].value,"esp_sequence");
settings[ESP_SEQUENCE].data = 1;
settings[ESP_SEQUENCE].range[SETTINGS_MAXIMUM] = 1;
settings[ESP_SEQUENCE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[ESP_WEAPONS_PLAYER].description,"//0 = off, 1 = on, shows weapons of players");
strcpy(settings[ESP_WEAPONS_PLAYER].value,"esp_weapons_player");
settings[ESP_WEAPONS_PLAYER].data = 1;
settings[ESP_WEAPONS_PLAYER].range[SETTINGS_MAXIMUM] = 1;
settings[ESP_WEAPONS_PLAYER].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[FONT_SIZE].description,"//font size of esp in pixel");
strcpy(settings[FONT_SIZE].value,"font_size");
settings[FONT_SIZE].data = 11;
settings[FONT_SIZE].range[SETTINGS_MAXIMUM] = 0;
settings[FONT_SIZE].range[SETTINGS_MINIMUM] = 0;
strcpy(settings[KEY_ACTIVATE].description,"//key to activate/deactivate cheat, see keys.txt for a list of keys");
strcpy(settings[KEY_ACTIVATE].value,"key_activate");
settings[KEY_ACTIVATE].data = 46;
settings[KEY_ACTIVATE].range[SETTINGS_MAXIMUM] = 255;
settings[KEY_ACTIVATE].range[SETTINGS_MINIMUM] = 0;
CreateConfigFile(config_file_name,config_file_extension);
if(fopen(config_file_name,"rt")==0)
{
for(i = 0;i<(sizeof(settings)/sizeof(settings[0]));i++)
{
WriteConfigFile(config_file_name,settings.description,0);
WriteConfigFile(config_file_name,settings.value,&settings.data);
}
}
else
{
for(i = 0;i<(sizeof(settings)/sizeof(settings[0]));i++)
{
ReadConfigFile(config_file_name,settings.value,&settings.data);
}
}
while(handle_window==0)
{
handle_window = DynamicFindWindowA("Valve001",0);
DynamicSleep(1000);
}
DynamicGetWindowThreadProcessId(handle_window,&process_identifier);
handle_process = DynamicOpenProcess(PROCESS_VM_READ,0,process_identifier);
handle_device_context = DynamicGetDC(handle_window);
DynamicSetWindowLongA
(
handle_window,
GWL_STYLE,WS_POPUPWINDOW|WS_CLIPSIBLINGS|WS_VISIBLE
);
DynamicShowWindow(handle_window,SW_RESTORE);
DynamicGetClientRect(handle_window,&rect_window);
screen_center_x = rect_window.right/2;
screen_center_y = rect_window.bottom/2;
Mosquito();
}
void Mosquito()
{
bool running = true;
bool cheat_active = false;
bool key_activate_down = false;;
bool mouse_button_down = false;
BYTE mouse_button = 0;
float screen_position[2];
float aimbot_position[2];
float aimbot_origin_temporary[3];
float aimbot_origin[3];
bool aiming_active;
LOGFONT log_font;
LOGPEN log_pen;
LOGBRUSH log_brush;
POINT pen_point_size;
HFONT handle_font;
HPEN handle_pen_original;
HPEN handle_pen_default;
HPEN handle_pen_blue;
HPEN handle_pen_red;
HBRUSH handle_brush;
int i;
int j;
BYTE local_identifier = 0;
BYTE local_team = 0;
BYTE global_team;
bool result_calculate_screen;
bool result_calculate_aimbot;
PBYTE gaitsequence_list;
PBYTE sequence_list;
char** gaitsequence_string;
char** sequence_string;
char* gaitsequence_string_cs[] =
{
"",
"idle",
"crouched",
"walking",
"running",
"crouching",
"jumping"
};
BYTE gaitsequence_list_cs[] =
{
0,1,2,3,4,5,6 //0-6
};
BYTE sequence_list_cs_16[] =
{
0,0,0,0,0,0,0,0,1,2, //0-9
3,4,5,3,4,5,3,4,5,3, //10-19
4,5,3,4,4,5,3,4,4,5, //20-29
3,4,5,3,4,5,3,4,5,3, //30-39
4,5,3,4,5,3,4,5,3,4, //40-49
5,3,4,5,0,0,6,7,6,7, //50-59
8,9,8,9,10,3,4,4,5,3, //60-69
4,4,5,11,12,11,12,3,4,5, //70-79
3,4,5,13,14,13,14,15,16,15, //80-89
16,17,18,19,17,18,19,20,20,21, //90-99
22,0,0,0,0,0,0,0,0,0,0 //100-110
};
char* sequence_string_cs[] =
{
"",
"swimming",
"paddling",
"aiming",
"shooting",
"reloading",
"holding grenade",
"throwing grenade",
"holding C4",
"planting C4",
"matrix jumping",
"holding knife",
"stabbing knife",
"holding grenade (shield)",
"throwing grenade (shield)",
"holding knife (shield)",
"stabbing knife (shield)",
"aiming (shield)",
"shooting (shield)",
"reloading (shield)",
"shielded",
"body hit",
"head hit"
};
if
(
settings[AIMBOT_BUTTON].data>=settings[AIMBOT_BUTTON].range[SETTINGS_MINIMUM]&&
settings[AIMBOT_BUTTON].data<=settings[AIMBOT_BUTTON].range[SETTINGS_MAXIMUM]
)
{
if(settings[AIMBOT_BUTTON].data==1)
{
mouse_button = VK_LBUTTON;
}
if(settings[AIMBOT_BUTTON].data==2)
{
mouse_button = VK_RBUTTON;
}
if(settings[AIMBOT_BUTTON].data==3)
{
mouse_button = VK_MBUTTON;
}
if(settings[AIMBOT_BUTTON].data==4)
{
mouse_button = VK_XBUTTON1;
}
if(settings[AIMBOT_BUTTON].data==5)
{
mouse_button = VK_XBUTTON2;
}
}
if
(
settings[ESP_BOX_LINE_SIZE].data>=settings[ESP_BOX_LINE_SIZE].range[SETTINGS_MINIMUM]&&
settings[ESP_BOX_LINE_SIZE].data<=settings[ESP_BOX_LINE_SIZE].range[SETTINGS_MAXIMUM]
)
{
pen_point_size.x = (int)settings[ESP_BOX_LINE_SIZE].data;
}
else
{
pen_point_size.x = 1;
}
ZeroMemory(&log_pen,sizeof(log_pen));
if
(
settings[ESP_BOX_LINE_STYLE].data>=settings[ESP_BOX_LINE_STYLE].range[SETTINGS_MINIMUM]&&
settings[ESP_BOX_LINE_STYLE].data<=settings[ESP_BOX_LINE_STYLE].range[SETTINGS_MAXIMUM]
)
{
log_pen.lopnStyle = (int)settings[ESP_BOX_LINE_STYLE].data;
}
else
{
settings[ESP_BOX_LINE_STYLE].data = PS_SOLID;
}
log_pen.lopnWidth = pen_point_size;
ZeroMemory(&log_font,sizeof(log_font));
log_font.lfHeight = (long)-settings[FONT_SIZE].data;
log_font.lfWidth = 0;
log_font.lfEscapement = 0;
log_font.lfOrientation = 0;
log_font.lfWeight = FW_SEMIBOLD;
log_font.lfItalic = 0;
log_font.lfUnderline = 0;
log_font.lfStrikeOut = 0;
log_font.lfCharSet = ANSI_CHARSET;
log_font.lfOutPrecision = OUT_STROKE_PRECIS;
log_font.lfClipPrecision = CLIP_STROKE_PRECIS;
log_font.lfQuality = DRAFT_QUALITY;
log_font.lfPitchAndFamily = VARIABLE_PITCH|FF_SWISS;
strcpy(log_font.lfFaceName,"Verdana");
ZeroMemory(&log_brush,sizeof(log_brush));
log_brush.lbStyle = BS_NULL;
log_pen.lopnColor = RGB(0xFF,0xFF,0xFF);
handle_pen_default = DynamicCreatePenIndirect(&log_pen);
log_pen.lopnColor = RGB(0x99,0xCC,0xFF);
handle_pen_blue = DynamicCreatePenIndirect(&log_pen);
log_pen.lopnColor = RGB(0xFF,0x3F,0x3F);
handle_pen_red = DynamicCreatePenIndirect(&log_pen);
handle_pen_original = (HPEN)DynamicGetStockObject(DC_PEN);
handle_font = DynamicCreateFontIndirectA(&log_font);
DynamicSelectObject(handle_device_context,handle_font);
handle_brush = DynamicCreateBrushIndirect(&log_brush);
DynamicSelectObject(handle_device_context,handle_brush);
DynamicSetBkColor(handle_device_context,RGB(0,0,0));
DynamicSetBkMode(handle_device_context,TRANSPARENT);
DynamicSetTextAlign(handle_device_context,TA_CENTER|TA_NOUPDATECP);
hud_player_info_pointer_pointer = hud_player_info_pointer_pointer_cs16; //0x02F55A08
ref_params_pointer_pointer = ref_params_pointer_pointer_hl_steam; //0x02F6BD44
cl_entity_pointer_pointer = cl_entity_pointer_pointer_hl_steam;
model_pointer_pointer = model_pointer_pointer_hl_steam;
fov_pointer_pointer = fov_pointer_pointer_hl_steam;
gaitsequence_list = gaitsequence_list_cs;
sequence_list = sequence_list_cs_16;
gaitsequence_string = gaitsequence_string_cs;
sequence_string = sequence_string_cs;
while(running)
{
if(DynamicFindWindowA("Valve001",0)==0)
{
running = false;
}
if((DynamicGetAsyncKeyState((int)settings[KEY_ACTIVATE].data)&0x8000)==0x8000&&!key_activate_down)
{
cheat_active = !cheat_active;
key_activate_down = true;
}
else if((DynamicGetAsyncKeyState((int)settings[KEY_ACTIVATE].data)&0x8000)==0)
{
key_activate_down = false;
}
if((DynamicGetAsyncKeyState(mouse_button)&0x8000)==0x8000&&!mouse_button_down)
{
mouse_button_down = true;
}
else if((DynamicGetAsyncKeyState(mouse_button)&0x8000)==0)
{
mouse_button_down = false;
}
DynamicReadProcessMemory(handle_process,hud_player_info_pointer_pointer,&hud_player_info_pointer,4,0);
DynamicReadProcessMemory(handle_process,ref_params_pointer_pointer,&ref_params_pointer,4,0);
DynamicReadProcessMemory(handle_process,cl_entity_pointer_pointer,&cl_entity_pointer,4,0);
DynamicReadProcessMemory(handle_process,fov_pointer_pointer,&fov_pointer,4,0);
DynamicReadProcessMemory(handle_process,fov_pointer,&zoom,4,0);
//prevent crash on null pointer
if
(
cheat_active&&
hud_player_info_pointer!=0&&
ref_params_pointer!=0&&
cl_entity_pointer!=0
)
{
DynamicReadProcessMemory(handle_process,hud_player_info_pointer,hud_player_info_struct,sizeof(hud_player_info_struct),0);
DynamicReadProcessMemory(handle_process,ref_params_pointer,&ref_params_struct,sizeof(ref_params_struct),0);
DynamicReadProcessMemory(handle_process,cl_entity_pointer,cl_entity_struct,sizeof(cl_entity_struct),0);
for(i = 1;i<33;i++)
{
DynamicReadProcessMemory(handle_process,hud_player_info_struct[i-1].name,player_name,sizeof(player_name),0);
DynamicReadProcessMemory(handle_process,hud_player_info_struct[i-1].model,player_model,sizeof(player_model),0);
hud_player_info_struct[i-1].name = player_name;
hud_player_info_struct[i-1].model = player_model;
DynamicReadProcessMemory(handle_process,model_pointer_pointer+cl_entity_struct.curstate.weaponmodel-1,&model_pointer,4,0);
DynamicReadProcessMemory(handle_process,model_pointer,&model_struct[0],sizeof(model_struct[0]),0);
if(hud_player_info_struct[i-1].thisplayer==1)
{
local_identifier = (BYTE)i;
model_struct[1] = model_struct[0];
local_team = GetCurrentTeam(&hud_player_info_struct[i-1]);
continue;
}
if
(
cl_entity_struct.index!=0&&
cl_entity_struct.player==1&&
cl_entity_struct.curstate.solid!=SOLID_NOT&&
cl_entity_struct.curstate.messagenum>=cl_entity_struct[local_identifier].curstate.messagenum
)
{
result_calculate_screen = CalculateScreen(cl_entity_struct.origin,ref_params_struct.vieworg,ref_params_struct.viewangles,zoom,screen_position);
aimbot_origin_temporary[0] = settings[AIMBOT_OFFSET_Y].data;
aimbot_origin_temporary[1] = settings[AIMBOT_OFFSET_X].data;
aimbot_origin_temporary[2] = settings[AIMBOT_OFFSET_Z].data;
VectorRotateZ(aimbot_origin_temporary,cl_entity_struct.angles[1],aimbot_origin);
aimbot_origin[0] += cl_entity_struct.origin[0];
aimbot_origin[1] += cl_entity_struct.origin[1];
aimbot_origin[2] += cl_entity_struct.origin[2];
result_calculate_aimbot = CalculateScreen(aimbot_origin,ref_params_struct.vieworg,ref_params_struct.viewangles,zoom,aimbot_position);
}
else
{
continue;
}
if
(
!result_calculate_screen||
!result_calculate_aimbot
)
{
continue;
}
global_team = GetCurrentTeam(&hud_player_info_struct[i-1]);
if(global_team==1)
{
DynamicSetTextColor(handle_device_context,RGB(0x99,0xCC,0xFF));
DynamicSelectObject(handle_device_context,handle_pen_original);
DynamicSelectObject(handle_device_context,handle_pen_blue);
}
else if(global_team==2)
{
DynamicSetTextColor(handle_device_context,RGB(0xFF,0x3F,0x3F));
DynamicSelectObject(handle_device_context,handle_pen_original);
DynamicSelectObject(handle_device_context,handle_pen_red);
}
else
{
DynamicSetTextColor(handle_device_context,RGB(0xFF,0xFF,0xFF));
DynamicSelectObject(handle_device_context,handle_pen_original);
DynamicSelectObject(handle_device_context,handle_pen_default);
}
if(settings[ESP_GAITSEQUENCE].data==1)
{
DynamicTextOutA
(
handle_device_context,
(int)screen_position[0],
(int)screen_position[1]-(-log_font.lfHeight),
gaitsequence_string[gaitsequence_list[cl_entity_struct.curstate.gaitsequence]],
strlen(gaitsequence_string[gaitsequence_list[cl_entity_struct.curstate.gaitsequence]])
);
}
if(settings[ESP_SEQUENCE].data==1)
{
DynamicTextOutA
(
handle_device_context,
(int)screen_position[0],
(int)screen_position[1],
sequence_string[sequence_list[cl_entity_struct.curstate.sequence]],
strlen(sequence_string[sequence_list[cl_entity_struct.curstate.sequence]])
);
}
if(settings[ESP_DISTANCE].data==1)
{
char distance_string[8];
sprintf(distance_string,"%.2f m",((CalculateDistance(cl_entity_struct.origin,ref_params_struct.vieworg)*2.54)/100));
DynamicTextOutA
(
handle_device_context,
(int)screen_position[0],
(int)screen_position[1]+(-log_font.lfHeight),
distance_string,
strlen(distance_string)
);
}
if(settings[ESP_BOX].data==1)
{
DynamicRectangle
(
handle_device_context,
(int)(screen_position[0]-settings[ESP_BOX_SIZE].data),
(int)(screen_position[1]-settings[ESP_BOX_SIZE].data),
(int)(screen_position[0]+settings[ESP_BOX_SIZE].data),
(int)(screen_position[1]+settings[ESP_BOX_SIZE].data)
);
}
else if(settings[ESP_BOX].data==2)
{
double box_size;
double box_factor;
double box_distance = ((CalculateDistance(cl_entity_struct.origin,ref_params_struct.vieworg)*2.54)/100);
if
(
box_distance>0.5
)
{
box_factor = settings[ESP_BOX_SIZE].data*10;
box_size = box_factor/box_distance;
DynamicRectangle
(
handle_device_context,
(int)(screen_position[0]-box_size),
(int)(screen_position[1]-box_size),
(int)(screen_position[0]+box_size),
(int)(screen_position[1]+box_size)
);
}
}
else if(settings[ESP_BOX].data==3)
{
bool result_cs_box[8];
float box_position_temporary[8][3];
float box_position[8][3];
float box_screen_position[8][2];
POINT box_screen_square[2][4];
POINT box_screen_line[4][2];
box_position_temporary[0][0] = cl_entity_struct.curstate.mins[0];
box_position_temporary[0][1] = cl_entity_struct.curstate.mins[1];
box_position_temporary[0][2] = cl_entity_struct.curstate.mins[2];
box_position_temporary[1][0] = cl_entity_struct.curstate.mins[0];
box_position_temporary[1][1] = cl_entity_struct.curstate.mins[1];
box_position_temporary[1][2] = cl_entity_struct.curstate.maxs[2];
box_position_temporary[2][0] = cl_entity_struct.curstate.mins[0];
box_position_temporary[2][1] = cl_entity_struct.curstate.maxs[1];
box_position_temporary[2][2] = cl_entity_struct.curstate.mins[2];
box_position_temporary[3][0] = cl_entity_struct.curstate.mins[0];
box_position_temporary[3][1] = cl_entity_struct.curstate.maxs[1];
box_position_temporary[3][2] = cl_entity_struct.curstate.maxs[2];
box_position_temporary[4][0] = cl_entity_struct.curstate.maxs[0];
box_position_temporary[4][1] = cl_entity_struct.curstate.maxs[1];
box_position_temporary[4][2] = cl_entity_struct.curstate.mins[2];
box_position_temporary[5][0] = cl_entity_struct.curstate.maxs[0];
box_position_temporary[5][1] = cl_entity_struct.curstate.maxs[1];
box_position_temporary[5][2] = cl_entity_struct.curstate.maxs[2];
box_position_temporary[6][0] = cl_entity_struct.curstate.maxs[0];
box_position_temporary[6][1] = cl_entity_struct.curstate.mins[1];
box_position_temporary[6][2] = cl_entity_struct.curstate.mins[2];
box_position_temporary[7][0] = cl_entity_struct.curstate.maxs[0];
box_position_temporary[7][1] = cl_entity_struct.curstate.mins[1];
box_position_temporary[7][2] = cl_entity_struct.curstate.maxs[2];
for(j = 0;j<8;j++)
{
VectorRotateZ(box_position_temporary[j],cl_entity_struct.angles[1],box_position[j]);
}
box_position[0][0] += cl_entity_struct.origin[0];
box_position[0][1] += cl_entity_struct.origin[1];
box_position[0][2] += cl_entity_struct.origin[2];
box_position[1][0] += cl_entity_struct.origin[0];
box_position[1][1] += cl_entity_struct.origin[1];
box_position[1][2] += cl_entity_struct.origin[2];
box_position[2][0] += cl_entity_struct.origin[0];
box_position[2][1] += cl_entity_struct.origin[1];
box_position[2][2] += cl_entity_struct.origin[2];
box_position[3][0] += cl_entity_struct.origin[0];
box_position[3][1] += cl_entity_struct.origin[1];
box_position[3][2] += cl_entity_struct.origin[2];
box_position[4][0] += cl_entity_struct.origin[0];
box_position[4][1] += cl_entity_struct.origin[1];
box_position[4][2] += cl_entity_struct.origin[2];
box_position[5][0] += cl_entity_struct.origin[0];
box_position[5][1] += cl_entity_struct.origin[1];
box_position[5][2] += cl_entity_struct.origin[2];
box_position[6][0] += cl_entity_struct.origin[0];
box_position[6][1] += cl_entity_struct.origin[1];
box_position[6][2] += cl_entity_struct.origin[2];
box_position[7][0] += cl_entity_struct.origin[0];
box_position[7][1] += cl_entity_struct.origin[1];
box_position[7][2] += cl_entity_struct.origin[2];
for(j = 0;j<8;j++)
{
result_cs_box[j] = CalculateScreen(box_position[j],ref_params_struct.vieworg,ref_params_struct.viewangles,zoom,box_screen_position[j]);
}
if
(
result_cs_box[0]&&result_cs_box[1]&&
result_cs_box[2]&&result_cs_box[3]&&
result_cs_box[4]&&result_cs_box[5]&&
result_cs_box[6]&&result_cs_box[7]
)
{
box_screen_square[0][0].x = (long)box_screen_position[0][0];
box_screen_square[0][0].y = (long)box_screen_position[0][1];
box_screen_square[0][1].x = (long)box_screen_position[2][0];
box_screen_square[0][1].y = (long)box_screen_position[2][1];
box_screen_square[0][2].x = (long)box_screen_position[4][0];
box_screen_square[0][2].y = (long)box_screen_position[4][1];
box_screen_square[0][3].x = (long)box_screen_position[6][0];
box_screen_square[0][3].y = (long)box_screen_position[6][1];
box_screen_square[1][0].x = (long)box_screen_position[1][0];
box_screen_square[1][0].y = (long)box_screen_position[1][1];
box_screen_square[1][1].x = (long)box_screen_position[3][0];
box_screen_square[1][1].y = (long)box_screen_position[3][1];
box_screen_square[1][2].x = (long)box_screen_position[5][0];
box_screen_square[1][2].y = (long)box_screen_position[5][1];
box_screen_square[1][3].x = (long)box_screen_position[7][0];
box_screen_square[1][3].y = (long)box_screen_position[7][1];
box_screen_line[0][0].x = (long)box_screen_position[0][0];
box_screen_line[0][0].y = (long)box_screen_position[0][1];
box_screen_line[0][1].x = (long)box_screen_position[1][0];
box_screen_line[0][1].y = (long)box_screen_position[1][1];
box_screen_line[1][0].x = (long)box_screen_position[2][0];
box_screen_line[1][0].y = (long)box_screen_position[2][1];
box_screen_line[1][1].x = (long)box_screen_position[3][0];
box_screen_line[1][1].y = (long)box_screen_position[3][1];
box_screen_line[2][0].x = (long)box_screen_position[4][0];
box_screen_line[2][0].y = (long)box_screen_position[4][1];
box_screen_line[2][1].x = (long)box_screen_position[5][0];
box_screen_line[2][1].y = (long)box_screen_position[5][1];
box_screen_line[3][0].x = (long)box_screen_position[6][0];
box_screen_line[3][0].y = (long)box_screen_position[6][1];
box_screen_line[3][1].x = (long)box_screen_position[7][0];
box_screen_line[3][1].y = (long)box_screen_position[7][1];
DynamicPolygon(handle_device_context,box_screen_square[0],4);
DynamicPolygon(handle_device_context,box_screen_line[0],2);
DynamicPolygon(handle_device_context,box_screen_line[1],2);
DynamicPolygon(handle_device_context,box_screen_line[2],2);
DynamicPolygon(handle_device_context,box_screen_line[3],2);
DynamicPolygon(handle_device_context,box_screen_square[1],4);
}
}
if(settings[ESP_NAME].data==1)
{
if(hud_player_info_struct[i-1].name!=0)
{
DynamicTextOutA
(
handle_device_context,
(int)screen_position[0],
(int)screen_position[1]-(-log_font.lfHeight*2),
hud_player_info_struct[i-1].name,
strlen(hud_player_info_struct[i-1].name)
);
}
}
if(settings[ESP_WEAPONS_PLAYER].data==1)
{
BYTE weapon_string_index;
if(model_pointer!=0)
{
if
(
model_struct[0].name[7]=='p'&&
model_struct[0].name[8]=='_'
)
{
weapon_string_index = 9;
}
else if
( //shield
model_struct[0].name[14]=='p'&&
model_struct[0].name[15]=='_'
)
{
weapon_string_index = 16;
}
else
{
goto hell;
}
DynamicTextOutA
(
handle_device_context,
(int)screen_position[0],
(int)screen_position[1]-(-log_font.lfHeight*3),
&model_struct[0].name[weapon_string_index],
strlen(&model_struct[0].name[weapon_string_index])-4
);
hell:;
}
}
if(settings[AIMBOT_DRAW_VECTOR].data==1)
{
DynamicRectangle
(
handle_device_context,
(int)aimbot_position[0]-1,
(int)aimbot_position[1]-1,
(int)aimbot_position[0]+1,
(int)aimbot_position[1]+1
);
}
if
(
settings[AIMBOT_BUTTON].data==1||
settings[AIMBOT_BUTTON].data==2||
settings[AIMBOT_BUTTON].data==3||
settings[AIMBOT_BUTTON].data==4||
settings[AIMBOT_BUTTON].data==5||
settings[AIMBOT_BUTTON].data==6
)
{
if(settings[AIMBOT_BUTTON].data==6)
{
aiming_active = true;
}
else
{
aiming_active = mouse_button_down;
}
if(model_pointer!=0)
{
if
(
aiming_active&&
local_team!=global_team&&
cl_entity_struct[local_identifier].curstate.solid!=SOLID_NOT&&
strncmp(&model_struct[1].name[9],"hegrenade",9)!=0&&
strncmp(&model_struct[1].name[9],"flashbang",9)!=0&&
strncmp(&model_struct[1].name[9],"smokegrenade",12)!=0&&
strncmp(&model_struct[1].name[9],"c4",2)!=0
)
{
if(IsValidTarget(aimbot_position))
{
if(settings[AIMBOT_INVERSE].data==1)
{
aimbot_position[1] = rect_window.bottom-aimbot_position[1];
}
AimAtTarget((BYTE)settings[AIMBOT_METHOD].data,aimbot_position);
}
}
}
}
}
}
DynamicSleep(0);
}
}
BYTE GetCurrentTeam(hud_player_info_t* hud_player_info_pointer)
{
if(hud_player_info_pointer->model==0)
{
return 0;
}
if
(
hud_player_info_pointer->model[3]=='n'||
hud_player_info_pointer->model[1]=='s'||
hud_player_info_pointer->model[1]=='a'||
hud_player_info_pointer->model[1]=='p'||
hud_player_info_pointer->model[0]=='u'||
hud_player_info_pointer->model[0]=='v'
)
{
return 1;
}
else if
(
hud_player_info_pointer->model[0]=='a'||
hud_player_info_pointer->model[1]=='u'||
hud_player_info_pointer->model[0]=='l'||
hud_player_info_pointer->model[0]=='m'||
hud_player_info_pointer->model[0]=='t'
)
{
return 2;
}
return 0;
}
double CalculateDistance(float* vector1,float* vector2)
{
double x = vector1[0]-vector2[0];
double y = vector1[1]-vector2[1];
double z = vector1[2]-vector2[2];
return sqrt(x*x+y*y+z*z);
}
bool IsValidTarget(float* aimbot_position)
{
if
(
((int)aimbot_position[0])>=(screen_center_x-(settings[AIMBOT_SCAN_X].data/2))&&
((int)aimbot_position[0])<=(screen_center_x+(settings[AIMBOT_SCAN_X].data/2))&&
((int)aimbot_position[1])>=(screen_center_y-(settings[AIMBOT_SCAN_Y].data/2))&&
((int)aimbot_position[1])<=(screen_center_y+(settings[AIMBOT_SCAN_Y].data/2))
)
{
return true;
}
return false;
}
void AimAtTarget(BYTE aiming_method,float* aimbot_position)
{
RECT rect_aimbot;
if(aiming_method==0)
{
DynamicSetCursorPos((int)aimbot_position[0],(int)aimbot_position[1]);
}
else if(aiming_method==1)
{
rect_aimbot.left = (int)(aimbot_position[0]-0.5);
rect_aimbot.right = (int)(aimbot_position[0]+0.5);
rect_aimbot.top = (int)(aimbot_position[1]-0.5);
rect_aimbot.bottom = (int)(aimbot_position[1]+0.5);
DynamicClipCursor(&rect_aimbot);
DynamicClipCursor(0);
}
else if(aiming_method==2)
{
aimbot_position[0] = (aimbot_position[0]/(float)rect_window.right)*65535;
aimbot_position[1] = (aimbot_position[1]/(float)rect_window.bottom)*65535;
Dynamic_mouse_event
(
MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_MOVE,
(int)aimbot_position[0],
(int)aimbot_position[1],
0,
0
);
}
}
#include <gl\glu.h>
#include <gl\glaux.h>
#include"Half-Life/common/mathlib.h"
#include"Half-Life/cl_dll/wrect.h"
#include"Half-Life/cl_dll/cl_dll.h"
#include"Half-Life/common/triangleapi.h"
#include"Half-Life/common/cl_entity.h"
#include"Half-Life/common/com_model.h"
#include"Half-Life/pm_shared/pm_defs.h"
#include"Half-Life/common/ref_params.h"
#include"Half-Life/common/r_studioint.h"
#include"Half-Life/engine/studio.h"
#include"Half-Life/common/net_api.h"
#include"Half-Life/misc/parsemsg.h"
#include "resource.h"
#include "GetProcessInterfaces.h"
extern HANDLE GetProcessHandle(bool thread,DWORD desired_access,BOOL inherit_handle,DWORD identifier);
#endif#include "GetProcessInterfaces.h"
// Function coded by ViscountPherget
BOOL CALLBACK EnumThreadWindowsProcedure(HWND hwnd,LPARAM lParam)
{
PGPI pgpi = (PGPI)lParam;
if(IsWindow(hwnd)!=0)
{
if(IsWindowVisible(hwnd)!=0)
{
pgpi->handle_window = hwnd;
return 0;
}
}
return 1;
}
bool GetProcessInterfaces(const char* process_name,PDWORD identifier_process,PDWORD identifier_thread,HWND* handle_window)
{
HANDLE handle_snapshot_process=NULL;
HANDLE handle_snapshot_thread=NULL;
PROCESSENTRY32 process_entry;
THREADENTRY32 thread_entry;
GPI gpi;
bool foundProcess=false;
gpi.handle_window = 0;
gpi.module_name = process_name;
handle_snapshot_process = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if(handle_snapshot_process==INVALID_HANDLE_VALUE)
{
return false;
}
process_entry.dwSize = sizeof(process_entry);
if(Process32First(handle_snapshot_process,&process_entry)==0)
{
CloseHandle(handle_snapshot_process);
return false;
}
do
{
//Win9x stores full path in szExeFile, stripping path doesn't affect the WinNT string
PathStripPath(process_entry.szExeFile);
if(StrCmpI(process_name,process_entry.szExeFile)==0)
{
foundProcess = true;
handle_snapshot_thread = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD,process_entry.th32ProcessID);
if(handle_snapshot_thread==INVALID_HANDLE_VALUE)
{
return false;
}
thread_entry.dwSize = sizeof(thread_entry);
if(Thread32First(handle_snapshot_thread,&thread_entry)==0)
{
CloseHandle(handle_snapshot_thread);
return false;
}
do
{
if(thread_entry.th32OwnerProcessID==process_entry.th32ProcessID)
{
EnumThreadWindows(thread_entry.th32ThreadID,EnumThreadWindowsProcedure,(LPARAM)&gpi);
break;
}
}while(Thread32Next(handle_snapshot_thread,&thread_entry)!=0);
break;
}
}while(Process32Next(handle_snapshot_process,&process_entry)!=0);
if(identifier_process!=0)
{
*identifier_process = process_entry.th32ProcessID;
}
if(identifier_thread!=0)
{
*identifier_thread = thread_entry.th32ThreadID;
}
if(handle_window!=0)
{
*handle_window = gpi.handle_window;
}
if(handle_snapshot_thread!=NULL) CloseHandle(handle_snapshot_thread);
if(handle_snapshot_process!=NULL)CloseHandle(handle_snapshot_process);
if(foundProcess) return true;
return false;
}