merged from seg
This commit is contained in:
explorer 2024-11-09 15:31:28 +03:00
parent e462dff4f5
commit bdf8f51f29
22 changed files with 143 additions and 446 deletions

View File

@ -1,6 +1,38 @@
#pragma once
namespace Byte_Manager
{
#include "Byte_Manager_Functions.hpp"
void Set_Bytes(__int8 Writeable, void* Address, unsigned __int32 Size, unsigned __int8 Byte)
{
if (Writeable == 0)
{
DWORD Previous_Access_Rights;
VirtualProtect(Address, Size, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
__builtin_memset(Address, Byte, Size);
VirtualProtect(Address, Size, Previous_Access_Rights, &Previous_Access_Rights);
}
else
{
__builtin_memset(Address, Byte, Size);
}
}
void Copy_Bytes(__int8 Writeable, void* Address, unsigned __int32 Size, void* Bytes)
{
if (Writeable == 0)
{
DWORD Previous_Access_Rights;
VirtualProtect(Address, Size, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
__builtin_memcpy(Address, Bytes, Size);
VirtualProtect(Address, Size, Previous_Access_Rights, &Previous_Access_Rights);
}
else
{
__builtin_memcpy(Address, Bytes, Size);
}
}
};

View File

@ -1,22 +0,0 @@
#pragma once
#ifdef Bits_32
void Copy_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int32 Bytes_Amount, void* Bytes)
#else
void Copy_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int64 Bytes_Amount, void* Bytes)
#endif
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
}
__builtin_memcpy(Starting_Location, Bytes, Bytes_Amount);
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, Previous_Access_Rights, &Previous_Access_Rights);
}
}

View File

@ -1,24 +0,0 @@
#pragma once
#ifdef Bits_32
void* Find_Bytes(void* Starting_Location, void* Bytes, unsigned __int32 Bytes_Amount)
#else
void* Find_Bytes(void* Starting_Location, void* Bytes, unsigned __int64 Bytes_Amount)
#endif
{
Compare_Bytes_Label:
{
if (__builtin_memcmp(Starting_Location, Bytes, Bytes_Amount) == 0)
{
return Starting_Location;
}
#ifdef Bits_32
Starting_Location = (void*)((unsigned __int32)Starting_Location + 1);
#else
Starting_Location = (void*)((unsigned __int64)Starting_Location + 1);
#endif
goto Compare_Bytes_Label;
}
}

View File

@ -1,7 +0,0 @@
#pragma once
#include "Byte_Manager_Find_Bytes.hpp"
#include "Byte_Manager_Set_Bytes.hpp"
#include "Byte_Manager_Copy_Bytes.hpp"

View File

@ -1,22 +0,0 @@
#pragma once
#ifdef Bits_32
void Set_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int32 Bytes_Amount, unsigned __int8 Byte)
#else
void Set_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int64 Bytes_Amount, unsigned __int8 Byte)
#endif
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
}
__builtin_memset(Starting_Location, Byte, Bytes_Amount);
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, Previous_Access_Rights, &Previous_Access_Rights);
}
}

View File

@ -6,5 +6,5 @@ void __thiscall Redirected_Calculate_View(void* Player, void* Unknown_Parameter_
using Get_Eye_Angles_Type = float*(__thiscall*)(void* Entity);
Byte_Manager::Copy_Bytes(0, Angles, sizeof(float[3]), Get_Eye_Angles_Type((unsigned __int32)Client_Module + 2237296)(Player));
Byte_Manager::Copy_Bytes(1, Angles, sizeof(float[3]), Get_Eye_Angles_Type((unsigned __int32)Client_Module + 2237296)(Player));
}

View File

