archive: add 5 repo prompt(s) [skip ci]

This commit is contained in:
github-actions[bot]
2026-02-24 13:52:08 +00:00
parent 5bd08e564b
commit 7ce3ecc5cd
5 changed files with 175170 additions and 0 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+864
View File
@@ -0,0 +1,864 @@
Project Path: arc_HeathHowren_CSGO-Cheats_w_cruyfj
Source Tree:
```txt
arc_HeathHowren_CSGO-Cheats_w_cruyfj
├── CSGO-Aimbot
│ └── Source.cpp
├── CSGO-Bunnyhop
│ └── Source.cpp
├── CSGO-FOV
│ └── Source.cpp
├── CSGO-GDI-ESP
│ └── Source.cpp
├── CSGO-Glow
│ └── Source.cpp
├── CSGO-Radar
│ └── Source.cpp
├── CSGO-Triggerbot
│ └── Source.cpp
├── LICENSE
├── README.md
└── faq.md
```
`CSGO-Aimbot/Source.cpp`:
```cpp
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#include "Offsets.h"
#define dwLocalPlayer 0xD30B94
#define dwEntityList 0x4D44A24
#define m_dwBoneMatrix 0x26A8
#define m_iTeamNum 0xF4
#define m_iHealth 0x100
#define m_vecOrigin 0x138
#define m_bDormant 0xED
const int SCREEN_WIDTH = GetSystemMetrics(SM_CXSCREEN); const int xhairx = SCREEN_WIDTH / 2;
const int SCREEN_HEIGHT = GetSystemMetrics(SM_CYSCREEN); const int xhairy = SCREEN_HEIGHT / 2;
HWND hwnd;
DWORD procId;
HANDLE hProcess;
uintptr_t moduleBase;
HDC hdc;
int closest; //Used in a thread to save CPU usage.
uintptr_t GetModuleBaseAddress(const char* modName) {
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap != INVALID_HANDLE_VALUE) {
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry)) {
do {
if (!strcmp(modEntry.szModule, modName)) {
CloseHandle(hSnap);
return (uintptr_t)modEntry.modBaseAddr;
}
} while (Module32Next(hSnap, &modEntry));
}
}
}
template<typename T> T RPM(SIZE_T address) {
T buffer;
ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);
return buffer;
}
class Vector3 {
public:
float x, y, z;
Vector3() : x(0.f), y(0.f), z(0.f) {}
Vector3(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
};
int getTeam(uintptr_t player) {
return RPM<int>(player + m_iTeamNum);
}
uintptr_t GetLocalPlayer() {
return RPM< uintptr_t>(moduleBase + dwLocalPlayer);
}
uintptr_t GetPlayer(int index) { //Each player has an index. 1-64
return RPM< uintptr_t>(moduleBase + dwEntityList + index * 0x10); //We multiply the index by 0x10 to select the player we want in the entity list.
}
int GetPlayerHealth(uintptr_t player) {
return RPM<int>(player + m_iHealth);
}
Vector3 PlayerLocation(uintptr_t player) { //Stores XYZ coordinates in a Vector3.
return RPM<Vector3>(player + m_vecOrigin);
}
bool DormantCheck(uintptr_t player) {
return RPM<int>(player + m_bDormant);
}
Vector3 get_head(uintptr_t player) {
struct boneMatrix_t {
byte pad3[12];
float x;
byte pad1[12];
float y;
byte pad2[12];
float z;
};
uintptr_t boneBase = RPM<uintptr_t>(player + m_dwBoneMatrix);
boneMatrix_t boneMatrix = RPM<boneMatrix_t>(boneBase + (sizeof(boneMatrix) * 8 /*8 is the boneid for head*/));
return Vector3(boneMatrix.x, boneMatrix.y, boneMatrix.z);
}
struct view_matrix_t {
float matrix[16];
} vm;
struct Vector3 WorldToScreen(const struct Vector3 pos, struct view_matrix_t matrix) { //This turns 3D coordinates (ex: XYZ) int 2D coordinates (ex: XY).
struct Vector3 out;
float _x = matrix.matrix[0] * pos.x + matrix.matrix[1] * pos.y + matrix.matrix[2] * pos.z + matrix.matrix[3];
float _y = matrix.matrix[4] * pos.x + matrix.matrix[5] * pos.y + matrix.matrix[6] * pos.z + matrix.matrix[7];
out.z = matrix.matrix[12] * pos.x + matrix.matrix[13] * pos.y + matrix.matrix[14] * pos.z + matrix.matrix[15];
_x *= 1.f / out.z;
_y *= 1.f / out.z;
out.x = SCREEN_WIDTH * .5f;
out.y = SCREEN_HEIGHT * .5f;
out.x += 0.5f * _x * SCREEN_WIDTH + 0.5f;
out.y -= 0.5f * _y * SCREEN_HEIGHT + 0.5f;
return out;
}
float pythag(int x1, int y1, int x2, int y2) {
return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}
int FindClosestEnemy() {
float Finish;
int ClosestEntity = 1;
Vector3 Calc = { 0, 0, 0 };
float Closest = FLT_MAX;
int localTeam = getTeam(GetLocalPlayer());
for (int i = 1; i < 64; i++) { //Loops through all the entitys in the index 1-64.
DWORD Entity = GetPlayer(i);
int EnmTeam = getTeam(Entity); if (EnmTeam == localTeam) continue;
int EnmHealth = GetPlayerHealth(Entity); if (EnmHealth < 1 || EnmHealth > 100) continue;
int Dormant = DormantCheck(Entity); if (Dormant) continue;
Vector3 headBone = WorldToScreen(get_head(Entity), vm);
Finish = pythag(headBone.x, headBone.y, xhairx, xhairy);
if (Finish < Closest) {
Closest = Finish;
ClosestEntity = i;
}
}
return ClosestEntity;
}
void DrawLine(float StartX, float StartY, float EndX, float EndY) { //This function is optional for debugging.
int a, b = 0;
HPEN hOPen;
HPEN hNPen = CreatePen(PS_SOLID, 2, 0x0000FF /*red*/);
hOPen = (HPEN)SelectObject(hdc, hNPen);
MoveToEx(hdc, StartX, StartY, NULL); //start of line
a = LineTo(hdc, EndX, EndY); //end of line
DeleteObject(SelectObject(hdc, hOPen));
}
void FindClosestEnemyThread() {
while (1) {
closest = FindClosestEnemy();
}
}
int main() {
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
hdc = GetDC(hwnd);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)FindClosestEnemyThread, NULL, NULL, NULL);
while (!GetAsyncKeyState(VK_END)) { //press the "end" key to end the hack
vm = RPM<view_matrix_t>(moduleBase + dwViewMatrix);
Vector3 closestw2shead = WorldToScreen(get_head(GetPlayer(closest)), vm);
DrawLine(xhairx, xhairy, closestw2shead.x, closestw2shead.y); //optinal for debugging
if (GetAsyncKeyState(VK_MENU /*alt key*/) && closestw2shead.z >= 0.001f /*onscreen check*/)
SetCursorPos(closestw2shead.x, closestw2shead.y); //turn off "raw input" in CSGO settings
}
}
```
`CSGO-Bunnyhop/Source.cpp`:
```cpp
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#define dwEntityList 0x4D3C7BC
#define dwForceJump 0x51E0004
#define m_fFlags 0x104
uintptr_t moduleBase;
DWORD procId;
HWND hwnd;
HANDLE hProcess;
uintptr_t GetModuleBaseAddress(const char* modName) {
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap != INVALID_HANDLE_VALUE) {
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry)) {
do {
if (!strcmp(modEntry.szModule, modName)) {
CloseHandle(hSnap);
return (uintptr_t)modEntry.modBaseAddr;
}
} while (Module32Next(hSnap, &modEntry));
}
}
}
template<typename T> T RPM(SIZE_T address) {
T buffer;
ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);
return buffer;
}
template<typename T> void WPM(SIZE_T address, T buffer) {
WriteProcessMemory(hProcess, (LPVOID)address, &buffer, sizeof(buffer), NULL);
}
int main() {
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
uintptr_t buffer;
while (!GetAsyncKeyState(VK_END))
{
uintptr_t localPlayer = RPM<uintptr_t>(moduleBase + dwEntityList);
int flags = RPM<int>(localPlayer + m_fFlags);
if (flags & 1) {
buffer = 5;
}
else {
buffer = 4;
}
if (GetAsyncKeyState(VK_SPACE) & 0x8000) {
WPM(moduleBase + dwForceJump, buffer);
}
}
}
```
`CSGO-FOV/Source.cpp`:
```cpp
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#define dwEntityList 0x4D42A34
#define m_iDefaultFOV 0x332C
uintptr_t moduleBase;
DWORD procId;
HWND hwnd;
HANDLE hProcess;
uintptr_t GetModuleBaseAddress(const char* modName) {
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap != INVALID_HANDLE_VALUE) {
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry)) {
do {
if (!strcmp(modEntry.szModule, modName)) {
CloseHandle(hSnap);
return (uintptr_t)modEntry.modBaseAddr;
}
} while (Module32Next(hSnap, &modEntry));
}
}
}
template<typename T> T RPM(SIZE_T address) {
T buffer;
ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);
return buffer;
}
template<typename T> void WPM(SIZE_T address, T buffer) {
WriteProcessMemory(hProcess, (LPVOID)address, &buffer, sizeof(buffer), NULL);
}
void main() {
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
int fov = 90;
while (!GetAsyncKeyState(VK_END))
{
uintptr_t localPlayer = RPM<uintptr_t>(moduleBase + dwEntityList);
int iFOV = RPM<int>(localPlayer + m_iDefaultFOV);
std::cout << "FOV: " << iFOV << std::endl;
if (GetAsyncKeyState(0x76 /*F7*/) & 1)
{
//minus
fov = fov - 1;
WPM<int>(localPlayer + m_iDefaultFOV, fov);
}
if (GetAsyncKeyState(0x77 /*F8*/) & 1)
{
//add
fov = fov + 1;
WPM<int>(localPlayer + m_iDefaultFOV, fov);
}
if (GetAsyncKeyState(0x78 /*F9*/) & 1)
{
//resets
fov = 90;
WPM<int>(localPlayer + m_iDefaultFOV, fov);
}
}
}
```
`CSGO-GDI-ESP/Source.cpp`:
```cpp
#include <Windows.h>
#include <TlHelp32.h>
#define dwEntityList 0x4D3C5FC
#define dwViewMatrix 0x4D2E014
#define m_iTeamNum 0xF4
#define m_iHealth 0x100
#define m_vecOrigin 0x138
uintptr_t moduleBase;
HANDLE TargetProcess;
HPEN BoxPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 0));
RECT WBounds;
HWND EspHWND;
template<typename T> T RPM(SIZE_T address) {
T buffer;
ReadProcessMemory(TargetProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);
return buffer;
}
uintptr_t GetModuleBaseAddress(DWORD dwPid, const char* moduleName) {
uintptr_t dwBase = 0;
do {
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, dwPid);
if (hSnapshot == INVALID_HANDLE_VALUE) { continue; }
MODULEENTRY32 ModuleEntry32;
ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnapshot, &ModuleEntry32)) {
do {
if (!strcmp(ModuleEntry32.szModule, (LPSTR)moduleName)) {
dwBase = (DWORD)ModuleEntry32.modBaseAddr;
break;
}
} while (Module32Next(hSnapshot, &ModuleEntry32));
}
CloseHandle(hSnapshot);
} while (!dwBase);
return dwBase;
}
struct Vector3 {
float x, y, z;
};
struct view_matrix_t {
float matrix[16];
};
struct Vector3 WorldToScreen(const struct Vector3 pos, struct view_matrix_t matrix) {
struct Vector3 out;
float _x = matrix.matrix[0] * pos.x + matrix.matrix[1] * pos.y + matrix.matrix[2] * pos.z + matrix.matrix[3];
float _y = matrix.matrix[4] * pos.x + matrix.matrix[5] * pos.y + matrix.matrix[6] * pos.z + matrix.matrix[7];
out.z = matrix.matrix[12] * pos.x + matrix.matrix[13] * pos.y + matrix.matrix[14] * pos.z + matrix.matrix[15];
_x *= 1.f / out.z;
_y *= 1.f / out.z;
int width = WBounds.right - WBounds.left;
int height = WBounds.bottom + WBounds.left;
out.x = width * .5f;
out.y = height * .5f;
out.x += 0.5f * _x * width + 0.5f;
out.y -= 0.5f * _y * height + 0.5f;
return out;
}
void Draw(HDC hdc, Vector3 foot, Vector3 head) {
float height = head.y - foot.y;
float width = height / 2.4f;
SelectObject(hdc, BoxPen);
Rectangle(hdc, foot.x - (width / 2), foot.y, head.x + (width / 2), head.y);
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch (msg) {
case WM_PAINT: {
PAINTSTRUCT ps;
HDC Memhdc;
HDC hdc;
HBITMAP Membitmap;
int win_width = WBounds.right - WBounds.left;
int win_height = WBounds.bottom + WBounds.left;
hdc = BeginPaint(hwnd, &ps);
Memhdc = CreateCompatibleDC(hdc);
Membitmap = CreateCompatibleBitmap(hdc, win_width, win_height);
SelectObject(Memhdc, Membitmap);
FillRect(Memhdc, &WBounds, WHITE_BRUSH);
view_matrix_t vm = RPM<view_matrix_t>(moduleBase + dwViewMatrix);
int localteam = RPM<int>(RPM<DWORD>(moduleBase + dwEntityList) + m_iTeamNum);
for (int i = 1; i < 64; i++) {
uintptr_t pEnt = RPM<DWORD>(moduleBase + dwEntityList + (i * 0x10));
int team = RPM<int>(pEnt + m_iTeamNum);
if (team != localteam) {
int health = RPM<int>(pEnt + m_iHealth);
Vector3 pos = RPM<Vector3>(pEnt + m_vecOrigin);
Vector3 head; head.x = pos.x; head.y = pos.y; head.z = pos.z + 72.f;
Vector3 screenpos = WorldToScreen(pos, vm);
Vector3 screenhead = WorldToScreen(head, vm);
float height = screenhead.y - screenpos.y;
float width = height / 2.4f;
if (screenpos.z >= 0.01f && health > 0 && health < 101) {
Draw(Memhdc, screenpos, screenhead);
}
}
}
BitBlt(hdc, 0, 0, win_width, win_height, Memhdc, 0, 0, SRCCOPY);
DeleteObject(Membitmap);
DeleteDC(Memhdc);
DeleteDC(hdc);
EndPaint(hwnd, &ps);
ValidateRect(hwnd, &WBounds);
}
case WM_ERASEBKGND:
return 1;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
DWORD WorkLoop() {
while (1) {
InvalidateRect(EspHWND, &WBounds, true);
Sleep(16); //16 ms * 60 fps ~ 1000 ms
}
}
int main() {
HWND GameHWND = FindWindowA(0, "Counter-Strike: Global Offensive");
GetClientRect(GameHWND, &WBounds);
DWORD dwPid; GetWindowThreadProcessId(GameHWND, &dwPid);
TargetProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, dwPid);
moduleBase = GetModuleBaseAddress(dwPid, "client_panorama.dll");
WNDCLASSEX WClass;
MSG Msg;
WClass.cbSize = sizeof(WNDCLASSEX);
WClass.style = NULL;
WClass.lpfnWndProc = WndProc;
WClass.cbClsExtra = NULL;
WClass.cbWndExtra = NULL;
WClass.hInstance = reinterpret_cast<HINSTANCE>(GetWindowLongA(GameHWND, GWL_HINSTANCE));
WClass.hIcon = NULL;
WClass.hCursor = NULL;
WClass.hbrBackground = WHITE_BRUSH;
WClass.lpszMenuName = " ";
WClass.lpszClassName = " ";
WClass.hIconSm = NULL;
RegisterClassExA(&WClass);
HINSTANCE Hinstance = NULL;
EspHWND = CreateWindowExA(WS_EX_TRANSPARENT | WS_EX_TOPMOST | WS_EX_LAYERED, " ", " ", WS_POPUP, WBounds.left, WBounds.top, WBounds.right - WBounds.left, WBounds.bottom + WBounds.left, NULL, NULL, Hinstance, NULL);
SetLayeredWindowAttributes(EspHWND, RGB(255, 255, 255), 255, LWA_COLORKEY);
ShowWindow(EspHWND, 1);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&WorkLoop, NULL, NULL, NULL);
while (GetMessageA(&Msg, NULL, NULL, NULL) > 0) {
TranslateMessage(&Msg);
DispatchMessageA(&Msg);
Sleep(1);
}
ExitThread(0);
return 0;
}
```
`CSGO-Glow/Source.cpp`:
```cpp
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#include "Offsets.h"
#define dwLocalPlayer 0xD30B94
#define dwGlowObjectManager 0x528C8D8
#define dwEntityList 0x4D44A24
#define m_iGlowIndex 0xA428
#define m_iTeamNum 0xF4
#define m_iHealth 0x100
#define m_bDormant 0xED
uintptr_t moduleBase;
DWORD procId;
HWND hwnd;
HANDLE hProcess;
uintptr_t GetModuleBaseAddress(const char* modName) {
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap != INVALID_HANDLE_VALUE) {
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry)) {
do {
if (!strcmp(modEntry.szModule, modName)) {
CloseHandle(hSnap);
return (uintptr_t)modEntry.modBaseAddr;
}
} while (Module32Next(hSnap, &modEntry));
}
}
}
template<typename T> T RPM(SIZE_T address) {
T buffer;
ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);
return buffer;
}
template<typename T> void WPM(SIZE_T address, T buffer) {
WriteProcessMemory(hProcess, (LPVOID)address, &buffer, sizeof(buffer), NULL);
}
struct glowStructEnemy {
float red = 1.f;
float green = 0.f;
float blue = 0.f;
float alpha = 1.f;
uint8_t padding[8];
float unknown = 1.f;
uint8_t padding2[4];
BYTE renderOccluded = true;
BYTE renderUnoccluded = false;
BYTE fullBloom = false;
}glowEnm;
struct glowStructLocal {
float red = 0.f;
float green = 1.f;
float blue = 0.f;
float alpha = 1.f;
uint8_t padding[8];
float unknown = 1.f;
uint8_t padding2[4];
BYTE renderOccluded = true;
BYTE renderUnoccluded = false;
BYTE fullBloom = false;
}glowLocal;
uintptr_t getLocalPlayer() {
return RPM<uintptr_t>(moduleBase + dwLocalPlayer);
}
int main() {
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
while (!GetAsyncKeyState(VK_END))
{
uintptr_t dwGlowManager = RPM<uintptr_t>(moduleBase + dwGlowObjectManager);
int LocalTeam = RPM<int>(getLocalPlayer() + m_iTeamNum);
for (int i = 1; i < 32; i++) {
uintptr_t dwEntity = RPM<uintptr_t>(moduleBase + dwEntityList + i * 0x10);
int iGlowIndx = RPM<int>(dwEntity + m_iGlowIndex);
int EnmHealth = RPM<int>(dwEntity + m_iHealth); if (EnmHealth < 1 || EnmHealth > 100) continue;
int Dormant = RPM<int>(dwEntity + m_bDormant); if (Dormant) continue;
int EntityTeam = RPM<int>(dwEntity + m_iTeamNum);
if (LocalTeam == EntityTeam)
{
WPM<glowStructLocal>(dwGlowManager + (iGlowIndx * 0x38) + 0x4, glowLocal);
}
else if (LocalTeam != EntityTeam)
{
WPM<glowStructEnemy>(dwGlowManager + (iGlowIndx * 0x38) + 0x4, glowEnm);
}
}
}
}
```
`CSGO-Radar/Source.cpp`:
```cpp
#include <Windows.h>
#include <TlHelp32.h>
#define dwEntityList 0x4D44A04
#define m_bSpotted 0x93D
DWORD dwPid;
HANDLE hProcess;
DWORD client;
uintptr_t GetModule(const char* modName, DWORD procId) {
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap != INVALID_HANDLE_VALUE) {
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry)) {
do {
if (!strcmp(modEntry.szModule, modName)) {
CloseHandle(hSnap);
return (uintptr_t)modEntry.modBaseAddr;
}
} while (Module32Next(hSnap, &modEntry));
}
}
}
template<typename T> T RPM(SIZE_T address) {
T buffer; ReadProcessMemory(hProcess, (void*)address, &buffer, sizeof(T), nullptr);
return buffer;
}
template<typename T> void WPM(SIZE_T address, T buffer) {
WriteProcessMemory(hProcess, (void*)address, &buffer, sizeof(T), nullptr);
}
void main() {
GetWindowThreadProcessId(FindWindowA(0, "Counter-Strike: Global Offensive"), &dwPid);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, dwPid);
client = GetModule("client.dll", dwPid);
while (true) {
for (int i = 1; i < 64; i++) {
DWORD dwCurrentEntity = RPM<DWORD>(client + dwEntityList + i * 0x10);
if (dwCurrentEntity) {
WPM<bool>(dwCurrentEntity + m_bSpotted, true);
}
}
Sleep(50);
}
}
```
`CSGO-Triggerbot/Source.cpp`:
```cpp
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#define m_iTeamNum 0xF4
#define dwLocalPlayer 0xD29B0C
#define dwEntityList 0x4D3D6AC
#define m_iCrosshairId 0xB3D4
uintptr_t moduleBase;
DWORD procId;
HWND hwnd;
HANDLE hProcess;
uintptr_t GetModuleBaseAddress(const char* modName) {
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
if (hSnap != INVALID_HANDLE_VALUE) {
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry)) {
do {
if (!strcmp(modEntry.szModule, modName)) {
CloseHandle(hSnap);
return (uintptr_t)modEntry.modBaseAddr;
}
} while (Module32Next(hSnap, &modEntry));
}
}
}
template<typename T> T RPM(SIZE_T address) {
T buffer;
ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);
return buffer;
}
uintptr_t getLocalPlayer() { //This will get the address to localplayer.
return RPM< uintptr_t>(moduleBase + dwLocalPlayer);
}
uintptr_t getPlayer(int index) { //Each player in the game has an index.
return RPM< uintptr_t>(moduleBase + dwEntityList + index * 0x10); //We use index times 0x10 because the distance between each player 0x10.
}
int getTeam(uintptr_t player) {
return RPM<int>(player + m_iTeamNum);
}
int getCrosshairID(uintptr_t player) {
return RPM<int>(player + m_iCrosshairId);
}
int main() {
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
while (!GetAsyncKeyState(VK_END)) {
int CrosshairID = getCrosshairID(getLocalPlayer());
int CrosshairTeam = getTeam(getPlayer(CrosshairID - 1));
int LocalTeam = getTeam(getLocalPlayer());
if (CrosshairID > 0 && CrosshairID < 32 && LocalTeam != CrosshairTeam)
{
if (GetAsyncKeyState(VK_MENU /*alt key*/))
{
mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, 0, 0);
Sleep(100); //Optional
}
}
}
}
```
`LICENSE`:
```
MIT License
Copyright (c) 2020 Heath Howren
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
`README.md`:
```md
# CS:GO Cheat Library
## Introduction
This is a collection of cheats for the video-game Counter-Strike: Global Offensive.<br />
These cheats were coded as part of a [YouTube series](https://www.youtube.com/watch?v=1y63M4BvG9A&list=PLzBukBmD3GxuBpWT7xV-pCN-Uu7WwtK7O).
## Code Samples
**Gaining access to the CSGO application**<br />
The window is stored ```HWND hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");```<br />
The process ID is retrieved ```GetWindowThreadProcessId(hwnd, &procId);```<br />
A handle is is created ```HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);```
**How to read and write process memory** <br />
How to read process memory: ```RPM<variable type>(address + offsets);``` <br />
Example: ```RPM<int>(0xD30B94 + 0x4);``` <br />
How to write process memory: ```WPM<variable type>(address + offsets, newValue);``` <br />
Example: ```int value = 999; WPM<int>(0xD30B94 + 0x4, value);```
## Installation
Update the addresses and offsets. I reccomend using [Hazedumper](https://github.com/frk1/hazedumper) for this. <br />
Set the character set to Multi-Byte.<br />
Build the application as **x86** and run as an administrator.<br />
**Error trouble shooting**<br />
If you are having issues compiling check out the [faq](https://github.com/HeathHowren/CSGO-Cheats/blob/master/faq.md) for common issues I've seen!<br />
## Contributions
* [HeathHowren](https://github.com/HeathHowren)
* [beans42](https://github.com/beans42)
```
`faq.md`:
```md
# Frequently asked questions and issues
## Issues
**The wrong character set being used**<br />
I see this issue a lot, you muse set the character set to muli-byte. If you do not you will see an error like [this](https://i.gyazo.com/9407cb6bbb2f2bae25ea5615cc4166bb.png). <br />
Go into the project properties and follow change the character set to multi-byte. <br />
[Fix for VS Community IDE 2017](https://i.gyazo.com/47efe57114ecbfb2dbbbb630cb07ffe7.png)<br />
[Fix for VS Community IDE 2019](https://i.gyazo.com/b427de2ada6066819bb20e9a9684f689.png)<br />
**Cannot open source file "pch.h" or "stafdx.h"** <br />
This issue comes from not creating an empty project file. This is very easy to fix, and the error will look like [this](https://gyazo.com/fb4f6fa466ed438e31236af444dc5d96).<br />
First delete the line that says ```#include "pch.h"``` or ```#include "stafdx.h"``` <br />
Go into the project properties and [turn off using pre-compiled headers](https://i.gyazo.com/cd5056afcd785e168b737aa36efa1f97.png). <br />
```
File diff suppressed because it is too large Load Diff
+883
View File
@@ -0,0 +1,883 @@
Project Path: arc_ekknod_nv_v2_9h1xof_a
Source Tree:
```txt
arc_ekknod_nv_v2_9h1xof_a
├── LICENCE
├── README.md
├── nv_v2
│ ├── main.c
│ ├── nv_v2.aps
│ ├── nv_v2.rc
│ ├── nv_v2.vcxproj
│ ├── nv_v2.vcxproj.filters
│ ├── nv_v2.vcxproj.user
│ └── resource.h
└── nv_v2.sln
```
`LICENCE`:
```
free use for non commercial projects
credit me if you like.
```
`README.md`:
```md
# nv_v2
##### csgo sound esp
----
## usage
* clone this repository
* build x86 release
* set your ingame volume low, recommended under 0.3.
* copy "nvStereoApiI.dll" -> "C:\Program Files (x86)\NVIDIA Corporation\3D Vision\" folder
* start the game and play
----
## features
* no hooks
* no ingame functions called
----
## video
[![IMAGE ALT TEXT](https://i.ytimg.com/vi/LRcZQIf_0O0/maxresdefault.jpg)](https://www.youtube.com/watch?v=LRcZQIf_0O0 "CSGO sound esp")
----
## licence
* free use for non commercial projects
* credit me if you like.
```
`nv_v2.sln`:
```sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nv_v2", "nv_v2\nv_v2.vcxproj", "{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Debug|x64.ActiveCfg = Debug|x64
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Debug|x64.Build.0 = Debug|x64
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Debug|x86.ActiveCfg = Debug|Win32
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Debug|x86.Build.0 = Debug|Win32
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Release|x64.ActiveCfg = Release|x64
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Release|x64.Build.0 = Release|x64
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Release|x86.ActiveCfg = Release|Win32
{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5EB48005-80B1-4418-AC11-9A11C1038FA8}
EndGlobalSection
EndGlobal
```
`nv_v2/main.c`:
```c
#include <windows.h>
#include <math.h>
#pragma comment(lib, "ntdll.lib")
/* global variables */
static int _target, _target_hitbox;
static int _mp_teammates_are_enemies;
static int _volume;
static float _start_volume, _min_volume;
/* static hitboxes */
static int hitbox_list[6] = { 5, 4, 3, 0, 7, 8 } ;
/* functions */
HANDLE (WINAPI * _CreateThread)(PVOID, SIZE_T, PVOID, LPVOID, DWORD, LPDWORD);
BOOL (WINAPI * _CloseHandle)(HANDLE);
VOID (WINAPI *_Sleep)(DWORD dwMilliseconds);
double (__cdecl *_atan2)(double, double);
double (__cdecl *_sqrt)(double);
double (__cdecl *_sin)(double);
double (__cdecl *_cos)(double);
typedef struct { float x, y, z; } vec3 ;
struct {
uintptr_t client, entity;
uintptr_t engine, cvar;
} vt ;
struct {
int dwClientState, dwEntityList, dwGetLocalPlayer;
int dwGetViewAngles, dwGetState, m_iHealth;
int m_lifeState, m_vecViewOffset, m_iTeamNum;
int m_vecPunch, dwBoneMatrix, m_vecOrigin;
} nv ;
struct crc32 { DWORD c, l, i; };
struct crc32 CRC32(DWORD c, DWORD l, DWORD i)
{
struct crc32 crc;
crc.c = c; crc.l = l; crc.i = i;
return crc;
}
#define CRC32(c, l, i) ((struct crc32) { c, l, i })
#define CRC32_CMP(crc, t) RtlCrc32((const void *)t, strlen((const char *)t), (DWORD)crc.i) == (unsigned int)crc.c
#define CRC32_WCMP(crc, t) RtlCrc32((const void *)t, wcslen((const wchar_t *)t), (DWORD)crc.i) == (unsigned int)crc.c
#define CRC32_CMPO(crc, t, off) RtlCrc32((const void *)t, strlen((const char *)t) - off, (DWORD)crc.i) == (unsigned int)crc.c
uintptr_t get_module(struct crc32 crc)
{
uintptr_t a0, a1;
a0 = *(uintptr_t*)(*(uintptr_t*)(__readfsdword(0x30) + 0x0C) + 0x14);
a1 = *(uintptr_t*)(a0 + 4);
while (a0 != a1) {
if (CRC32_WCMP(crc, *(const wchar_t**)(a0 + 0x28))) {
return *(uintptr_t*)(a0 + 0x10);
}
a0 = *(uintptr_t*)(a0);
}
return 0;
}
uintptr_t get_export(uintptr_t module, struct crc32 crc)
{
int a0;
int a1[4];
a0 = module + *(int*)(module + 0x3C);
a0 = module + *(int*)(a0 + 0x78);
memcpy(&a1, (const void*)(a0 + 0x18), sizeof(a1));
while (a1[0]--) {
a0 = *(int*)(module + a1[2] + (a1[0] * 4));
if (CRC32_CMP(crc, (const char*)(module + a0))) {
return (module + *(int*)(module + a1[1] + (*(short*)(module + a1[3] + (a1[0] * 2)) * 4)));
}
}
return 0;
}
uintptr_t get_factory(struct crc32 crc)
{
uintptr_t v = get_export(get_module(crc), CRC32(1505290531, 15, 101363432));
return v != 0 ? *(uintptr_t*)(*(uintptr_t*)(v - 0x6A)) : 0;
}
uintptr_t get_interface(uintptr_t factory, struct crc32 crc)
{
do {
if (CRC32_CMPO(crc, *(const char**)(factory + 0x4), 3)) {
return *(uintptr_t*)(*(uintptr_t*)(factory) + 1);
}
} while ((factory = *(uintptr_t*)(factory + 0x8)) != 0);
return 0;
}
static uintptr_t get_function(uintptr_t vtable, int index) { return *(uintptr_t*)(*(uintptr_t*)(vtable) + index * 4); }
static uintptr_t get_table(struct crc32 crc)
{
uintptr_t a0, a1;
a0 = *(uintptr_t*)(*(uintptr_t*)(get_function(vt.client, 8) + 1));
do {
a1 = *(uintptr_t*)(a0 + 0xC);
if (CRC32_CMP(crc, *(const char **)(a1 + 0xC)))
return a1;
} while((a0 = *(uintptr_t*)(a0 + 0x10)) != 0);
return 0;
}
static int get_offset(uintptr_t table, struct crc32 crc)
{
int a0 = 0, a1, a2, a3, a4, a5;
for (a1 = 0; a1 < *(int*)(table + 0x4); a1++) {
a2 = a1 * 60 + *(int*)(table);
a3 = *(int*)(a2 + 0x2C);
if ((a4 = *(int*)(a2 + 0x28)) != 0 && *(int*)(a4 + 0x4) != 0)
if ((a5 = get_offset(a4, crc)) != 0)
a0 += a3 + a5;
if (CRC32_CMP(crc, *(const char**)(a2))) {
return a3 + a0;
}
}
return a0;
}
static uintptr_t get_cvar(struct crc32 crc)
{
uintptr_t a1 = *(uintptr_t*)(*(uintptr_t*)(vt.cvar + 0x34));
while ((a1 = *(uintptr_t*)(a1 + 0x4)) != 0)
if (CRC32_CMP(crc, *(const char**)(a1 + 0xc)))
return a1;
return 0;
}
static int get_cvar_32(uintptr_t convar)
{
return *(int*)(convar + 0x30) ^ convar;
}
static float get_cvar_32f(uintptr_t convar)
{
int v = *(int*)(convar + 0x2C) ^ convar;
return *(float*)&v;
}
static void set_cvar_32f(uintptr_t convar, float v)
{
*(int*)(convar + 0x2C) = *(int*)&v ^ convar;
}
static BOOL isInGame(void) { return *(BOOL*)(nv.dwClientState + nv.dwGetState) == 6; }
static int getLocalPlayer(void) { return *(int*)(nv.dwClientState + nv.dwGetLocalPlayer); }
static int getClientEntity(int index) { return *(int*)(nv.dwEntityList + index * 0x10); }
static int getTeam(int entity) { return *(int*)(entity + nv.m_iTeamNum); }
static int getHealth(int entity) { return *(int*)(entity + nv.m_iHealth); }
static int getLifeState(int entity) { return *(int*)(entity + nv.m_lifeState); }
static int getBoneMatrix(int entity) { return *(int*)(entity + nv.dwBoneMatrix); }
static vec3 getVecOrigin(int entity) { return *(vec3*)(entity + nv.m_vecOrigin); }
static vec3 getVecView(int entity) { return *(vec3*)(entity + nv.m_vecViewOffset); }
static vec3 getVecPunch(int entity) { return *(vec3*)(entity + nv.m_vecPunch); }
static vec3 getViewAngles(void) { return *(vec3*)(nv.dwClientState + nv.dwGetViewAngles); }
static vec3 getEyePos(int entity)
{
vec3 v, o;
v = getVecView(entity);
o = getVecOrigin(entity);
return (vec3) { v.x + o.x, v.y + o.y, v.z + o.z } ;
}
static vec3 getBonePos(int entity, int index)
{
vec3 v = { 0 };
int m;
m = getBoneMatrix(entity);
if (m == 0)
return v;
v.x = *(float*)(m + 0x30 * index + 0x0C);
v.y = *(float*)(m + 0x30 * index + 0x1C);
v.z = *(float*)(m + 0x30 * index + 0x2C);
return v;
}
static BOOL isValid(int entity)
{
int health;
if (entity == 0)
return 0;
health = getHealth(entity);
return entity && getLifeState(entity) == 0 && health > 0 && health < 1337;
}
static BOOL initialize_functions(void)
{
uintptr_t m;
if ((m = get_module(CRC32(1336618664, 9, 355701351))) == 0) return FALSE; /* ntdll.dll */
if ((*(uintptr_t*)&_atan2 = get_export(m, CRC32(-1208413014, 5, 25061309))) == 0) return FALSE; /* atan2 */
if ((*(uintptr_t*)&_sqrt = get_export(m, CRC32(1089090901, 4, 2113851773))) == 0) return FALSE; /* sqrt */
if ((*(uintptr_t*)&_sin = get_export(m, CRC32(1156354345, 3, 1061462970))) == 0) return FALSE; /* sin */
if ((*(uintptr_t*)&_cos = get_export(m, CRC32(636348740, 3, 1064479962))) == 0) return FALSE; /* cos */
if ((m = get_module(CRC32(-1564104622, 12, 1180227225))) == 0) return FALSE; /* KERNEL32.DLL */
if ((*(uintptr_t*)&_CreateThread = get_export(m, CRC32(-770929529, 12, 2097875415))) == 0) return FALSE; /* CreateThread */
if ((*(uintptr_t*)&_CloseHandle = get_export(m, CRC32(644799219, 11, 2089162550))) == 0) return FALSE; /* CloseHandle */
if ((*(uintptr_t*)&_Sleep = get_export(m, CRC32(871370551, 5, 114390764))) == 0) return FALSE; /* Sleep */
return TRUE;
}
static BOOL initialize_interfaces(void)
{
int t;
if ((t = get_factory(CRC32(765433668, 11, 1675198160))) == 0) return 0; /* vstdlib.dll */
if ((vt.cvar = get_interface(t, CRC32(-1774926910, 11, 321091948))) == 0) return 0; /* VEngineCvar */
if ((t = get_factory(CRC32(-977266194, 10, 1879618954))) == 0) return 0; /* engine.dll */
if ((vt.engine = get_interface(t, CRC32(-1563693526, 13, 21364416))) == 0) return 0; /* VEngineClient */
if ((t = get_factory(CRC32(1478622760, 19, 1548099251))) == 0) return 0; /* client_panorama.dll */
if ((vt.entity = get_interface(t, CRC32(1789069159, 17, 74332196))) == 0) return 0; /* VClientEntityList */
if ((vt.client = get_interface(t, CRC32(1051283942, 7, 809333349))) == 0) return 0; /* VClient */
return 1;
}
static BOOL initialize_netvars(void)
{
int t;
nv.dwClientState = *(int*)(*(int*)(get_function(vt.engine, 18) + 0x16));
nv.dwEntityList = vt.entity - (*(int*)(get_function(vt.entity, 5) + 0x22) - 0x38);
nv.dwGetLocalPlayer = *(int*)(get_function(vt.engine, 12) + 0x16);
nv.dwGetViewAngles = *(int*)(get_function(vt.engine, 19) + 0xB2);
nv.dwGetState = *(int*)(get_function(vt.engine, 26) + 0x07);
if ((t = get_table(CRC32(-1834292033, 16, 2143189635))) == 0) return 0; /* DT_BaseAnimating */
nv.dwBoneMatrix = get_offset(t, CRC32(-1563350005, 12, 1532917158)) + 0x1C; /* m_nForceBone */
if ((t = get_table(CRC32(-96230388, 13, 1368077207))) == 0) return 0; /* DT_BaseEntity */
nv.m_vecOrigin = get_offset(t, CRC32(-673322472, 11, 979638726)); /* m_vecOrigin */
nv.m_iTeamNum = get_offset(t, CRC32(-1033337736, 10, 1136402645)); /* m_iTeamNum */
if ((t = get_table(CRC32(2030591008, 13, 1519792398))) == 0) return 0; /* DT_BasePlayer */
nv.m_iHealth = get_offset(t, CRC32(-1956581322, 9, 1195260790)); /* m_iHealth */
nv.m_lifeState = get_offset(t, CRC32(211519899, 11, 759023442)); /* m_lifeState */
nv.m_vecViewOffset = get_offset(t, CRC32(-1429466835, 18, 1044359072)); /* m_vecViewOffset[0] */
nv.m_vecPunch = get_offset(t, CRC32(-2054851689, 7, 34174687)) + 0x70; /* m_Local */
return 1;
}
static void main_thread(void);
BOOL initialize_everything(void)
{
if (!initialize_functions())
return FALSE;
if (!initialize_interfaces())
return FALSE;
if (!initialize_netvars())
return FALSE;
if ((_mp_teammates_are_enemies = get_cvar(CRC32(354703522, 24, 1872518935))) == 0)
return FALSE;
if ((_volume = get_cvar(CRC32(-828087349, 6, 2122840634))) == 0)
return FALSE;
_start_volume = get_cvar_32f(_volume);
if (_start_volume >= 0.30f)
_start_volume = 0.25f;
_min_volume = 1.0f - _start_volume;
_CloseHandle(_CreateThread(0, 0, (PVOID)main_thread, 0, 0, 0));
return TRUE;
}
#define RAD2DEG(x) ((float)(x) * (float)(180.f / 3.14159265358979323846f))
#define DEG2RAD(x) ((float)(x) * (float)(3.14159265358979323846f / 180.f))
static void sincos(float radians, float *sine, float *cosine)
{
*sine = (float)_sin(radians);
*cosine = (float)_cos(radians);
}
static void angle_vec(vec3 angles, vec3 *forward)
{
float sp, sy, cp, cy;
sincos(DEG2RAD(angles.x), &sp, &cp);
sincos(DEG2RAD(angles.y), &sy, &cy);
forward->x = cp * cy;
forward->y = cp * sy;
forward->z = -sp;
}
static void vec_clamp(vec3 *v)
{
if ( v->x > 89.0f && v->x <= 180.0f ) {
v->x = 89.0f;
}
if ( v->x > 180.0f ) {
v->x = v->x - 360.0f;
}
if( v->x < -89.0f ) {
v->x = -89.0f;
}
v->y = fmodf(v->y + 180, 360) - 180;
v->z = 0;
}
static void vec_normalize(vec3 *vec)
{
float radius;
radius = 1.f / (float)(_sqrt(vec->x*vec->x + vec->y*vec->y + vec->z*vec->z) + 1.192092896e-07f);
vec->x *= radius, vec->y *= radius, vec->z *= radius;
}
static void vec_angles(vec3 forward, vec3 *angles)
{
float tmp, yaw, pitch;
if (forward.y == 0.f && forward.x == 0.f) {
yaw = 0;
if (forward.z > 0) {
pitch = 270;
} else {
pitch = 90.f;
}
} else {
yaw = (float)(_atan2(forward.y, forward.x) * 180.f / 3.14159265358979323846f);
if (yaw < 0) {
yaw += 360.f;
}
tmp = (float)_sqrt(forward.x * forward.x + forward.y * forward.y);
pitch = (float)(_atan2(-forward.z, tmp) * 180.f / 3.14159265358979323846f);
if (pitch < 0) {
pitch += 360.f;
}
}
angles->x = pitch;
angles->y = yaw;
angles->z = 0.f;
}
static float vec_dot(vec3 v0, vec3 v1)
{
return (v0.x * v1.x + v0.y * v1.y + v0.z * v1.z);
}
static float vec_length(vec3 v)
{
return (v.x * v.x + v.y * v.y + v.z * v.z);
}
static float get_fov(vec3 vangle, vec3 angle)
{
vec3 a0, a1;
angle_vec(vangle, &a0);
angle_vec(angle, &a1);
return RAD2DEG(acos(vec_dot(a0, a1) / vec_length(a0)));
}
static vec3 get_target_angle(int self, int target, int hitbox_id)
{
vec3 m, c;
m = getBonePos(target, hitbox_id);
c = getEyePos(self);
c.x = m.x - c.x; c.y = m.y - c.y; c.z = m.z - c.z;
vec_normalize(&c);
vec_angles(c, &c);
m = getVecPunch(self);
c.x -= m.x * 2.0f, c.y -= m.y * 2.0f, c.z -= m.z * 2.0f;
vec_clamp(&c);
return c;
}
static BOOL get_target(int self, vec3 vangle)
{
float best_fov;
int i;
int entity;
float fov;
int j;
best_fov = 9999.0f;
for (i = 1; i < 64; i++) {
entity = getClientEntity(i);
if (!isValid(entity))
continue;
if (get_cvar_32(_mp_teammates_are_enemies) == 0 && getTeam(self) == getTeam(entity))
continue;
for (j = 6; j-- ;) {
fov = get_fov(vangle, get_target_angle(self, entity, hitbox_list[j]));
if (fov < best_fov) {
best_fov = fov;
_target = entity;
_target_hitbox = hitbox_list[j];
}
}
}
return best_fov != 9999.0f;
}
static void sound_esp(void)
{
int self;
vec3 vangle;
float fov, vol;
self = getClientEntity(getLocalPlayer());
if (self == 0)
return;
vangle = getViewAngles();
if (!get_target(self, vangle)) {
if (get_cvar_32f(_volume) != _start_volume)
set_cvar_32f(_volume, _start_volume);
return;
}
fov = get_fov(vangle, get_target_angle(self, _target, _target_hitbox));
if (fov <= 6.0f) {
vol = 1.0f - fov / 6.0f * _min_volume;
if (vol > 1.0f || vol <= _start_volume)
return;
set_cvar_32f(_volume, vol);
} else {
if (get_cvar_32f(_volume) != _start_volume)
set_cvar_32f(_volume, _start_volume);
}
}
static void main_thread(void)
{
while (1) {
_Sleep(1);
if (isInGame()) {
sound_esp();
}
}
}
BOOL WINAPI DllMain(HMODULE hMod, DWORD rea, LPVOID res)
{
BOOL result = 1;
if (rea == 1) {
result = initialize_everything();
}
return result;
}
```
`nv_v2/nv_v2.rc`:
```rc
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Finnish (Finland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 7,17,13,8813
PRODUCTVERSION 7,17,13,8813
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "NVIDIA API 3D Vision extention"
VALUE "FileVersion", "7.17.13.8813"
VALUE "InternalName", "nvStereoApiI.dll"
VALUE "LegalCopyright", "(C) 2017 NVIDIA Corporation. All rights reserved."
VALUE "OriginalFilename", "nvStereoApiI.dll"
VALUE "ProductName", "NVIDIA GeForce 3D Vision"
VALUE "ProductVersion", "7.17.13.8813"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // Finnish (Finland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
```
`nv_v2/nv_v2.vcxproj`:
```vcxproj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{D8FD9348-BD97-4C13-B9B6-880C5D4FB01F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>nvv2</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>nvStereoApiI</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;NVV2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;NVV2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;NVV2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AssemblyDebug>false</AssemblyDebug>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;NVV2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="nv_v2.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
```
`nv_v2/nv_v2.vcxproj.filters`:
```filters
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="nv_v2.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
```
`nv_v2/nv_v2.vcxproj.user`:
```user
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>
```
`nv_v2/resource.h`:
```h
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by nv_v2.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
```