- Added glow players
- Added an option to toggle no recoil/sway
vmread
MisterY52 4 years ago
parent 9e35d91919
commit 2d5f7d0da4

@ -1,6 +1,7 @@
#include "prediction.h" #include "prediction.h"
extern bool firing_range; extern bool firing_range;
float smooth = 12.0f; float smooth = 12.0f;
bool aim_no_recoil = true;
uint64_t Entity::Observing(WinProcess& mem, uint64_t entitylist) uint64_t Entity::Observing(WinProcess& mem, uint64_t entitylist)
{ {
@ -93,6 +94,27 @@ Vector Entity::GetViewAnglesV()
return *(Vector*)(buffer + OFFSET_VIEWANGLES); return *(Vector*)(buffer + OFFSET_VIEWANGLES);
} }
bool Entity::isGlowing()
{
return *(int*)(buffer + OFFSET_GLOW_ENABLE) == 7;
}
void Entity::enableGlow(WinProcess& mem)
{
mem.Write<int>(ptr + OFFSET_GLOW_T1, 16256);
mem.Write<int>(ptr + OFFSET_GLOW_T2, 1193322764);
mem.Write<int>(ptr + OFFSET_GLOW_ENABLE, 7);
mem.Write<int>(ptr + OFFSET_GLOW_THROUGH_WALLS, 2);
}
void Entity::disableGlow(WinProcess& mem)
{
mem.Write<int>(ptr + OFFSET_GLOW_T1, 0);
mem.Write<int>(ptr + OFFSET_GLOW_T2, 0);
mem.Write<int>(ptr + OFFSET_GLOW_ENABLE, 2);
mem.Write<int>(ptr + OFFSET_GLOW_THROUGH_WALLS, 5);
}
void Entity::SetViewAngles(WinProcess& mem, SVector angles) void Entity::SetViewAngles(WinProcess& mem, SVector angles)
{ {
mem.Write<SVector>(ptr + OFFSET_VIEWANGLES, angles); mem.Write<SVector>(ptr + OFFSET_VIEWANGLES, angles);
@ -115,7 +137,7 @@ QAngle Entity::GetRecoil()
bool Item::isItem() bool Item::isItem()
{ {
return *(int*)(buffer + OFFSET_ITEM_GLOW) >= 1358917120 && *(int*)(buffer + OFFSET_ITEM_GLOW) <= 1646297344; return *(int*)(buffer + OFFSET_ITEM_GLOW) >= 1358917120 && *(int*)(buffer + OFFSET_ITEM_GLOW) <= 1696628992;
} }
bool Item::isGlowing() bool Item::isGlowing()
@ -215,6 +237,7 @@ QAngle CalculateBestBoneAim(WinProcess& mem, Entity& from, uintptr_t t, float ma
QAngle ViewAngles = from.GetViewAngles(); QAngle ViewAngles = from.GetViewAngles();
QAngle SwayAngles = from.GetSwayAngles(); QAngle SwayAngles = from.GetSwayAngles();
//remove sway and recoil //remove sway and recoil
if(aim_no_recoil)
CalculatedAngles-=SwayAngles-ViewAngles; CalculatedAngles-=SwayAngles-ViewAngles;
Math::NormalizeAngles(CalculatedAngles); Math::NormalizeAngles(CalculatedAngles);
QAngle Delta = CalculatedAngles - ViewAngles; QAngle Delta = CalculatedAngles - ViewAngles;

@ -29,6 +29,7 @@ public:
int getTeamId(); int getTeamId();
int getHealth(); int getHealth();
int getShield(); int getShield();
bool isGlowing();
Vector getAbsVelocity(); Vector getAbsVelocity();
QAngle GetSwayAngles(); QAngle GetSwayAngles();
QAngle GetViewAngles(); QAngle GetViewAngles();
@ -36,6 +37,8 @@ public:
QAngle GetRecoil(); QAngle GetRecoil();
Vector GetViewAnglesV(); Vector GetViewAnglesV();
void enableGlow(WinProcess& mem);
void disableGlow(WinProcess& mem);
void SetViewAngles(WinProcess& mem, SVector angles); void SetViewAngles(WinProcess& mem, SVector angles);
void SetViewAngles(WinProcess& mem, QAngle& angles); void SetViewAngles(WinProcess& mem, QAngle& angles);
Vector getBonePosition(WinProcess& mem, int id); Vector getBonePosition(WinProcess& mem, int id);

@ -30,6 +30,8 @@ int toRead = 100;
int aim = false; int aim = false;
bool esp = false; bool esp = false;
bool item_glow = false; bool item_glow = false;
bool player_glow = false;
extern bool aim_no_recoil;
int safe_level = 0; int safe_level = 0;
bool aiming = false; bool aiming = false;
extern float smooth; extern float smooth;
@ -176,6 +178,15 @@ void DoActions(WinProcess& mem)
continue; continue;
} }
if(player_glow && !Target.isGlowing())
{
Target.enableGlow(mem);
}
else if(!player_glow && Target.isGlowing())
{
Target.disableGlow(mem);
}
ProcessPlayer(mem, LPlayer, Target, entitylist, c); ProcessPlayer(mem, LPlayer, Target, entitylist, c);
c++; c++;
} }
@ -195,6 +206,47 @@ void DoActions(WinProcess& mem)
} }
ProcessPlayer(mem, LPlayer, Target, entitylist, i); ProcessPlayer(mem, LPlayer, Target, entitylist, i);
int entity_team = Target.getTeamId();
if (entity_team == team_player)
{
continue;
}
switch (safe_level)
{
case 1:
if (spectators > 0)
{
if(!player_glow && Target.isGlowing())
{
Target.disableGlow(mem);
}
continue;
}
break;
case 2:
if (spectators+allied_spectators > 0)
{
if(!player_glow && Target.isGlowing())
{
Target.disableGlow(mem);
}
continue;
}
break;
default:
break;
}
if(player_glow && !Target.isGlowing())
{
Target.enableGlow(mem);
}
else if(!player_glow && Target.isGlowing())
{
Target.disableGlow(mem);
}
} }
} }
spectators = tmp_spec; spectators = tmp_spec;
@ -505,7 +557,9 @@ static void set_vars(WinProcess& mem, uint64_t add_addr)
uint64_t valid_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*9); uint64_t valid_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*9);
uint64_t max_dist_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*10); uint64_t max_dist_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*10);
uint64_t item_glow_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*11); uint64_t item_glow_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*11);
uint64_t smooth_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*12); uint64_t player_glow_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*12);
uint64_t aim_no_recoil_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*13);
uint64_t smooth_addr = mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*14);
if(mem.Read<int>(spec_addr)!=1) if(mem.Read<int>(spec_addr)!=1)
{ {
@ -532,6 +586,8 @@ static void set_vars(WinProcess& mem, uint64_t add_addr)
aiming = mem.Read<bool>(aiming_addr); aiming = mem.Read<bool>(aiming_addr);
max_dist = mem.Read<float>(max_dist_addr); max_dist = mem.Read<float>(max_dist_addr);
item_glow = mem.Read<bool>(item_glow_addr); item_glow = mem.Read<bool>(item_glow_addr);
player_glow = mem.Read<bool>(player_glow_addr);
aim_no_recoil = mem.Read<bool>(aim_no_recoil_addr);
smooth = mem.Read<float>(smooth_addr); smooth = mem.Read<float>(smooth_addr);
if(esp && next) if(esp && next)

@ -26,15 +26,17 @@ int aim = 0; //read
bool esp = false; //read bool esp = false; //read
int safe_level = 0; //read int safe_level = 0; //read
bool item_glow = false; bool item_glow = false;
bool player_glow = false;
bool aim_no_recoil = true;
bool aiming = false; //read bool aiming = false; //read
uint64_t g_Base = 0; //write uint64_t g_Base = 0; //write
float max_dist = 200.0f*40.0f; //read float max_dist = 200.0f * 40.0f; //read
float smooth = 12.0f; float smooth = 12.0f;
bool valid = false; //write bool valid = false; //write
bool next = false; //read write bool next = false; //read write
uint64_t add[13]; uint64_t add[15];
bool k_f5 = 0; bool k_f5 = 0;
bool k_f6 = 0; bool k_f6 = 0;
@ -86,7 +88,7 @@ void Overlay::RenderEsp()
} }
} }
if(v.line) if (v.line)
DrawLine(ImVec2((float)(getWidth() / 2), (float)getHeight()), ImVec2(players[i].b_x, players[i].b_y), BLUE, 1); //LINE FROM MIDDLE SCREEN DrawLine(ImVec2((float)(getWidth() / 2), (float)getHeight()), ImVec2(players[i].b_x, players[i].b_y), BLUE, 1); //LINE FROM MIDDLE SCREEN
if (v.distance) if (v.distance)
@ -123,7 +125,9 @@ int main(int argc, char** argv)
add[9] = (uintptr_t)&valid; add[9] = (uintptr_t)&valid;
add[10] = (uintptr_t)&max_dist; add[10] = (uintptr_t)&max_dist;
add[11] = (uintptr_t)&item_glow; add[11] = (uintptr_t)&item_glow;
add[12] = (uintptr_t)&smooth; add[12] = (uintptr_t)&player_glow;
add[13] = (uintptr_t)&aim_no_recoil;
add[14] = (uintptr_t)&smooth;
printf("add offset: 0x%I64x\n", (uint64_t)&add[0] - (uint64_t)GetModuleHandle(NULL)); printf("add offset: 0x%I64x\n", (uint64_t)&add[0] - (uint64_t)GetModuleHandle(NULL));
Overlay ov1 = Overlay(); Overlay ov1 = Overlay();
ov1.Start(); ov1.Start();
@ -238,7 +242,7 @@ int main(int argc, char** argv)
} }
ready = false; ready = false;
ov1.Clear(); ov1.Clear();
if(!use_nvidia) if (!use_nvidia)
system("taskkill /F /T /IM overlay_ap.exe"); //custom overlay process name system("taskkill /F /T /IM overlay_ap.exe"); //custom overlay process name
return 0; return 0;
} }