@ -70,9 +70,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
Command->Angles[0],
Command->Angles[1],
0
Command->Angles[1]
};
static float Previous_Move_Angle_Y;
@ -130,7 +128,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
float Previous_Move[2];
Byte_Manager::Copy_Bytes(0, Previous_Move, sizeof(Previous_Move), Command->Move);
Byte_Manager::Copy_Bytes(1, Previous_Move, sizeof(Previous_Move), Command->Move);
float Desired_Move_Forward[3];
@ -138,11 +136,11 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
Angle_Vectors(Move_Angles, Desired_Move_Forward, Desired_Move_Right, nullptr);
Desired_Move_Forward[2] = 0;
Desired_Move_Forward[2] = 0.f;
Vector_Normalize(Desired_Move_Forward);
Desired_Move_Right[2] = 0;
Desired_Move_Right[2] = 0.f;
Vector_Normalize(Desired_Move_Right);
@ -161,11 +159,11 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
Angle_Vectors(Command->Angles, Move_Forward, Move_Right, nullptr);
Move_Forward[2] = 0;
Move_Forward[2] = 0.f;
Vector_Normalize(Move_Forward);
Move_Right[2] = 0;
Move_Right[2] = 0.f;
Vector_Normalize(Move_Right);
@ -303,7 +301,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
if (*(__int32*)((unsigned __int32)Entity + 228) % 2 != *(__int32*)((unsigned __int32)Local_Player + 228) % 2)
{
float* Local_Player_Origin = (float*)((unsigned __int32)Local_Player + 292);
float* Local_Origin = (float*)((unsigned __int32)Local_Player + 292);
float* Entity_Origin = (float*)((unsigned __int32)Entity + 292);
@ -317,7 +315,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
(__int8)(Identifier == 270 ? *(void**)((unsigned __int32)Entity + 8040) == *(void**)((unsigned __int32)Local_Player + 376) : 0),
__builtin_powf(Local_Player_Origin[0] - Entity_Origin[0], 2.f) + __builtin_powf(Local_Player_Origin[1] - Entity_Origin[1], 2.f) + __builtin_powf(Local_Player_Origin[2] - Entity_Origin[2], 2.f),
__builtin_powf(Local_Origin[0] - Entity_Origin[0], 2.f) + __builtin_powf(Local_Origin[1] - Entity_Origin[1], 2.f) + __builtin_powf(Local_Origin[2] - Entity_Origin[2], 2.f),
(__int32)(Time / Global_Variables->Interval_Per_Tick + 0.5f)
};
@ -656,11 +654,11 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
float Hitbox_Center[3]
{
(Hitbox_Minimum[0] + Hitbox_Maximum[0]) / 2,
(Hitbox_Minimum[0] + Hitbox_Maximum[0]) / 2.f,
(Hitbox_Minimum[1] + Hitbox_Maximum[1]) / 2,
(Hitbox_Minimum[1] + Hitbox_Maximum[1]) / 2.f,
(Hitbox_Minimum[2] + Hitbox_Maximum[2]) / 2
(Hitbox_Minimum[2] + Hitbox_Maximum[2]) / 2.f
};
float Target_Origin[3] =
@ -696,7 +694,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
Command->Tick_Number = Target->Tick_Number;
Byte_Manager::Copy_Bytes(0, Command->Angles, sizeof(Angles), Angles);
Byte_Manager::Copy_Bytes(1, Command->Angles, sizeof(Angles), Angles);
Command->Buttons |= 1;
@ -763,7 +761,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
Command->Buttons &= ~Block_Buttons;
Byte_Manager::Copy_Bytes(0, Command->Move, sizeof(Previous_Move), Previous_Move);
Byte_Manager::Copy_Bytes(1, Command->Move, sizeof(Previous_Move), Previous_Move);
Correct_Movement();

View File

