Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 5 Авг 2020
- Сообщения
- 31
- Реакции
- 9
Как добавить autostrafe в этот source? 5-ая кнопка должна быть autostrafe
C++:
// dllmain.cpp : Defines the entry point for the DLL application.
#include <Windows.h>
#include "framework.h"
#include <iostream>
#include "vector.h"
#include <string>
struct offsets
{
uintptr_t glowIndex = 0xA438;
uintptr_t glowObject = 0x529C3D0;
uintptr_t localPlayer = 0xD3FC5C;
uintptr_t entityList = 0x4D5450C;
uintptr_t team = 0xF4;
uintptr_t flags = 0x104;
uintptr_t fjump = 0x51FE22C;
uintptr_t vecVel = 0x114;
uintptr_t shotsFired = 0xA390;
uintptr_t clientState = 0x589DD4;
uintptr_t viewAngles = 0x4D88;
uintptr_t aimPunchAngles = 0x302C;
uintptr_t flashDur = 0xA420;
}offset;
struct addresses
{
uintptr_t localPlayer;
uintptr_t clientModule;
uintptr_t engineModule;
BYTE flag;
uintptr_t vel;
Vec3* viewAngles;
int* IshotsFired;
Vec3* aimPunchAngle;
Vec3 oPunch = { 0, 0, 0 };
}addr;
void glowHack()
{
//std::cout << "Glowing!" << std::endl;
uintptr_t glowObj = *(uintptr_t*)(addr.clientModule + offset.glowObject);
int myTeam = *(int*)(addr.localPlayer + offset.team);
//loop through entitys
for (int i = 0; i < 64; i++)
{
uintptr_t ent = *(uintptr_t*)(addr.clientModule + offset.entityList + i * 0x10);
if (ent != NULL)
{
int entTeam = *(int*)(ent + offset.team);
int glowInd = *(int*)(ent + offset.glowIndex);
if (myTeam == entTeam)
{
//MemClass.writeMem<float>(glowObject + ((glowIndex * 0x38) + 0x4), 0);// r
*(float*)(glowObj + ((glowInd * 0x38) + 0x4)) = 0; // red
*(float*)(glowObj + ((glowInd * 0x38) + 0x8)) = 2; // green
*(float*)(glowObj + ((glowInd * 0x38) + 0xC)) = 0; // blue
*(float*)(glowObj + ((glowInd * 0x38) + 0x10)) = 1; // alpha
}
else
{
*(float*)(glowObj + ((glowInd * 0x38) + 0x4)) = 2; // red
*(float*)(glowObj + ((glowInd * 0x38) + 0x8)) = 0; // green
*(float*)(glowObj + ((glowInd * 0x38) + 0xC)) = 0; // blue
*(float*)(glowObj + ((glowInd * 0x38) + 0x10)) = 1; // alpha
}
*(bool*)(glowObj + ((glowInd * 0x38) + 0x24)) = true;
*(bool*)(glowObj + ((glowInd * 0x38) + 0x25)) = false;
}
}
}
void bHop()
{
//std::cout << "Hopping!" << std::endl;
addr.flag = *(BYTE*)(addr.localPlayer + offset.flags);
if (GetAsyncKeyState(VK_SPACE) && addr.flag & (1 << 0))
{
//checks to see if gamer is moving
addr.vel = *(BYTE*)(addr.localPlayer + offset.vecVel);
if (addr.vel != 0)
{
*(uintptr_t*)(addr.clientModule + offset.fjump) = 5;
Sleep(10);
*(uintptr_t*)(addr.clientModule + offset.fjump) = 4;
}
}
}
void rcs()
{
Vec3 punchAngle = *addr.aimPunchAngle * 2;
if (*addr.IshotsFired > 1 && GetAsyncKeyState(VK_LBUTTON))
{
Vec3 newAngle = *addr.viewAngles + addr.oPunch - punchAngle;
newAngle.Normalize();
*addr.viewAngles = newAngle;
}
addr.oPunch = punchAngle;
}
void noFlash()
{
float* flashDur = (float*)(addr.localPlayer + offset.flashDur);
if (*flashDur > 0)
{
*flashDur = 0;
}
}
int main()
{
bool bHoping = false, glowing = false, recoilControling = false, antiFlash = false;
Vec3 oPunch{ 0,0,0 };
AllocConsole();
FILE* f;
freopen_s(&f, "CONOUT$", "w", stdout);
std::cout << "oafjsad are now running!" << std::endl;
addr.clientModule = (uintptr_t)GetModuleHandle(L"client.dll");
while (true) //hack loop
{
addr.localPlayer = *(uintptr_t*)(addr.clientModule + offset.localPlayer);
if (addr.localPlayer != NULL) //(if you're in a game)
{
addr.engineModule = (uintptr_t)GetModuleHandle(L"engine.dll");
addr.viewAngles = (Vec3*)(*(uintptr_t*)(addr.engineModule + offset.clientState) + offset.viewAngles);
addr.IshotsFired = (int*)(addr.localPlayer + offset.shotsFired);
addr.aimPunchAngle = (Vec3*)(addr.localPlayer + offset.aimPunchAngles);
if (glowing)
glowHack();
if (bHoping)
bHop();
if (recoilControling)
rcs();
if (antiFlash)
noFlash();
}
if (GetAsyncKeyState(VK_NUMPAD1) & 1) //toggle glowing
{
glowing = !glowing;
if (glowing == true)
{
std::cout << "Glow: enabled" << std::endl;
}
else
{
std::cout << "Glow: disabled" << std::endl;
}
}
if (GetAsyncKeyState(VK_NUMPAD2) & 1) //toggle bhop
{
bHoping = !bHoping;
if (bHoping == true)
{
std::cout << "BHOP: enabled" << std::endl;
}
else
{
std::cout << "BHOP: disabled" << std::endl;
}
}
if (GetAsyncKeyState(VK_NUMPAD3) & 1) //toggle rcs
{
recoilControling = !recoilControling;
if (recoilControling == true)
{
std::cout << "RCS: enabled" << std::endl;
}
else
{
std::cout << "RCS: disabled" << std::endl;
}
}
if (GetAsyncKeyState(VK_NUMPAD4) & 1) //toggle flash
{
antiFlash = !antiFlash;
if (antiFlash == true)
{
std::cout << "Anti-Flash: enabled" << std::endl;
}
else
{
std::cout << "Anti-Flash: disabled" << std::endl;
}
}
if (GetAsyncKeyState(VK_END))
{
fclose(f);
FreeConsole();
FreeLibraryAndExitThread(NULL, NULL);
return 0;
return 0;
}
}
}
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
DisableThreadLibraryCalls(hModule);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)main, NULL, NULL, NULL);
}
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}