prevent buffer underrun on ack build-up

This commit is contained in:
explorer 2024-10-26 16:13:36 +03:00
parent 5420ace13d
commit 5a7e62dd6f
2 changed files with 13 additions and 10 deletions

View File

@ -376,7 +376,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
__int8 Is_Melee = *(__int32*)((unsigned __int32)Weapon_Data + 352) * (*(__int32*)((unsigned __int32)Weapon_Data + 348) ^ 1) <= 1;
__int32 Action = *(__int32*)((unsigned __int32)Local_Player + 7080) != 0;
__int8 Action = *(__int32*)((unsigned __int32)Local_Player + 7080) != 0;
__int8 Reviving = *(void**)((unsigned __int32)Local_Player + 8076) != INVALID_HANDLE_VALUE;

View File

@ -68,6 +68,8 @@ struct Prediction_Descriptor_Structure
void* Original_Post_Network_Data_Received_Caller;
void __thiscall Redirected_Post_Network_Data_Received(void* Unknown_Parameter, __int32 Commands_Acknowledged)
{
if (Commands_Acknowledged >= 0)
{
void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712);
@ -83,6 +85,7 @@ void __thiscall Redirected_Post_Network_Data_Received(void* Unknown_Parameter, _
*(__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);
}