@ -39,11 +39,17 @@ void Redirected_Draw_Crosshair()
__int32 Storm_Number = 0;
using Get_Screen_Size_Type = __int32(__cdecl*)();
using Get_Screen_Size_Type = __int32(__cdecl*)(__int32* Width, __int32* Height);
__int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738576)() / 2;
__int32 Screen_Width;
__int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738544)() / 2;
__int32 Screen_Height;
Get_Screen_Size_Type((unsigned __int32)Client_Module + 1780352)(&Screen_Width, &Screen_Height);
Screen_Width /= 2;
Screen_Height /= 2;
Draw_Storm_Label:
{

View File

@ -4,8 +4,6 @@
#include <cstdio>
#define Bits_32
#include "Byte_Manager/Byte_Manager.hpp"
#include "Redirection_Manager/Redirection_Manager.hpp"
@ -119,7 +117,7 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
}
else
{
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)LoadLibraryW(L"vaudio_speex.dll") + 9440), 1, 195);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)LoadLibraryW(L"vaudio_speex.dll") + 9440), 1, 195);
AllocConsole();
@ -185,33 +183,33 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
_putws(L"[ + ] Events");
{
Redirection_Manager::Redirect_Function(Original_Post_Network_Data_Received_Caller, 0, (void*)((unsigned __int32)Client_Module + 1555264), 1, (void*)Redirected_Post_Network_Data_Received);
Original_Post_Network_Data_Received_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 1555264), (void*)Redirected_Post_Network_Data_Received);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 316816), 1, 195);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 316816), 1, 195);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Engine_Module + 350575), 1, 94);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Engine_Module + 350575), 1, 94);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Engine_Module + 521741), 1, 235);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Engine_Module + 521741), 1, 235);
*(void**)((unsigned __int32)Client_Module + 7492840) = (void*)Redirected_Set_Move_Type;
}
_putws(L"[ + ] Interpolation");
{
Redirection_Manager::Redirect_Function(Original_Interpolate_Caller, 0, (void*)((unsigned __int32)Client_Module + 214256), 1, (void*)Redirected_Interpolate);
Original_Interpolate_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 214256), (void*)Redirected_Interpolate);
}
_putws(L"[ + ] Animations");
{
Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 205296), (void*)Redirected_Update_Animations);
Redirection_Manager::Redirect_Function(Original_Estimate_Velocity_Caller, 0, (void*)((unsigned __int32)Client_Module + 311856), 1, (void*)Redirected_Estimate_Velocity);
Original_Estimate_Velocity_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 311856), (void*)Redirected_Estimate_Velocity);
unsigned __int8 Maintain_Sequence_Transitions_Bytes[3] = { 194, 24, 0 };
Byte_Manager::Copy_Bytes(1, (void*)((unsigned __int32)Client_Module + 245232), sizeof(Maintain_Sequence_Transitions_Bytes), Maintain_Sequence_Transitions_Bytes);
Byte_Manager::Copy_Bytes(0, (void*)((unsigned __int32)Client_Module + 245232), sizeof(Maintain_Sequence_Transitions_Bytes), Maintain_Sequence_Transitions_Bytes);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 3244278), 1, 15);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 3244278), 1, 15);
}
_putws(L"[ + ] Prediction");
@ -220,7 +218,7 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
{
Prediction_Descriptor_Structure* Original_Descriptor = (Prediction_Descriptor_Structure*)malloc(sizeof(Prediction_Descriptor_Structure));
Byte_Manager::Copy_Bytes(0, Original_Descriptor, sizeof(Prediction_Descriptor_Structure), Descriptor);
Byte_Manager::Copy_Bytes(1, Original_Descriptor, sizeof(Prediction_Descriptor_Structure), Descriptor);
Descriptor->Fields = Fields;
@ -237,27 +235,27 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
Add_Prediction_Fields((Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7290836), &Weapon_Fields, sizeof(Weapon_Fields) / sizeof(Prediction_Field_Structure));
Redirection_Manager::Redirect_Function(Original_Spawn_Grenade_Caller, 2, (void*)((unsigned __int32)Client_Module + 2227424), 1, (void*)Redirected_Spawn_Grenade);
Original_Spawn_Grenade_Caller = Redirection_Manager::Redirect_Function(2, (void*)((unsigned __int32)Client_Module + 2227424), (void*)Redirected_Spawn_Grenade);
Redirection_Manager::Redirect_Function(Original_Update_Caller, 0, (void*)((unsigned __int32)Client_Module + 1554304), 1, (void*)Redirected_Update);
Original_Update_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 1554304), (void*)Redirected_Update);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1554528), 1, 235);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 1554528), 1, 235);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1557776), 1, 235);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 1557776), 1, 235);
Redirection_Manager::Redirect_Function(Original_Run_Command_Caller, 0, (void*)((unsigned __int32)Client_Module + 1553504), 1, (void*)Redirected_Run_Command);
Original_Run_Command_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 1553504), (void*)Redirected_Run_Command);
Redirection_Manager::Redirect_Function(Original_Process_Movement_Caller, 2, (void*)((unsigned __int32)Client_Module + 2590832), 1, (void*)Redirected_Process_Movement);
Original_Process_Movement_Caller = Redirection_Manager::Redirect_Function(2, (void*)((unsigned __int32)Client_Module + 2590832), (void*)Redirected_Process_Movement);
Redirection_Manager::Redirect_Function(Original_Play_Footstep_Sound_Caller, 0, (void*)((unsigned __int32)Client_Module + 978464), 1, (void*)Redirected_Play_Footstep_Sound);
Original_Play_Footstep_Sound_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 978464), (void*)Redirected_Play_Footstep_Sound);
Redirection_Manager::Redirect_Function(Original_Finish_Move_Caller, 2, (void*)((unsigned __int32)Client_Module + 1553264), 1, (void*)Redirected_Finish_Move);
Original_Finish_Move_Caller = Redirection_Manager::Redirect_Function(2, (void*)((unsigned __int32)Client_Module + 1553264), (void*)Redirected_Finish_Move);
Redirection_Manager::Redirect_Function(Original_Item_Post_Frame_Caller, 3, (void*)((unsigned __int32)Client_Module + 2542896), 1, (void*)Redirected_Item_Post_Frame);
Original_Item_Post_Frame_Caller = Redirection_Manager::Redirect_Function(3, (void*)((unsigned __int32)Client_Module + 2542896), (void*)Redirected_Item_Post_Frame);
*(__int32*)((unsigned __int32)Original_Item_Post_Frame_Caller + 5) = (__int32)((unsigned __int32)Client_Module + 2438551) - (__int32)Original_Item_Post_Frame_Caller;
Redirection_Manager::Redirect_Function(Original_Perform_Trace_Caller, 0, (void*)((unsigned __int32)Client_Module + 3093744), 1, (void*)Redirected_Perform_Trace);
Original_Perform_Trace_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 3093744), (void*)Redirected_Perform_Trace);
Original_Perform_Shove_Trace_Caller = (void*)((unsigned __int32)Client_Module + 3221111);
@ -266,52 +264,52 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
_putws(L"[ + ] Network");
{
Redirection_Manager::Redirect_Function(Original_Read_Packets_Caller, 0, (void*)((unsigned __int32)Engine_Module + 499264), 1, (void*)Redirected_Read_Packets);
Original_Read_Packets_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Engine_Module + 499264), (void*)Redirected_Read_Packets);
Redirection_Manager::Redirect_Function(Original_Move_Caller, 3, (void*)((unsigned __int32)Engine_Module + 512288), 1, (void*)Redirected_Move);
Original_Move_Caller = Redirection_Manager::Redirect_Function(3, (void*)((unsigned __int32)Engine_Module + 512288), (void*)Redirected_Move);
Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Engine_Module + 511680), (void*)Redirected_Send_Move);
}
_putws(L"[ + ] Input");
{
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1250629), 3, 144);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 1250629), 3, 144);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 417204), 1, 235);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 417204), 1, 235);
Redirection_Manager::Redirect_Function(Original_Copy_Command_Caller, 0, (void*)((unsigned __int32)Client_Module + 1094624), 1, (void*)Redirected_Copy_Command);
Original_Copy_Command_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 1094624), (void*)Redirected_Copy_Command);
}
_putws(L"[ + ] Effects");
{
Redirection_Manager::Redirect_Function(Original_Calculate_View_Caller, 0, (void*)((unsigned __int32)Client_Module + 132944), 1, (void*)Redirected_Calculate_View);
Original_Calculate_View_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 132944), (void*)Redirected_Calculate_View);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 133424), 1, 235);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 133424), 1, 235);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2881566), 1, 246);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 2881566), 1, 246);
Redirection_Manager::Redirect_Function(Original_Draw_Effect_Caller, 0, (void*)((unsigned __int32)Client_Module + 1425888), 1, (void*)Redirected_Draw_Effect);
Original_Draw_Effect_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)Client_Module + 1425888), (void*)Redirected_Draw_Effect);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1868237), 1, 52);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 1868237), 1, 52);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2655546), 1, 216);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 2655546), 1, 216);
*(void**)((unsigned __int32)Client_Module + 8115120) = (void*)((unsigned __int32)Client_Module + 955708);
}
_putws(L"[ + ] Paint");
{
Redirection_Manager::Redirect_Function(Original_Write_Texture_Caller, 0, (void*)((unsigned __int32)GetModuleHandleW(L"vguimatsurface.dll") + 100592), 1, (void*)Redirected_Write_Texture);
Original_Write_Texture_Caller = Redirection_Manager::Redirect_Function(0, (void*)((unsigned __int32)GetModuleHandleW(L"vguimatsurface.dll") + 100592), (void*)Redirected_Write_Texture);
Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2913504), (void*)Redirected_Paint);
Redirection_Manager::Redirect_Function(Original_Get_Glow_Color_Caller, 1, (void*)((unsigned __int32)Client_Module + 2455600), 1, (void*)Redirected_Get_Glow_Color);
Original_Get_Glow_Color_Caller = Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2455600), (void*)Redirected_Get_Glow_Color);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 3244715), 1, 49);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 3244715), 1, 49);
Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2301184), (void*)Redirected_Draw_Crosshair);
Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2930985), 1, 235);
Byte_Manager::Set_Bytes(0, (void*)((unsigned __int32)Client_Module + 2930985), 1, 235);
Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 3118720), (void*)Redirected_Draw_Crosshair);
}

