8 Commits

Author SHA1 Message Date
5420ace13d normalize action value for xor testing 2024-10-25 08:39:34 +03:00
08820dca32 game update, cwitch::getglowcolor 2024-10-25 08:12:24 +03:00
338a781f22 prediction redesignment (details in description)
my plan to use constant buffering to instantize actions (as healing, reviving) turned out ill-fated:
- many things are using server relative timing: rock stuns, lagcompensation and many of interactables (they're all getting delayed by 150*(1/30) seconds)
- there's always undefined behaviour no matter whether i'm constantly buffering or periodically
- implementing logic that prevents buffering on when you're about to get hit by rock or to use something would adjust weapon timings (they're all getting delayed by 150*(1/30) seconds)
thus i've removed some of things i've worked on (as exploits, viewmodel timing correction)

mostly same thing about extra commands up to 21 while exploiting (my old trick doesn't works anymore): it's either undefined behaviour or feature cuttage

but on good note:
- prediction got hardened against timing fluctations
- prediction now respects network timing updates
- speedhacking issued undefined behaviour is significantly mitigated (not completely but i'd prefer to not bloat my code over such rare cases)

i'll be working on features from now, here's potential list (anything that involves guessing is very low priority):
rock prediction (involves guessing, it's not lagcompensated)
tongue cutter (involves guessing)
tongue aimbot/triggerbot (i've actually forgot to adjust lagcompensation for it but i'm not playing versus anyway)
animation cycles prediction (involves guessing, u-rates are synced already so it's just about latency adjustments now)
minigun aimbot (i'd like to work on it but just one thing that it's angle is limited thus impossibility to compensate spread accurately ruins it for me)
visual improvements (such as visually removing m_duckUntilOnGround)
2024-10-24 12:39:44 +03:00
f26e099d55 some more progress on prediction redesignment
don't have much time today. postponing cl_sendmove for tomorrow
2024-10-22 07:00:10 +03:00
924e32b297 some progress on prediction redesignment 2024-10-21 06:13:28 +03:00
cd2b23d069 ensure CPredictionCopy contains correct value for given frame
water? maybe. +20 is to be removed anyway
2024-10-19 03:42:23 +03:00
83ad090b63 overlook (binaries are not affected) 2024-10-18 05:45:58 +03:00
d9bf5dea6d overlook (binaries not affected) 2024-10-18 04:07:32 +03:00
12 changed files with 549 additions and 535 deletions

File diff suppressed because it is too large Load Diff

View File

@ -210,19 +210,26 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
_putws(L"[ + ] Prediction");
{
static Prediction_Descriptor_Structure Original_Prediction_Descriptor;
auto Add_Prediction_Fields = [](Prediction_Descriptor_Structure* Descriptor, Prediction_Field_Structure* Fields, __int32 Size) -> void
{
Prediction_Descriptor_Structure* Original_Descriptor = (Prediction_Descriptor_Structure*)malloc(sizeof(Prediction_Descriptor_Structure));
Prediction_Descriptor_Structure* Prediction_Descriptor = (Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7290836);
Byte_Manager::Copy_Bytes(0, Original_Descriptor, sizeof(Prediction_Descriptor_Structure), Descriptor);
Byte_Manager::Copy_Bytes(0, &Original_Prediction_Descriptor, sizeof(Prediction_Descriptor_Structure), Prediction_Descriptor);
Descriptor->Fields = Fields;
static Prediction_Field_Structure Prediction_Fields = { 1, (char*)"m_fMaxSpread", 3340, 1, { }, sizeof(float) };
Descriptor->Size = Size;
Prediction_Descriptor->Fields = &Prediction_Fields;
Descriptor->Parent = Original_Descriptor;
};
Prediction_Descriptor->Size = sizeof(Prediction_Fields) / sizeof(Prediction_Field_Structure);
static Prediction_Field_Structure Player_Fields = { 5, (char*)(*(unsigned __int32*)((unsigned __int32)GetModuleHandleW(L"vphysics.dll") + 1701868) + 2226), 16, 1, { }, sizeof(__int32) };
Prediction_Descriptor->Parent = &Original_Prediction_Descriptor;
Add_Prediction_Fields((Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7236480), &Player_Fields, sizeof(Player_Fields) / sizeof(Prediction_Field_Structure));
static Prediction_Field_Structure Weapon_Fields = { 1, (char*)"m_fMaxSpread", 3340, 1, { }, sizeof(float) };
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);
@ -288,12 +295,14 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
_putws(L"[ + ] Paint");
{
Redirection_Manager::Redirect_Function(Original_Write_Texture_Caller, 0, (void*)((unsigned __int32)GetModuleHandleW(L"vguimatsurface.dll") + 100560), 1, (void*)Redirected_Write_Texture);
Redirection_Manager::Redirect_Function(Original_Write_Texture_Caller, 0, (void*)((unsigned __int32)GetModuleHandleW(L"vguimatsurface.dll") + 100592), 1, (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);
Byte_Manager::Set_Bytes(1, (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);

View File

@ -41,7 +41,7 @@ void Implement_Extended_Interface()
{
using Create_Console_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 + 2636656)(Interface, Name, Value, nullptr, nullptr, Handler);
Create_Console_Variable_Type((unsigned __int32)Engine_Module + 2636368)(Interface, Name, Value, nullptr, nullptr, Handler);
*(__int32*)((unsigned __int32)Interface + 20) &= ~10;
@ -62,7 +62,7 @@ void Implement_Extended_Interface()
Create_Console_Interface(Pointer_Name(Interface_Aim_Intersection), (char*)"1", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Penetration_Damage), (char*)"20", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Penetration_Damage), (char*)"12", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Equipment_Distance), (char*)"2048", nullptr);

View File

@ -2,7 +2,7 @@ void* Original_Item_Post_Frame_Caller;
void __thiscall Redirected_Item_Post_Frame(void* Player)
{
if (*(void**)((unsigned __int32)__builtin_frame_address(0) + 60) == (void*)((unsigned __int32)Client_Module + 423107))
if (*(void**)((unsigned __int32)__builtin_frame_address(0) + 88) == (void*)((unsigned __int32)Client_Module + 423107))
{
(decltype(&Redirected_Item_Post_Frame)(Original_Item_Post_Frame_Caller))(Player);
}

View File

@ -1,7 +1,7 @@
void* Original_Move_Caller;
__int32 Extra_Commands;
void* Original_Move_Caller;
void Redirected_Move(float Unknown_Parameter, __int8 Final)
{
using Run_Prediction_Type = void(__cdecl*)();

View File

@ -304,7 +304,7 @@ void __thiscall Redirected_Paint(void* Panel)
Write_Character = Text[0];
Draw_Text_Type((unsigned __int32)Engine_Module + 2219056)(Font, 0, 0, 0, 0, 0, 0, Text);
Draw_Text_Type((unsigned __int32)Engine_Module + 2218736)(Font, 0, 0, 0, 0, 0, 0, Text);
if (Character != L'~')
{
@ -362,11 +362,11 @@ void __thiscall Redirected_Paint(void* Panel)
if (Ghost == 0)
{
Draw_Text_Type((unsigned __int32)Engine_Module + 2219056)(Font, Bounds[1] + 7 + Offset_X - Character_Bounds[0], Bounds[2] + Offset_Y, Paint_Data->Color[0], Paint_Data->Color[1], Paint_Data->Color[2], 255, Text);
Draw_Text_Type((unsigned __int32)Engine_Module + 2218736)(Font, Bounds[1] + 7 + Offset_X - Character_Bounds[0], Bounds[2] + Offset_Y, Paint_Data->Color[0], Paint_Data->Color[1], Paint_Data->Color[2], 255, Text);
}
else
{
Draw_Text_Type((unsigned __int32)Engine_Module + 2219056)(Font, Bounds[1] + 7 + Offset_X - Character_Bounds[0], Bounds[2] + Offset_Y, 128, 128, 128, 255, Text);
Draw_Text_Type((unsigned __int32)Engine_Module + 2218736)(Font, Bounds[1] + 7 + Offset_X - Character_Bounds[0], Bounds[2] + Offset_Y, 128, 128, 128, 255, Text);
}
Write_Character = 0;

View File

@ -1,21 +1,28 @@
void* Perform_Trace_Target;
float* Get_Center(void* Entity)
{
using Get_Center_Type = float*(__thiscall*)(void* Entity);
return Get_Center_Type((unsigned __int32)Client_Module + 114400)(Entity);
}
float Perform_Trace_Damage;
float Vector_Normalize(float* Vector)
{
using Vector_Normalize_Type = float(__thiscall*)(float* Vector);
return Vector_Normalize_Type((unsigned __int32)Client_Module + 3536176)(Vector);
return Vector_Normalize_Type((unsigned __int32)Client_Module + 3536192)(Vector);
};
void Angle_Vectors(float* Angles, float* Forward, float* Right, float* Up)
{
using Angle_Vectors_Type = void(__cdecl*)(float* Angles, float* Forward, float* Right, float* Up);
Angle_Vectors_Type((unsigned __int32)Client_Module + 3539376)(Angles, Forward, Right, Up);
Angle_Vectors_Type((unsigned __int32)Client_Module + 3539392)(Angles, Forward, Right, Up);
};
float Perform_Trace_Damage;
void __thiscall Perform_Trace(void* Stack)
{
void* Entity = *(void**)((unsigned __int32)Stack + 312);
@ -119,13 +126,11 @@ void __thiscall Perform_Trace(void* Stack)
{
using Get_Bounds_Type = void(__thiscall*)(void* Collision, float* Start, float* Bounds);
using Get_Center_Type = float* (__thiscall*)(void* Entity);
void* Local_Player = *(void**)Trace_Information;
float Bounds[3];
Get_Bounds_Type((unsigned __int32)Client_Module + 878528)((void*)((unsigned __int32)Entity + 540), Get_Center_Type((unsigned __int32)Client_Module + 114400)(Local_Player), Bounds);
Get_Bounds_Type((unsigned __int32)Client_Module + 878528)((void*)((unsigned __int32)Entity + 540), Get_Center(Local_Player), Bounds);
using Calculate_Distance_Type = float(__thiscall*)(void* Collision, float* Bounds);
@ -284,9 +289,7 @@ void __thiscall Perform_Trace(void* Stack)
{
float Inflictor_Direction[3];
using Get_Center_Type = float*(__thiscall*)(void* Entity);
float* Start = Get_Center_Type((unsigned __int32)Client_Module + 114400)(*(void**)Trace_Information);
float* Start = Get_Center(*(void**)Trace_Information);
Inflictor_Direction[0] = End[0] - Start[0];

View File

@ -15,6 +15,8 @@ struct Prediction_Field_Structure
__int8 Additionals_Bytes_2[12];
__int32 Flat_Offset[2];
__int8 Additionals_Bytes_3[2];
};
struct Prediction_Copy_Structure
@ -39,24 +41,13 @@ Prediction_Copy_Structure Predicton_Copy;
void Predicton_Copy_Compare(void* Unknown_Parameter_1, void* Unknown_Parameter_2, void* Unknown_Parameter_3, void* Unknown_Parameter_4, void* Unknown_Parameter_5, void* Unknown_Parameter_6, __int8 Within_Tolerance, void* Unknown_Parameter_7)
{
Prediction_Field_Structure* Field = *(Prediction_Field_Structure**)((unsigned __int32)__builtin_frame_address(0) + 60);
if (Field->Flat_Offset[0] == 5324)
{
if (*(__int32*)((unsigned __int32)Predicton_Copy.Destination + 20) != 0)
{
goto Copy_Label;
}
}
if (Within_Tolerance == 1)
{
Prediction_Field_Structure* Field = *(Prediction_Field_Structure**)((unsigned __int32)__builtin_frame_address(0) + 60);
if ((256 - Field->Flat_Offset[0] ^ Field->Flat_Offset[0] - 244) != 12)
{
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(0, (void*)((unsigned __int32)Predicton_Copy.Destination + Field->Flat_Offset[0]), Field->Bytes, (void*)((unsigned __int32)Predicton_Copy.Source + Field->Flat_Offset[1]));
}
}
}
@ -71,7 +62,7 @@ struct Prediction_Descriptor_Structure
Prediction_Descriptor_Structure* Parent;
__int8 Additional_Bytes_2[6];
__int8 Additional_Bytes_2[8];
};
void* Original_Post_Network_Data_Received_Caller;
@ -80,15 +71,17 @@ void __thiscall Redirected_Post_Network_Data_Received(void* Unknown_Parameter, _
{
void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712);
void* Result = *(void**)((unsigned __int32)Local_Player + 900 + (150 - ((Commands_Acknowledged - 1) % 150 + 1) * 150 % -~150) * 4);
void* Prediction_Frame = *(void**)((unsigned __int32)Local_Player + 900 + (150 - ((Commands_Acknowledged - 1) % 150 + 1) * 150 % -~150) * 4);
if (Result != nullptr)
if (Prediction_Frame != nullptr)
{
Predicton_Copy.Construct(Local_Player, Result, (void*)Predicton_Copy_Compare);
Predicton_Copy.Construct(Local_Player, Prediction_Frame, (void*)Predicton_Copy_Compare);
using Transfer_Data_Type = __int32(__thiscall*)(Prediction_Copy_Structure* Prediction_Copy, void* Unknown_Parameter, __int32 Entity_Number, Prediction_Descriptor_Structure* Descriptor);
Transfer_Data_Type((unsigned __int32)Client_Module + 1573744)(&Predicton_Copy, nullptr, -1, (Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7236480));
*(__int32*)((unsigned __int32)Local_Player + 5324) += Commands_Acknowledged - Commands_Acknowledged % 150;
}
(decltype(&Redirected_Post_Network_Data_Received)(Original_Post_Network_Data_Received_Caller))(Unknown_Parameter, Commands_Acknowledged);

View File

@ -2,31 +2,14 @@ void* Original_Process_Movement_Caller;
void __thiscall Redirected_Process_Movement(void* Unknown_Parameter, void* Player, void* Move_Data)
{
__int32 Stunned = *(__int32*)((unsigned __int32)Player + 20);
if (Stunned == 2)
if (*(__int32*)((unsigned __int32)Player + 5324) < 0)
{
Global_Variables_Structure* Global_Variables = *(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744);
Global_Variables->Current_Time *= -1;
*(__int32*)((unsigned __int32)Move_Data + 36) &= ~1564;
if (*(__int8*)((unsigned __int32)Player + 4636) == 1)
{
*(__int32*)((unsigned __int32)Move_Data + 36) |= 4;
}
*(__int32*)((unsigned __int32)Move_Data + 36) |= 4 * *(__int8*)((unsigned __int32)Player + 4636);
*(float*)((unsigned __int32)Move_Data + 44) = 0;
*(float*)((unsigned __int32)Move_Data + 48) = 0;
(decltype(&Redirected_Process_Movement)(Original_Process_Movement_Caller))(Unknown_Parameter, Player, Move_Data);
Global_Variables->Current_Time *= -1;
}
else
{
(decltype(&Redirected_Process_Movement)(Original_Process_Movement_Caller))(Unknown_Parameter, Player, Move_Data);
*(double*)((unsigned __int32)Move_Data + 44) = 0;
}
(decltype(&Redirected_Process_Movement)(Original_Process_Movement_Caller))(Unknown_Parameter, Player, Move_Data);
}

View File

@ -9,5 +9,5 @@ void Redirected_Read_Packets(__int8 Final)
(decltype(&Redirected_Read_Packets)(Original_Read_Packets_Caller))(Final);
}
Parsed_Packets = __builtin_return_address(0) != (void*)((unsigned __int32)Engine_Module + 1631551);
Parsed_Packets = __builtin_return_address(0) != (void*)((unsigned __int32)Engine_Module + 1631183);
}

View File

@ -8,9 +8,7 @@ struct Command_Structure
float Angles[3];
float Move[2];
__int32 Frame_Number;
float Move[3];
__int32 Buttons;
@ -22,17 +20,28 @@ struct Command_Structure
struct Extended_Command_Structure
{
__int32 Extra_Commands;
__int32 Sequence_Shift;
};
Extended_Command_Structure Extended_Commands[150];
void* Original_Run_Command_Caller;
void __thiscall Redirected_Run_Command(void* Prediction, void* Player, Command_Structure* Command, void* Unknown_Parameter)
void __thiscall Redirected_Run_Command(void* Prediction, void* Player, Command_Structure* Command, void* Move_Helper)
{
Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Frame_Number];
Extended_Command_Structure* Extended_Command = &Extended_Commands[*(__int32*)((unsigned __int32)Player + 5620) % 150];
*(__int32*)((unsigned __int32)Player + 5324) -= Extended_Command->Extra_Commands;
*(__int32*)((unsigned __int32)Player + 5324) -= Extended_Command->Extra_Commands + Extended_Command->Sequence_Shift;
(decltype(&Redirected_Run_Command)(Original_Run_Command_Caller))(Prediction, Player, Command, Unknown_Parameter);
(decltype(&Redirected_Run_Command)(Original_Run_Command_Caller))(Prediction, Player, Command, Move_Helper);
if (__builtin_return_address(0) == (void*)((unsigned __int32)Client_Module + 423107))
{
*(__int32*)((unsigned __int32)Player + 5324) += Extended_Command->Sequence_Shift;
Global_Variables_Structure* Global_Variables = *(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744);
Global_Variables->Current_Time = (*(__int32*)((unsigned __int32)Player + 5324) - 1) * Global_Variables->Interval_Per_Tick;
}
}

View File

@ -8,7 +8,7 @@ void Redirected_Send_Move()
{
Byte_Manager::Set_Bytes(0, Message, sizeof(Message), 0);
*(void**)Message = (void*)((unsigned __int32)Engine_Module + 3501348);
*(void**)Message = (void*)((unsigned __int32)Engine_Module + 3501364);
*(void**)((unsigned __int32)Message + 132) = Data;