Added spectators count

The number of spectators isn't always accurate. It is a sort of a heuristic method to know if someone is spectating you.
pull/27/head
MisterY52 3 years ago
parent 0b0f35b745
commit eb4cd5dfb3

@ -121,6 +121,20 @@ Vector Entity::GetViewAnglesV()
return *(Vector*)(buffer + OFFSET_VIEWANGLES);
}
float Entity::GetYaw()
{
float yaw = 0;
apex_mem.Read<float>(ptr + OFFSET_YAW, yaw);
if (yaw < 0)
yaw += 360;
yaw += 90;
if (yaw > 360)
yaw -= 360;
return yaw;
}
bool Entity::isGlowing()
{
return *(int*)(buffer + OFFSET_GLOW_ENABLE) == 7;

@ -37,6 +37,7 @@ public:
Vector GetCamPos();
QAngle GetRecoil();
Vector GetViewAnglesV();
float GetYaw();
void enableGlow();
void disableGlow();

@ -68,20 +68,35 @@ struct Matrix
float lastvis_esp[toRead];
float lastvis_aim[toRead];
int tmp_spec = 0, spectators = 0;
int tmp_all_spec = 0, allied_spectators = 0;
//////////////////////////////////////////////////////////////////////////////////////////////////
void ProcessPlayer(Entity& LPlayer, Entity& target, uint64_t entitylist, int index)
{
int entity_team = target.getTeamId();
if (!target.isAlive())
{
float localyaw = LPlayer.GetYaw();
float targetyaw = target.GetYaw();
if(localyaw==targetyaw)
{
if(LPlayer.getTeamId() == entity_team)
tmp_all_spec++;
else
tmp_spec++;
}
return;
}
Vector EntityPosition = target.getPosition();
Vector LocalPlayerPosition = LPlayer.getPosition();
float dist = LocalPlayerPosition.DistTo(EntityPosition);
if (dist > max_dist) return;
if (!target.isAlive())
return;
if(!firing_range)
if (entity_team < 0 || entity_team>50 || entity_team == team_player) return;
@ -123,6 +138,8 @@ void DoActions()
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
bool tmp_thirdperson = false;
uint32_t counter = 0;
while (g_Base!=0 && c_Base!=0)
{
std::this_thread::sleep_for(std::chrono::milliseconds(30));
@ -169,6 +186,8 @@ void DoActions()
max = 999.0f;
tmp_aimentity = 0;
tmp_spec = 0;
tmp_all_spec = 0;
if(firing_range)
{
int c=0;
@ -232,6 +251,23 @@ void DoActions()
}
}
if(!spectators && !allied_spectators)
{
spectators = tmp_spec;
allied_spectators = tmp_all_spec;
}
else
{
//refresh spectators count every ~2 seconds
counter++;
if(counter==70)
{
spectators = tmp_spec;
allied_spectators = tmp_all_spec;
counter = 0;
}
}
if(!lock)
aimentity = tmp_aimentity;
else
@ -524,6 +560,10 @@ static void set_vars(uint64_t add_addr)
client_mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*14, bone_addr);
uint64_t thirdperson_addr = 0;
client_mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*15, thirdperson_addr);
uint64_t spectators_addr = 0;
client_mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*16, spectators_addr);
uint64_t allied_spectators_addr = 0;
client_mem.Read<uint64_t>(add_addr + sizeof(uint64_t)*17, allied_spectators_addr);
uint32_t check = 0;
client_mem.Read<uint32_t>(check_addr, check);
@ -548,6 +588,8 @@ static void set_vars(uint64_t add_addr)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
client_mem.Write<uint64_t>(g_Base_addr, g_Base);
client_mem.Write<int>(spectators_addr, spectators);
client_mem.Write<int>(allied_spectators_addr, allied_spectators);
client_mem.Read<int>(aim_addr, aim);
client_mem.Read<bool>(esp_addr, esp);
@ -648,7 +690,7 @@ int main(int argc, char *argv[])
//const char* ap_proc = "EasyAntiCheat_launcher.exe";
//Client "add" offset
uint64_t add_off = 0x3f870;
uint64_t add_off = 0x3f880;
std::thread aimbot_thr;
std::thread esp_thr;

@ -36,11 +36,13 @@ float smooth = 12.0f;
float max_fov = 15.0f;
int bone = 2;
bool thirdperson = false;
int spectators = 0; //write
int allied_spectators = 0; //write
bool valid = false; //write
bool next = false; //read write
uint64_t add[16];
uint64_t add[18];
bool k_f5 = 0;
bool k_f6 = 0;
@ -135,6 +137,9 @@ int main(int argc, char** argv)
add[13] = (uintptr_t)&max_fov;
add[14] = (uintptr_t)&bone;
add[15] = (uintptr_t)&thirdperson;
add[16] = (uintptr_t)&spectators;
add[17] = (uintptr_t)&allied_spectators;
printf(XorStr("add offset: 0x%I64x\n"), (uint64_t)&add[0] - (uint64_t)GetModuleHandle(NULL));
Overlay ov1 = Overlay();

@ -12,6 +12,9 @@ extern float smooth;
extern float max_fov;
extern int bone;
extern bool thirdperson;
extern int spectators;
extern int allied_spectators;
int width;
int height;
bool k_leftclick = false;
@ -174,9 +177,14 @@ void Overlay::RenderMenu()
void Overlay::RenderInfo()
{
ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(22, 12));
ImGui::SetNextWindowSize(ImVec2(50, 25));
ImGui::Begin(XorStr("##info"), (bool*)true, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar);
DrawLine(ImVec2(7, 5), ImVec2(17, 5), RED, 4);
DrawLine(ImVec2(9, 5), ImVec2(45, 5), RED, 2);
ImGui::TextColored(RED, "%d", spectators);
ImGui::SameLine();
ImGui::Text("-");
ImGui::SameLine();
ImGui::TextColored(GREEN, "%d", allied_spectators);
ImGui::End();
}

Loading…
Cancel
Save