View File

@ -37,11 +37,11 @@ Interface_Structure Interface_Storm_Speed;
void Implement_Extended_Interface()
{
auto Create_Console_Interface = [](Interface_Structure* Interface, char* Name, char* Value, void* Handler)
auto Create_Interface = [](Interface_Structure* Interface, char* Name, char* Value, void* Handler)
{
using Create_Console_Variable_Type = void(__thiscall*)(Interface_Structure* Interface, char* Name, char* Value, void* Unknown_Parameter_1, void* Unknown_Parameter_2, void* Handler);
using Create_Variable_Type = void(__thiscall*)(Interface_Structure* Interface, char* Name, char* Value, void* Unknown_Parameter_1, void* Unknown_Parameter_2, void* Handler);
Create_Console_Variable_Type((unsigned __int32)Engine_Module + 2636368)(Interface, Name, Value, nullptr, nullptr, Handler);
Create_Variable_Type((unsigned __int32)Engine_Module + 2636368)(Interface, Name, Value, nullptr, nullptr, Handler);
*(__int32*)((unsigned __int32)Interface + 20) &= ~10;
@ -50,29 +50,29 @@ void Implement_Extended_Interface()
#define Pointer_Name(Interface) &Interface, (char*)#Interface + 10
Create_Console_Interface(Pointer_Name(Interface_Extra_Commands), (char*)"4", nullptr);
Create_Interface(Pointer_Name(Interface_Extra_Commands), (char*)"4", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Interpolate_Extra_Commands), (char*)"1", nullptr);
Create_Interface(Pointer_Name(Interface_Interpolate_Extra_Commands), (char*)"1", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Target_On_Simulation), (char*)"0", nullptr);
Create_Interface(Pointer_Name(Interface_Target_On_Simulation), (char*)"0", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Riot_Deprioritize), (char*)"0", nullptr);
Create_Interface(Pointer_Name(Interface_Riot_Deprioritize), (char*)"0", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Penetrate_Teammates), (char*)"0", nullptr);
Create_Interface(Pointer_Name(Interface_Penetrate_Teammates), (char*)"0", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Aim_Intersection), (char*)"1", nullptr);
Create_Interface(Pointer_Name(Interface_Aim_Intersection), (char*)"1", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Penetration_Damage), (char*)"12", nullptr);
Create_Interface(Pointer_Name(Interface_Penetration_Damage), (char*)"12", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Equipment_Distance), (char*)"2048", nullptr);
Create_Interface(Pointer_Name(Interface_Equipment_Distance), (char*)"2048", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Storm_Rotation_Radius), (char*)"24", nullptr);
Create_Interface(Pointer_Name(Interface_Storm_Rotation_Radius), (char*)"24", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Storm_Radius), (char*)"8", nullptr);
Create_Interface(Pointer_Name(Interface_Storm_Radius), (char*)"8", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Storm_Segments), (char*)"12", nullptr);
Create_Interface(Pointer_Name(Interface_Storm_Segments), (char*)"12", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Storm_Iterations), (char*)"16", nullptr);
Create_Interface(Pointer_Name(Interface_Storm_Iterations), (char*)"16", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Storm_Speed), (char*)"512", nullptr);
Create_Interface(Pointer_Name(Interface_Storm_Speed), (char*)"512", nullptr);
}

