-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fakelag's add antiaim add thirdperson add some shit
- Loading branch information
Showing
34 changed files
with
569 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#include "animfix.h" | ||
|
||
void animfix::update_real_anim_state(c_user_cmd* cmd) | ||
{ | ||
allow_anim_state_update = true; | ||
|
||
real_anim_state->update( | ||
cmd->view_angles.y, | ||
cmd->view_angles.x | ||
); | ||
} | ||
|
||
void animfix::update_fake_anim_state(c_user_cmd* cmd, c_base_entity* local_player) | ||
{ | ||
allow_anim_state_update = true; | ||
|
||
local_player->get_anim_state()->update( | ||
cmd->view_angles.y, | ||
cmd->view_angles.x | ||
); | ||
} | ||
|
||
void animfix::update_real_bones(c_base_entity* local_player) | ||
{ | ||
local_player->invalidate_bone_cache(); | ||
if (local_player->get_client_renderable()->setup_bones(real_matrix, MAX_STUDIO_BONES, BONE_USED_BY_ANYTHING, interfaces::global_vars->curtime)) | ||
created_real_matrix = true; | ||
} | ||
|
||
void animfix::update_fake_bones(c_base_entity* local_player) | ||
{ | ||
local_player->invalidate_bone_cache(); | ||
if (local_player->get_client_renderable()->setup_bones(fake_matrix, MAX_STUDIO_BONES, BONE_USED_BY_ANYTHING, interfaces::global_vars->curtime)) | ||
created_fake_matrix = true; | ||
} | ||
|
||
void animfix::swap_anim_states(c_base_entity* local_player) | ||
{ | ||
std::swap(*real_anim_state, *local_player->get_anim_state()); | ||
} | ||
|
||
void animfix::run(c_user_cmd* cmd, bool send_packet) | ||
{ | ||
c_base_entity* local_player = interfaces::entity_list->get_entity(interfaces::engine->get_local_player()); | ||
if (!local_player || !local_player->is_alive()) | ||
return; | ||
|
||
if (allow_anim_state_reset) | ||
{ | ||
real_anim_state = local_player->create_anim_state(); | ||
|
||
if (!real_move_data) | ||
real_move_data = new multi_player_movement_data_t{}; | ||
|
||
real_anim_state->init(local_player, *real_move_data); | ||
|
||
allow_anim_state_reset = false; | ||
} | ||
|
||
float ft = interfaces::global_vars->frametime; | ||
interfaces::global_vars->frametime = interfaces::global_vars->interval_per_tick; | ||
|
||
q_angle old = local_player->eye_angles(); | ||
local_player->eye_angles() = cmd->view_angles; | ||
|
||
update_real_anim_state(cmd); | ||
|
||
if (send_packet) | ||
{ | ||
swap_anim_states(local_player); | ||
update_real_bones(local_player); | ||
swap_anim_states(local_player); | ||
|
||
interfaces::global_vars->frametime = interfaces::global_vars->interval_per_tick * ticks_elapsed; | ||
|
||
update_fake_anim_state(cmd, local_player); | ||
update_fake_bones(local_player); | ||
|
||
ticks_elapsed = 1; | ||
} | ||
else | ||
ticks_elapsed++; | ||
|
||
local_player->eye_angles() = old; | ||
interfaces::global_vars->frametime = ft; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
#include "../../hooks/hooks.h" | ||
|
||
namespace animfix | ||
{ | ||
inline c_hl2mp_player_anim_state* real_anim_state; | ||
inline multi_player_movement_data_t* real_move_data; | ||
|
||
inline matrix3x4 real_matrix[MAX_STUDIO_BONES]; | ||
inline matrix3x4 fake_matrix[MAX_STUDIO_BONES]; | ||
|
||
inline bool created_real_matrix = false; | ||
inline bool created_fake_matrix = false; | ||
|
||
inline bool allow_anim_state_update = false; | ||
inline bool allow_anim_state_reset = true; | ||
|
||
inline int ticks_elapsed = 0; | ||
|
||
void update_real_anim_state(c_user_cmd* cmd); | ||
void update_fake_anim_state(c_user_cmd* cmd, c_base_entity* local_player); | ||
void update_real_bones(c_base_entity* local_player); | ||
void update_fake_bones(c_base_entity* local_player); | ||
void swap_anim_states(c_base_entity* local_player); | ||
void run(c_user_cmd* cmd, bool send_packet); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "antiaim.h" | ||
|
||
void antiaim::run(c_user_cmd* cmd, bool send_packet) | ||
{ | ||
if (!settings::antiaim::globals::enable) | ||
return; | ||
|
||
if (!settings::antiaim::globals::hotkey.check()) | ||
return; | ||
|
||
c_base_entity* local_player = interfaces::entity_list->get_entity(interfaces::engine->get_local_player()); | ||
if (!local_player || !local_player->is_alive()) | ||
return; | ||
|
||
if (local_player->get_move_type() == MOVETYPE_NOCLIP || local_player->get_move_type() == MOVETYPE_LADDER) | ||
return; | ||
|
||
if (cmd->buttons & IN_USE || cmd->buttons & IN_ATTACK) | ||
return; | ||
|
||
q_angle view; | ||
interfaces::engine->get_view_angles(view); | ||
|
||
float pitch = 0.f; | ||
float yaw = 0.f; | ||
|
||
switch (settings::antiaim::globals::pitch) | ||
{ | ||
case 0: | ||
pitch = 90.f; | ||
break; | ||
case 1: | ||
pitch = -90.f; | ||
break; | ||
} | ||
|
||
switch (settings::antiaim::globals::yaw) | ||
{ | ||
case 0: | ||
yaw = view.y + (send_packet ^ settings::antiaim::globals::invert_yaw ? -90 : 90); | ||
break; | ||
case 1: | ||
yaw = local_player->get_anim_state()->current_feet_yaw + (send_packet ? 180 : 0); | ||
break; | ||
} | ||
|
||
cmd->view_angles.x = pitch; | ||
cmd->view_angles.y = yaw; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
#include "../../hooks/hooks.h" | ||
|
||
namespace antiaim | ||
{ | ||
void run(c_user_cmd* cmd, bool send_packet); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include "fakelags.h" | ||
|
||
bool fakelags::run(c_user_cmd* cmd) | ||
{ | ||
c_base_entity* local_player = interfaces::entity_list->get_entity(interfaces::engine->get_local_player()); | ||
if (!local_player || !local_player->is_alive()) | ||
return true; | ||
|
||
if (settings::antiaim::globals::fake_duck && cmd->buttons & IN_DUCK && local_player->get_flags() & FL_ONGROUND) | ||
{ | ||
if (cmd->command_number & 1) | ||
{ | ||
cmd->buttons &= ~IN_DUCK; | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
if (!settings::antiaim::fakelags::enable || cmd->buttons & IN_ATTACK) | ||
return true; | ||
|
||
if (interfaces::client_state->choked_commands < settings::antiaim::fakelags::count) | ||
{ | ||
switch (settings::antiaim::fakelags::method) | ||
{ | ||
case 0: | ||
if (local_player->get_flags() & FL_ONGROUND) | ||
return false; | ||
break; | ||
case 1: | ||
if (!(local_player->get_flags() & FL_ONGROUND)) | ||
return false; | ||
break; | ||
case 2: | ||
if (local_player->get_velocity().length_2d() > 50.f) | ||
return false; | ||
break; | ||
case 3: | ||
if (local_player->get_velocity().length_2d() < 50.f) | ||
return false; | ||
break; | ||
case 4: | ||
return false; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
//https://www.unknowncheats.me/forum/garry-s-mod/615861-cusercmd-createmove-fakelag-x64.html | ||
void fakelags::apply(bool send_packet) | ||
{ | ||
static void* p_send_packet = reinterpret_cast<void*>((uintptr_t)memory::pattern_scanner(xorstr("engine.dll"), xorstr("40 55 53 48 8D AC 24 38 F0 FF FF B8 C8 10 00 00 E8 ?? ?? ?? ?? 48 2B E0 0F 29 B4 24 B0 10 00 00")) + 0x168); | ||
|
||
static uint8_t jz_bytes[] = { 0x0f, 0x84, 0x04, 0x01, 0x00, 0x00 }; | ||
static uint8_t jnz_bytes[] = { 0x0f, 0x85, 0x04, 0x01, 0x00, 0x00 }; | ||
|
||
DWORD old_protect; | ||
VirtualProtect(p_send_packet, 6, PAGE_EXECUTE_READWRITE, &old_protect); | ||
memcpy(p_send_packet, send_packet ? jz_bytes : jnz_bytes, 6); | ||
VirtualProtect(p_send_packet, 6, old_protect, &old_protect); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
#include "../../hooks/hooks.h" | ||
|
||
namespace fakelags | ||
{ | ||
bool run(c_user_cmd* cmd); | ||
void apply(bool send_packet); | ||
} |
Oops, something went wrong.