@ -3,6 +3,8 @@
extern int aim; extern int aim;
extern bool esp; extern bool esp;
extern bool item_glow; extern bool item_glow;
extern bool player_glow;
extern bool aim_no_recoil;
extern bool ready; extern bool ready;
extern bool use_nvidia; extern bool use_nvidia;
extern int safe_level; extern int safe_level;
@ -42,10 +44,10 @@ BOOL CALLBACK EnumWindowsCallback(HWND hwnd, LPARAM lParam)
{ {
if (wcscmp(L"CEF-OSC-WIDGET", className) == 0) //Nvidia overlay if (wcscmp(L"CEF-OSC-WIDGET", className) == 0) //Nvidia overlay
{ {
Process_Informations* proc = (Process_Informations*)lParam; HWND* w = (HWND*)lParam;
if (GetWindowLong(hwnd, GWL_STYLE) != nv_default && GetWindowLong(hwnd, GWL_STYLE) != nv_default_in_game) if (GetWindowLong(hwnd, GWL_STYLE) != nv_default && GetWindowLong(hwnd, GWL_STYLE) != nv_default_in_game)
return TRUE; return TRUE;
proc->overlayHWND = hwnd; *w = hwnd;
return TRUE; return TRUE;
} }
} }
@ -53,8 +55,8 @@ BOOL CALLBACK EnumWindowsCallback(HWND hwnd, LPARAM lParam)
{ {
if (wcscmp(L"overlay", className) == 0) //Custom overlay if (wcscmp(L"overlay", className) == 0) //Custom overlay
{ {
Process_Informations* proc = (Process_Informations*)lParam; HWND* w = (HWND*)lParam;
proc->overlayHWND = hwnd; *w = hwnd;
return TRUE; return TRUE;
} }
} }
@ -114,7 +116,7 @@ void Overlay::RenderMenu()
all_spec_disable = false; all_spec_disable = false;
} }
ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(490, 240)); ImGui::SetNextWindowSize(ImVec2(490, 250));
ImGui::Begin("##title", (bool*)true, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar); ImGui::Begin("##title", (bool*)true, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar);
if (ImGui::BeginTabBar("Tab")) if (ImGui::BeginTabBar("Tab"))
{ {
@ -147,6 +149,8 @@ void Overlay::RenderMenu()
{ {
ImGui::SameLine(); ImGui::SameLine();
ImGui::Checkbox("Visibility check", &vis_check); ImGui::Checkbox("Visibility check", &vis_check);
ImGui::SameLine();
ImGui::Checkbox("No recoil/sway", &aim_no_recoil);
if (vis_check) if (vis_check)
{ {
aim = 2; aim = 2;
@ -162,6 +166,7 @@ void Overlay::RenderMenu()
} }
ImGui::Checkbox("Glow items", &item_glow); ImGui::Checkbox("Glow items", &item_glow);
ImGui::Checkbox("Glow players", &player_glow);
ImGui::Text("Max distance:"); ImGui::Text("Max distance:");
ImGui::SliderFloat("##1", &max_dist, 100.0f * 40, 800.0f * 40, "%.2f"); ImGui::SliderFloat("##1", &max_dist, 100.0f * 40, 800.0f * 40, "%.2f");
@ -221,20 +226,20 @@ void Overlay::ClickThrough(bool v)
if (v) if (v)
{ {
nv_edit = nv_default_in_game | WS_VISIBLE; nv_edit = nv_default_in_game | WS_VISIBLE;
SetWindowLong(proc.overlayHWND, GWL_EXSTYLE, nv_ex_edit); SetWindowLong(overlayHWND, GWL_EXSTYLE, nv_ex_edit);
} }
else else
{ {
nv_edit = nv_default | WS_VISIBLE; nv_edit = nv_default | WS_VISIBLE;
SetWindowLong(proc.overlayHWND, GWL_EXSTYLE, nv_ex_edit_menu); SetWindowLong(overlayHWND, GWL_EXSTYLE, nv_ex_edit_menu);
} }
} }
DWORD Overlay::CreateOverlay() DWORD Overlay::CreateOverlay()
{ {
EnumWindows(EnumWindowsCallback, (LPARAM)&proc); EnumWindows(EnumWindowsCallback, (LPARAM)&overlayHWND);
Sleep(300); Sleep(300);
if (proc.overlayHWND == 0) if (overlayHWND == 0)
{ {
printf("Can't find the overlay\n"); printf("Can't find the overlay\n");
Sleep(1000); Sleep(1000);
@ -248,15 +253,15 @@ DWORD Overlay::CreateOverlay()
running = true; running = true;
// Initialize Direct3D // Initialize Direct3D
if (!CreateDeviceD3D(proc.overlayHWND)) if (!CreateDeviceD3D(overlayHWND))
{ {
CleanupDeviceD3D(); CleanupDeviceD3D();
return 1; return 1;
} }
// Show the window // Show the window
::ShowWindow(proc.overlayHWND, SW_SHOWDEFAULT); ::ShowWindow(overlayHWND, SW_SHOWDEFAULT);
::UpdateWindow(proc.overlayHWND); ::UpdateWindow(overlayHWND);
// Setup Dear ImGui context // Setup Dear ImGui context
IMGUI_CHECKVERSION(); IMGUI_CHECKVERSION();
@ -267,7 +272,7 @@ DWORD Overlay::CreateOverlay()
ImGui::StyleColorsDark(); ImGui::StyleColorsDark();
// Setup Platform/Renderer bindings // Setup Platform/Renderer bindings
ImGui_ImplWin32_Init(proc.overlayHWND); ImGui_ImplWin32_Init(overlayHWND);
ImGui_ImplDX9_Init(g_pd3dDevice); ImGui_ImplDX9_Init(g_pd3dDevice);
ImVec4 clear_color = ImVec4(0.0f, 0.0f, 0.0f, 0.00f); ImVec4 clear_color = ImVec4(0.0f, 0.0f, 0.0f, 0.00f);
@ -281,10 +286,10 @@ DWORD Overlay::CreateOverlay()
HWND wnd = GetWindow(GetForegroundWindow(), GW_HWNDPREV); HWND wnd = GetWindow(GetForegroundWindow(), GW_HWNDPREV);
if (use_nvidia) if (use_nvidia)
{ {
if (GetWindowLong(proc.overlayHWND, GWL_STYLE) != nv_edit) if (GetWindowLong(overlayHWND, GWL_STYLE) != nv_edit)
SetWindowLong(proc.overlayHWND, GWL_STYLE, nv_edit); SetWindowLong(overlayHWND, GWL_STYLE, nv_edit);
if (GetWindowLong(proc.overlayHWND, GWL_EXSTYLE) != nv_ex_edit) if (GetWindowLong(overlayHWND, GWL_EXSTYLE) != nv_ex_edit)
SetWindowLong(proc.overlayHWND, GWL_EXSTYLE, nv_ex_edit); SetWindowLong(overlayHWND, GWL_EXSTYLE, nv_ex_edit);
if (show_menu) if (show_menu)
{ {
ClickThrough(false); ClickThrough(false);
@ -294,10 +299,10 @@ DWORD Overlay::CreateOverlay()
ClickThrough(true); ClickThrough(true);
} }
} }
if (wnd != proc.overlayHWND) if (wnd != overlayHWND)
{ {
SetWindowPos(proc.overlayHWND, wnd, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOSIZE); SetWindowPos(overlayHWND, wnd, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOSIZE);
::UpdateWindow(proc.overlayHWND); ::UpdateWindow(overlayHWND);
} }
if (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE)) if (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
@ -341,7 +346,7 @@ DWORD Overlay::CreateOverlay()
k_ins = false; k_ins = false;
} }
if(show_menu) if (show_menu)
RenderMenu(); RenderMenu();
else else
RenderInfo(); RenderInfo();
@ -371,7 +376,7 @@ DWORD Overlay::CreateOverlay()
ClickThrough(true); ClickThrough(true);
CleanupDeviceD3D(); CleanupDeviceD3D();
::DestroyWindow(proc.overlayHWND); ::DestroyWindow(overlayHWND);
return 0; return 0;
} }
@ -387,8 +392,8 @@ void Overlay::Clear()
Sleep(50); Sleep(50);
if (use_nvidia) if (use_nvidia)
{ {
SetWindowLong(proc.overlayHWND, GWL_STYLE, nv_default); SetWindowLong(overlayHWND, GWL_STYLE, nv_default);
SetWindowLong(proc.overlayHWND, GWL_EXSTYLE, nv_ex_default); SetWindowLong(overlayHWND, GWL_EXSTYLE, nv_ex_default);
} }
} }

@ -11,7 +11,6 @@
#include <cwchar> #include <cwchar>
#include <thread> #include <thread>
#include <string> #include <string>
#include <codecvt>
#include "imgui/imgui.h" #include "imgui/imgui.h"
#include "imgui/imgui_impl_dx9.h" #include "imgui/imgui_impl_dx9.h"
#include "imgui/imgui_impl_win32.h" #include "imgui/imgui_impl_win32.h"
@ -25,11 +24,6 @@
#define ORANGE ImColor(255, 165, 0) #define ORANGE ImColor(255, 165, 0)
#define WHITE ImColor(255, 255, 255) #define WHITE ImColor(255, 255, 255)
struct Process_Informations
{
HWND overlayHWND;
};
typedef struct visuals typedef struct visuals
{ {
bool box = true; bool box = true;
@ -59,6 +53,5 @@ public:
void String(ImVec2 pos, ImColor color, const char* text); void String(ImVec2 pos, ImColor color, const char* text);
private: private:
bool running; bool running;
Process_Informations proc; HWND overlayHWND;
}; };

Loading…
Cancel
Save