View File

@ -24,7 +24,7 @@ void __thiscall Redirected_Paint(void* Panel)
{
using Get_Origin_Type = float*(__thiscall*)(void* Entity);
float* Local_Player_Origin = Get_Origin_Type((unsigned __int32)Client_Module + 297584)(Local_Player);
float* Local_Origin = Get_Origin_Type((unsigned __int32)Client_Module + 297584)(Local_Player);
float* Entity_Origin = Get_Origin_Type((unsigned __int32)Client_Module + 297584)(Entity);
@ -36,7 +36,7 @@ void __thiscall Redirected_Paint(void* Panel)
0,
__builtin_powf(Local_Player_Origin[0] - Entity_Origin[0], 2.f) + __builtin_powf(Local_Player_Origin[1] - Entity_Origin[1], 2.f) + __builtin_powf(Local_Player_Origin[2] - Entity_Origin[2], 2.f)
__builtin_powf(Local_Origin[0] - Entity_Origin[0], 2.f) + __builtin_powf(Local_Origin[1] - Entity_Origin[1], 2.f) + __builtin_powf(Local_Origin[2] - Entity_Origin[2], 2.f)
};
if (Identifier >= 0)

View File

@ -56,7 +56,7 @@ void Predicton_Copy_Compare(void* Unknown_Parameter_1, void* Unknown_Parameter_2
{
Copy_Label:
{
Byte_Manager::Copy_Bytes(0, (void*)((unsigned __int32)Predicton_Copy.Destination + Field->Flat_Offset[0]), Field->Bytes, (void*)((unsigned __int32)Predicton_Copy.Source + Field->Flat_Offset[1]));
Byte_Manager::Copy_Bytes(1, (void*)((unsigned __int32)Predicton_Copy.Destination + Field->Flat_Offset[0]), Field->Bytes, (void*)((unsigned __int32)Predicton_Copy.Source + Field->Flat_Offset[1]));
}
}
}
@ -82,7 +82,7 @@ void __thiscall Redirected_Post_Network_Data_Received(void* Unknown_Parameter, _
void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712);
void* Prediction_Frame = *(void**)((unsigned __int32)Local_Player + 900 + (150 - ((Commands_Acknowledged - 1) % 150 + 1) * 150 % -~150) * 4);
if (Prediction_Frame != nullptr)
{
Predicton_Copy.Construct(Local_Player, Prediction_Frame, (void*)Predicton_Copy_Compare);

View File

@ -1,6 +1,30 @@
#pragma once
namespace Redirection_Manager
{
#include "Redirection_Manager_Functions.hpp"
void Redirect_Function(void* Original_Function, void* Redirected_Function)
{
DWORD Previous_Access_Rights;
VirtualProtect(Original_Function, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
*(__int8*)Original_Function = 104;
*(void**)((unsigned __int32)Original_Function + 1) = Redirected_Function;
*(unsigned __int8*)((unsigned __int32)Original_Function + 5) = 195;
VirtualProtect(Original_Function, 6, Previous_Access_Rights, &Previous_Access_Rights);
}
void* Redirect_Function(unsigned __int32 Offset, void* Original_Function, void* Redirected_Function)
{
void* Original_Function_Caller = VirtualAlloc(nullptr, 12 + Offset, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
__builtin_memcpy(Original_Function_Caller, Original_Function, 6 + Offset);
Redirect_Function((void*)((unsigned __int32)Original_Function_Caller + 6 + Offset), (void*)((unsigned __int32)Original_Function + 6 + Offset));
Redirect_Function(Original_Function, Redirected_Function);
return Original_Function_Caller;
}
};

View File

@ -1,30 +0,0 @@
#pragma once
void* Copy_Table(void* Table_Location)
{
#ifdef Bits_32
unsigned __int32 Functions_Count = 0;
#else
unsigned __int64 Functions_Count = 0;
#endif
Take_Function_Into_Account_Label:
{
#ifdef Bits_32
if (*(void**)((unsigned __int32)Table_Location + Functions_Count) != nullptr)
#else
if (*(void**)((unsigned __int64)Table_Location + Functions_Count) != nullptr)
#endif
{
Functions_Count += sizeof(void*);
goto Take_Function_Into_Account_Label;
}
}
void* Copied_Table_Location = malloc(Functions_Count);
__builtin_memcpy(Copied_Table_Location, Table_Location, Functions_Count);
return Copied_Table_Location;
}

View File

@ -1,15 +0,0 @@
#pragma once
#include "Redirection_Manager_Redirect_Function.hpp"
#include "Redirection_Manager_Restore_Function.hpp"
#include "Redirection_Manager_Restore_Redirection.hpp"
#include "Redirection_Manager_Copy_Table.hpp"
#include "Redirection_Manager_Redirect_Function_In_Table.hpp"
#include "Redirection_Manager_Redirect_Table.hpp"
#include "Redirection_Manager_Restore_Table.hpp"

View File

@ -1,125 +0,0 @@
#pragma once
void Redirect_Function(__int8 Modify_Access_Rights, void* Original_Function_Location, void* Redirected_Function_Location)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(__int8*)Original_Function_Location = 104;
*(void**)((unsigned __int32)Original_Function_Location + 1) = Redirected_Function_Location;
*(unsigned __int8*)((unsigned __int32)Original_Function_Location + 5) = 195;
#else
*(__int8*)Original_Function_Location = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Location + 1) = 47176;
*(void**)((unsigned __int64)Original_Function_Location + 3) = Redirected_Function_Location;
*(__int32*)((unsigned __int64)Original_Function_Location + 11) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Location + 15) = 195;
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
}
#ifdef Bits_32
void Redirect_Function(void*& Original_Function_Caller_Location, unsigned __int32 Original_Function_Caller_Offset, void* Original_Function_Location, __int8 Modify_Access_Rights, void* Redirected_Function_Location)
#else
void Redirect_Function(void*& Original_Function_Caller_Location, unsigned __int64 Original_Function_Caller_Offset, void* Original_Function_Location, __int8 Modify_Access_Rights, void* Redirected_Function_Location)
#endif
{
unsigned long __int32 Previous_Access_Rights;
#ifdef Bits_32
Original_Function_Caller_Location = malloc(12 + Original_Function_Caller_Offset);
*(void**)Original_Function_Caller_Location = *(void**)Original_Function_Location;
*(unsigned __int16*)((unsigned __int32)Original_Function_Caller_Location + 4) = *(unsigned __int16*)((unsigned __int32)Original_Function_Location + 4);
__builtin_memcpy((void*)((unsigned __int32)Original_Function_Caller_Location + 6), (void*)((unsigned __int32)Original_Function_Location + 6), Original_Function_Caller_Offset);
*(__int8*)((unsigned __int32)Original_Function_Caller_Location + 6 + Original_Function_Caller_Offset) = 104;
*(void**)((unsigned __int32)Original_Function_Caller_Location + 7 + Original_Function_Caller_Offset) = (void*)((unsigned __int32)Original_Function_Location + 6 + Original_Function_Caller_Offset);
*(unsigned __int8*)((unsigned __int32)Original_Function_Caller_Location + 11 + Original_Function_Caller_Offset) = 195;
VirtualProtect(Original_Function_Caller_Location, 12 + Original_Function_Caller_Offset, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
Original_Function_Caller_Location = malloc(32 + Original_Function_Caller_Offset);
*(void**)Original_Function_Caller_Location = *(void**)Original_Function_Location;
*(void**)((unsigned __int64)Original_Function_Caller_Location + 8) = *(void**)((unsigned __int64)Original_Function_Location + 8);
__builtin_memcpy((void*)((unsigned __int64)Original_Function_Caller_Location + 16), (void*)((unsigned __int64)Original_Function_Location + 16), Original_Function_Caller_Offset);
*(__int8*)((unsigned __int64)Original_Function_Caller_Location + 16 + Original_Function_Caller_Offset) = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Caller_Location + 17 + Original_Function_Caller_Offset) = 47176;
*(void**)((unsigned __int64)Original_Function_Caller_Location + 19 + Original_Function_Caller_Offset) = (void*)((unsigned __int64)Original_Function_Location + 16 + Original_Function_Caller_Offset);
*(__int32*)((unsigned __int64)Original_Function_Caller_Location + 27 + Original_Function_Caller_Offset) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Caller_Location + 31 + Original_Function_Caller_Offset) = 195;
VirtualProtect(Original_Function_Caller_Location, 32 + Original_Function_Caller_Offset, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(__int8*)Original_Function_Location = 104;
*(void**)((unsigned __int32)Original_Function_Location + 1) = Redirected_Function_Location;
*(unsigned __int8*)((unsigned __int32)Original_Function_Location + 5) = 195;
#else
*(__int8*)Original_Function_Location = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Location + 1) = 47176;
*(void**)((unsigned __int64)Original_Function_Location + 3) = Redirected_Function_Location;
*(__int32*)((unsigned __int64)Original_Function_Location + 11) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Location + 15) = 195;
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
}

View File

@ -1,18 +0,0 @@
#pragma once
void Redirect_Function_In_Table(__int8 Modify_Access_Rights, void* Original_Function_In_Table_Location, void* Redirected_Function_Location)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Original_Function_In_Table_Location, sizeof(void*), PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
}
*(void**)Original_Function_In_Table_Location = Redirected_Function_Location;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Original_Function_In_Table_Location, sizeof(void*), Previous_Access_Rights, &Previous_Access_Rights);
}
}

View File

@ -1,6 +0,0 @@
#pragma once
void Redirect_Table(void* Original_Table_Container_Location, void* Redirected_Table_Location)
{
*(void**)Original_Table_Container_Location = Redirected_Table_Location;
}

View File

@ -1,39 +0,0 @@
#pragma once
void Restore_Function(__int8 Modify_Access_Rights, void* Original_Function_Location, void* Original_Function_Caller_Location, __int8 Delete_Original_Function_Caller)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(void**)Original_Function_Location = *(void**)Original_Function_Caller_Location;
*(unsigned __int16*)((unsigned __int32)Original_Function_Location + 4) = *(unsigned __int16*)((unsigned __int32)Original_Function_Caller_Location + 4);
#else
*(void**)Original_Function_Location = *(void**)Original_Function_Caller_Location;
*(void**)((unsigned __int64)Original_Function_Location + 8) = *(void**)((unsigned __int64)Original_Function_Caller_Location + 8);
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
if (Delete_Original_Function_Caller == 1)
{
free(Original_Function_Caller_Location);
}
}

View File

@ -1,42 +0,0 @@
#pragma once
void Restore_Redirection(__int8 Modify_Access_Rights, void* Original_Function_Location, void* Redirected_Function_Location)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(__int8*)Original_Function_Location = 104;
*(void**)((unsigned __int32)Original_Function_Location + 1) = Redirected_Function_Location;
*(unsigned __int8*)((unsigned __int32)Original_Function_Location + 5) = 195;
#else
*(__int8*)Original_Function_Location = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Location + 1) = 47176;
*(void**)((unsigned __int64)Original_Function_Location + 3) = Redirected_Function_Location;
*(__int32*)((unsigned __int64)Original_Function_Location + 11) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Location + 15) = 195;
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
}

View File

@ -1,11 +0,0 @@
#pragma once
void Restore_Table(void* Original_Table_Container_Location, void* Original_Table_Location, __int8 Delete_Redirected_Table, void* Redirected_Table_Location)
{
*(void**)Original_Table_Container_Location = Original_Table_Location;
if (Delete_Redirected_Table == 1)
{
free(Redirected_Table_Location);
}
}

View File

@ -6,7 +6,7 @@ void Redirected_Send_Move()
void Construct(__int8* Data, unsigned __int32 Size)
{
Byte_Manager::Set_Bytes(0, Message, sizeof(Message), 0);
Byte_Manager::Set_Bytes(1, Message, sizeof(Message), 0);
*(void**)Message = (void*)((unsigned __int32)Engine_Module + 3501364);
@ -64,7 +64,7 @@ void Redirected_Send_Move()
*(__int32*)((unsigned __int32)Network_Channel + 28) -= Extra_Commands_Queue;
using Send_Network_Message_Type = void(__thiscall**)(void* Network_Channel, void* Message, void* Unknown_Parameter_1, void* Unknown_Parameter_2);
using Send_Message_Type = void(__thiscall**)(void* Network_Channel, void* Message, void* Unknown_Parameter_1, void* Unknown_Parameter_2);
(*Send_Network_Message_Type(*(unsigned __int32*)Network_Channel + 164))(Network_Channel, &Message, nullptr, nullptr);
(*Send_Message_Type(*(unsigned __int32*)Network_Channel + 164))(Network_Channel, &Message, nullptr, nullptr);
}