diff --git a/Calculate_View.hpp b/Calculate_View.hpp index c8b2e5f..3a90a22 100755 --- a/Calculate_View.hpp +++ b/Calculate_View.hpp @@ -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 + 2236960)(Player)); + Byte_Manager::Copy_Bytes(0, Angles, sizeof(float[3]), Get_Eye_Angles_Type((unsigned __int32)Client_Module + 2237296)(Player)); } \ No newline at end of file diff --git a/Copy_Command.hpp b/Copy_Command.hpp new file mode 100644 index 0000000..ba183a3 --- /dev/null +++ b/Copy_Command.hpp @@ -0,0 +1,701 @@ +struct Target_Structure +{ + __int32 Identifier; + + void* Self; + + __int8 Priority; + + float Distance; + + __int32 Tick_Number; +}; + +std::vector Sorted_Target_List; + +void* Get_Hitbox_Set(Target_Structure* Target, float(*Bones)[3][4], float Time) +{ + using Setup_Bones_Type = __int8(__thiscall*)(void* Entity, void* Bones, __int32 Maximum_Bones, __int32 Mask, float Current_Time); + + if (Setup_Bones_Type((unsigned __int32)Client_Module + 246656)((void*)((unsigned __int32)Target->Self + 4), Bones, 128, 524032, Time) == 1) + { + using Get_Studio_Header_Type = void*(__thiscall*)(void* Entity); + + void* Studio_Header = *(void**)Get_Studio_Header_Type((unsigned __int32)Client_Module + 8512)(Target->Self); + + return (void*)((unsigned __int32)Studio_Header + *(__int32*)((unsigned __int32)Studio_Header + 176)); + } + + return nullptr; +} + +void* Original_Copy_Command_Caller; + +void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structure* Command) +{ + Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Command_Number % 150]; + + Extended_Command->Extra_Commands = 0; + + Global_Variables_Structure* Global_Variables = *(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744); + + void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712); + + if (Extra_Commands == -1) + { + if ((Command->Buttons & 524288) == 524288) + { + Extended_Command->Extra_Commands = max(0, Extra_Commands = std::clamp(Interface_Extra_Commands.Integer, (__int32)(0.06f / Global_Variables->Interval_Per_Tick + 0.5f), 21)); + + *(__int32*)((unsigned __int32)Local_Player + 16) = min(*(__int32*)((unsigned __int32)Local_Player + 16) + 1, Extended_Command->Extra_Commands * Interface_Interpolate_Extra_Commands.Integer); + } + else + { + *(__int32*)((unsigned __int32)Local_Player + 16) = max(0, *(__int32*)((unsigned __int32)Local_Player + 16) - 1); + } + } + + *(__int32*)((unsigned __int32)Local_Player + 20) = 0; + + if (*(__int8*)((unsigned __int32)Local_Player + 327) == 0) + { + using Run_Prediction_Type = void(__cdecl*)(); + + Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)(); + + float Move_Angles[3] = + { + Command->Angles[0], + + Command->Angles[1], + + 0 + }; + + static float Previous_Move_Angle_Y; + + if ((Command->Buttons & 2) == 2) + { + Command->Move[0] = 0; + + if (*(__int32*)((unsigned __int32)Local_Player + 316) == -1) + { + Command->Buttons &= ~(*(__int8*)((unsigned __int32)Local_Player + 324) & 2); + } + else + { + Command->Buttons &= ~(*(__int32*)((unsigned __int32)Local_Player + 5028) & 2); + } + + float Difference = __builtin_remainderf(Move_Angles[1] - Previous_Move_Angle_Y, 360); + + Previous_Move_Angle_Y = Move_Angles[1]; + + float* Velocity = (float*)((unsigned __int32)Local_Player + 256); + + if (__builtin_fabsf(Difference) < __builtin_atan2f(30, __builtin_hypotf(Velocity[0], Velocity[1])) * 180 / 3.1415927f) + { + float Strafe_Angle = __builtin_remainderf(Move_Angles[1] - __builtin_atan2f(Velocity[1], Velocity[0]) * 180 / 3.1415927f, 360); + + if (__builtin_signbitf(Strafe_Angle) == 0) + { + Command->Move[1] = -400; + } + else + { + Command->Move[1] = 400; + } + + Move_Angles[1] -= Strafe_Angle; + } + else + { + if (__builtin_signbitf(Difference) == 0) + { + Command->Move[1] = -400; + } + else + { + Command->Move[1] = 400; + } + } + } + else + { + Previous_Move_Angle_Y = Move_Angles[1]; + } + + float Previous_Move[2]; + + Byte_Manager::Copy_Bytes(0, Previous_Move, sizeof(Previous_Move), Command->Move); + + float Desired_Move_Forward[3]; + + float Desired_Move_Right[3]; + + Angle_Vectors(Move_Angles, Desired_Move_Forward, Desired_Move_Right, nullptr); + + Desired_Move_Forward[2] = 0; + + Vector_Normalize(Desired_Move_Forward); + + Desired_Move_Right[2] = 0; + + Vector_Normalize(Desired_Move_Right); + + float Desired_Move[2] = + { + Desired_Move_Forward[0] * Command->Move[0] + Desired_Move_Right[0] * Command->Move[1], + + Desired_Move_Forward[1] * Command->Move[0] + Desired_Move_Right[1] * Command->Move[1] + }; + + auto Correct_Movement = [&]() -> void + { + float Move_Forward[3]; + + float Move_Right[3]; + + Angle_Vectors(Command->Angles, Move_Forward, Move_Right, nullptr); + + Move_Forward[2] = 0; + + Vector_Normalize(Move_Forward); + + Move_Right[2] = 0; + + Vector_Normalize(Move_Right); + + float Divider = Move_Forward[0] * Move_Right[1] - Move_Right[0] * Move_Forward[1]; + + Command->Move[0] = (Desired_Move[0] * Move_Right[1] - Move_Right[0] * Desired_Move[1]) / Divider; + + Command->Move[1] = (Move_Forward[0] * Desired_Move[1] - Desired_Move[0] * Move_Forward[1]) / Divider; + }; + + Correct_Movement(); + + void* Network_Channel = *(void**)(*(unsigned __int32*)((unsigned __int32)Engine_Module + 4352236) + 24); + + auto Sequence_Shift = [&](__int32 Reserve) + { + if (Extra_Commands < 1) + { + *(__int32*)((unsigned __int32)Network_Channel + 8) += (Command->Tick_Number + ~-150) / 150 * 150 + (Reserve * 150); + } + + *(__int32*)((unsigned __int32)Local_Player + 20) = 1 + (Reserve > 0); + }; + + if (*(__int32*)((unsigned __int32)Local_Player + 228) == 3) + { + if (*(__int8*)((unsigned __int32)Local_Player + 7322) == 1) + { + if (*(__int32*)((unsigned __int32)Local_Player + 7324) == 0) + { + Sequence_Shift(-2); + } + } + } + else + { + if ((*(float*)((unsigned __int32)Local_Player + 4604) + 800 * Global_Variables->Interval_Per_Tick >= 560) + (*(__int8*)((unsigned __int32)Local_Player + 8068) + *(__int8*)((unsigned __int32)Local_Player + 9708)) != 0) + { + Sequence_Shift(2); + + Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)(); + } + else + { + void* Prediction = (void*)((unsigned __int32)Client_Module + 8072728); + + *(__int8*)((unsigned __int32)Prediction + 8) = 1; + + *(__int8*)((unsigned __int32)Prediction + 24) = 0; + + using Set_Host_Type = void(__thiscall*)(void* Move_Helper, void* Player); + + Set_Host_Type((unsigned __int32)Client_Module + 1331184)((void*)((unsigned __int32)Client_Module + 7174888), Local_Player); + + Redirected_Run_Command(Prediction, Local_Player, Command, (void*)((unsigned __int32)Client_Module + 7174888)); + + Set_Host_Type((unsigned __int32)Client_Module + 1331184)((void*)((unsigned __int32)Client_Module + 7174888), nullptr); + + *(__int8*)((unsigned __int32)Prediction + 8) = 0; + + __int32 Block_Buttons = 2049; + + if ((*(__int32*)((unsigned __int32)Local_Player + 324) & 9) == 0) + { + if ((*(__int32*)((unsigned __int32)Local_Player + 5020) & 32) == 0) + { + using Can_Attack_Type = __int8(__thiscall*)(void* Player); + + if (Can_Attack_Type((unsigned __int32)Client_Module + 2541696)(Local_Player) == 1) + { + void* Weapon = *(__int16*)((unsigned __int32)Local_Player + 7866) == 0 ? *(void**)((unsigned __int32)Client_Module + 7644532 + (((*(unsigned __int32*)((unsigned __int32)Local_Player + 4228) & 4095) - 4097) << 4)) : nullptr; + + if (Weapon == nullptr) + { + Block_Buttons = 0; + } + else + { + __int32 Entity_Number = 1; + + using Get_Interpolation_Time_Type = float(__cdecl*)(); + + float Interpolation_Time = Get_Interpolation_Time_Type((unsigned __int32)Engine_Module + 594000)(); + + Sorted_Target_List.clear(); + + auto Get_Target_Time = [&](Target_Structure* Target) -> float + { + if (Interface_Target_On_Simulation.Integer == 0) + { + return *(float*)((unsigned __int32)Local_Player + 336); + } + + return *(float*)((unsigned __int32)Target->Self + 336); + }; + + Traverse_Entity_List_Label: + { + void* Entity = *(void**)((unsigned __int32)Client_Module + 7644532 + ((Entity_Number - 4097) << 4)); + + if (Entity != nullptr) + { + if (Entity != Local_Player) + { + __int32 Identifier = Get_Identifier(Entity, 0, 0); + + if (Identifier != -1) + { + 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* Entity_Origin = (float*)((unsigned __int32)Entity + 292); + + float Time = *(float*)((unsigned __int32)Entity + 336) + Interpolation_Time; + + Target_Structure Target = + { + Identifier, + + Entity, + + (__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) + __builtin_powf(Local_Player_Origin[1] - Entity_Origin[1], 2) + __builtin_powf(Local_Player_Origin[2] - Entity_Origin[2], 2), + + (__int32)(Time / Global_Variables->Interval_Per_Tick + 0.5f) + }; + + if (*(float*)((unsigned __int32)Entity + 16) != Get_Target_Time(&Target)) + { + if (Identifier == 277) + { + if (*(float*)((unsigned __int32)Entity + 4844) == 1) + { + Sorted_Target_List.push_back(Target); + } + } + else + { + Sorted_Target_List.push_back(Target); + } + } + } + } + } + } + + if (Entity_Number != *(__int32*)((unsigned __int32)Client_Module + 7644568)) + { + Entity_Number += 1; + + goto Traverse_Entity_List_Label; + } + } + + auto Target_List_Sort_Prepare = [](Target_Structure& X, Target_Structure& Y) -> __int8 + { + return X.Priority < Y.Priority; + }; + + std::sort(Sorted_Target_List.begin(), Sorted_Target_List.end(), Target_List_Sort_Prepare); + + auto Target_List_Sort_Finish = [](Target_Structure& X, Target_Structure& Y) -> __int8 + { + if (X.Priority > Y.Priority) + { + return 1; + } + + return X.Distance < Y.Distance; + }; + + std::sort(Sorted_Target_List.begin(), Sorted_Target_List.end(), Target_List_Sort_Finish); + + size_t Target_Number = 0; + + using Get_Weapon_Data_Type = void*(__thiscall*)(void* Weapon); + + void* Weapon_Data = Get_Weapon_Data_Type((unsigned __int32)Client_Module + 86432)(Weapon); + + __int8 Is_Melee = *(__int32*)((unsigned __int32)Weapon_Data + 352) * (*(__int32*)((unsigned __int32)Weapon_Data + 348) ^ 1) <= 1; + + __int8 Healing = *(void**)((unsigned __int32)Local_Player + 8076) != INVALID_HANDLE_VALUE; + + __int32 Weapon_Identifier = Get_Identifier(Weapon, 1, 0); + + __int8 Is_Cold_Melee = Weapon_Identifier == 231; + + using Get_Eye_Position_Type = void(__thiscall*)(void* Entity, float* Eye_Position); + + float Eye_Position[3]; + + Get_Eye_Position_Type((unsigned __int32)Client_Module + 108512)(Local_Player, Eye_Position); + + __int8 Cancelable_Shove = 1 + (*(float*)((unsigned __int32)Local_Player + 7336) < Global_Variables->Current_Time); + + Target_Structure* Shove_Target = nullptr; + + Shove_Traverse_Sorted_Target_List_Label: + { + if (Target_Number != Sorted_Target_List.size()) + { + Target_Structure* Target = &Sorted_Target_List.at(Target_Number); + + __int8 Forced = 0; + + if (Is_Melee + Healing != 0) + { + if ((Target->Identifier ^ 72) % 348 >= 72) + { + Forced = 1; + + goto Shove_Label; + } + } + + if ((Target->Identifier >= 263) + (Target->Identifier <= 270 - Is_Cold_Melee - (*(__int8*)((unsigned __int32)Local_Player + 8070) ^ 1)) == 2) + { + Shove_Label: + { + __int8 Infected = (Target->Identifier == 264) * (Forced ^ 1); + + if ((Infected ^ 1) + (*(__int32*)((unsigned __int32)Target->Self + 52) == 15) != 0) + { + using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence); + + if (__builtin_strstr(Get_Sequence_Name_Type((unsigned __int32)Client_Module + 203392)(Target->Self, *(__int32*)((unsigned __int32)Target->Self + 2212)), "hove") == nullptr) + { + using Perform_Shove_Trace = __int8(__thiscall*)(void* Weapon, float* Direction); + + using Get_Center_Type = float*(__thiscall*)(void* Entity); + + float* Target_Origin = Get_Center_Type((unsigned __int32)Client_Module + 114400)(Target->Self); + + float Direction[3] = + { + Target_Origin[0] - Eye_Position[0], + + Target_Origin[1] - Eye_Position[1], + + Target_Origin[2] - Eye_Position[2] + }; + + Vector_Normalize(Direction); + + *(float*)((unsigned __int32)Weapon + 2724) = 75; + + *(__int32*)((unsigned __int32)Weapon + 3248) = 0; + + Perform_Trace_Target = (void*)((unsigned __int32)Target->Self ^ 1); + + Perform_Shove_Trace((unsigned __int32)Client_Module + 3220512)(Weapon, Direction); + + if (Perform_Trace_Target == Target->Self) + { + Command->Tick_Number = Target->Tick_Number; + + Command->Angles[0] = __builtin_atan2f(-Direction[2], __builtin_hypotf(Direction[0], Direction[1])) * 180 / 3.1415927f; + + Command->Angles[1] = __builtin_atan2f(Direction[1], Direction[0]) * 180 / 3.1415927f; + + if (Cancelable_Shove == 1) + { + float Shove_Multiplier = min((Global_Variables->Current_Time - *(float*)((unsigned __int32)Weapon + 2704) + *(float*)((unsigned __int32)Weapon + 2700)) / *(float*)((unsigned __int32)Weapon + 2700), 1.f); + + Command->Angles[1] += -45 * Shove_Multiplier + 45 * (1 - Shove_Multiplier); + } + else + { + Command->Angles[1] += 45; + } + + Command->Buttons |= 2048; + + Block_Buttons = 1; + + if (Interface_Riot_Deprioritize.Integer == 1) + { + Cancelable_Shove = Infected * 2; + } + + *(float*)((unsigned __int32)Target->Self + 16) = Get_Target_Time(Target); + + goto Shove_Found_Target_Label; + } + } + } + } + } + + Target_Number += 1; + + goto Shove_Traverse_Sorted_Target_List_Label; + + Shove_Found_Target_Label: + { + Shove_Target = Target; + } + } + } + + if (Cancelable_Shove != 0) + { + __int8 Can_Attack = (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time) * (*(__int32*)((unsigned __int32)Weapon + 2436) > 0 - Is_Melee * 2) * (*(float*)((unsigned __int32)Local_Player + 3872) <= Global_Variables->Current_Time); + + if (Can_Attack == 1) + { + if (Weapon_Identifier != 96) + { + Target_Structure* Aim_Target = nullptr; + + if (Is_Melee + Healing == 0) + { + Target_Number = 0; + + Aim_Traverse_Sorted_Target_List_Label: + { + if (Target_Number != Sorted_Target_List.size()) + { + Target_Structure* Target = &Sorted_Target_List.at(Target_Number); + + float Bones[128][3][4]; + + void* Hitbox_Set = Get_Hitbox_Set(Target, Bones, Global_Variables->Current_Time); + + if (Hitbox_Set != nullptr) + { + auto Perform_Trace = [&](float* Angles) -> __int8 + { + using Fire_Bullet_Type = void(__thiscall*)(void* Player, float X, float Y, float Z, float* Angles, __int32 Identifier, void* Unknown_Parameter); + + __int32 Bullets = *(__int32*)((unsigned __int32)Weapon_Data + 2520); + + *(__int32*)((unsigned __int32)Weapon_Data + 2520) = 1; + + Perform_Trace_Target = (void*)((unsigned __int32)Target->Self ^ 1); + + void* Previous_Audio_Device = *(void**)((unsigned __int32)Engine_Module + 5050008); + + *(void**)((unsigned __int32)Engine_Module + 5050008) = nullptr; + + *(__int32*)((unsigned __int32)Client_Module + 7683464) = 1; + + *(__int32*)((unsigned __int32)Client_Module + 8175320) = 0; + + *(__int32*)((unsigned __int32)Client_Module + 8175392) = 0; + + using Get_Weapon_Identifier_Type = __int32(__thiscall**)(void* Weapon); + + Fire_Bullet_Type((unsigned __int32)Client_Module + 3103776)(Local_Player, Eye_Position[0], Eye_Position[1], Eye_Position[2], Angles, (*Get_Weapon_Identifier_Type(*(unsigned __int32*)Weapon + 1532))(Weapon), nullptr); + + *(__int32*)((unsigned __int32)Client_Module + 8175392) = 1; + + *(__int32*)((unsigned __int32)Client_Module + 8175320) = 1; + + *(__int32*)((unsigned __int32)Client_Module + 7683464) = 0; + + *(void**)((unsigned __int32)Engine_Module + 5050008) = Previous_Audio_Device; + + *(__int32*)((unsigned __int32)Weapon_Data + 2520) = Bullets; + + return Perform_Trace_Target == Target->Self; + }; + + static std::unordered_map<__int32, __int32> Hitboxes = + { + { 0, 10 }, + + { 13, 0 }, + + { 99, 9 }, + + { 263, 10 }, + + { 264, 15 }, + + { 265, 4 }, + + { 270, 10 }, + + { 272, 4 }, + + { 276, 12 }, + + { 277, 10 } + }; + + void* Hitbox = (void*)((unsigned __int32)Hitbox_Set + 12 + Hitboxes[Target->Identifier] * 68); + + float* Hitbox_Minimum = (float*)((unsigned __int32)Hitbox + 8); + + float* Hitbox_Maximum = (float*)((unsigned __int32)Hitbox + 20); + + float Hitbox_Center[3] + { + (Hitbox_Minimum[0] + Hitbox_Maximum[0]) / 2, + + (Hitbox_Minimum[1] + Hitbox_Maximum[1]) / 2, + + (Hitbox_Minimum[2] + Hitbox_Maximum[2]) / 2 + }; + + float Target_Origin[3] = + { + Bones[*(__int32*)Hitbox][0][0] * Hitbox_Center[0] + Bones[*(__int32*)Hitbox][0][1] * Hitbox_Center[1] + Bones[*(__int32*)Hitbox][0][2] * Hitbox_Center[2] + Bones[*(__int32*)Hitbox][0][3], + + Bones[*(__int32*)Hitbox][1][0] * Hitbox_Center[0] + Bones[*(__int32*)Hitbox][1][1] * Hitbox_Center[1] + Bones[*(__int32*)Hitbox][1][2] * Hitbox_Center[2] + Bones[*(__int32*)Hitbox][1][3], + + Bones[*(__int32*)Hitbox][2][0] * Hitbox_Center[0] + Bones[*(__int32*)Hitbox][2][1] * Hitbox_Center[1] + Bones[*(__int32*)Hitbox][2][2] * Hitbox_Center[2] + Bones[*(__int32*)Hitbox][2][3] + }; + + float Direction[3] = + { + Target_Origin[0] - Eye_Position[0], + + Target_Origin[1] - Eye_Position[1], + + Target_Origin[2] - Eye_Position[2] + }; + + Vector_Normalize(Direction); + + float Angles[3] = + { + __builtin_atan2f(-Direction[2], __builtin_hypotf(Direction[0], Direction[1])) * 180 / 3.1415927f, + + __builtin_atan2f(Direction[1], Direction[0]) * 180 / 3.1415927f, + + 0 + }; + + if (Perform_Trace(Angles) == 1) + { + Command->Tick_Number = Target->Tick_Number; + + Byte_Manager::Copy_Bytes(0, Command->Angles, sizeof(Angles), Angles); + + Command->Buttons |= 1; + + *(float*)((unsigned __int32)Target->Self + 16) = Get_Target_Time(Target); + + goto Aim_Found_Target_Label; + } + } + + Target_Number += 1; + + goto Aim_Traverse_Sorted_Target_List_Label; + + Aim_Found_Target_Label: + { + Aim_Target = Target; + } + } + } + } + + __int8 Compensate_Burst = 0; + + if (Weapon_Identifier == 153) + { + if (*(float*)((unsigned __int32)Weapon + 3392) + *(float*)((unsigned __int32)Weapon + 3396) != 0) + { + Compensate_Burst = 1; + + Command->Buttons |= 1; + } + } + + if ((Command->Buttons & 1) == 1) + { + if (Shove_Target != nullptr) + { + *(float*)((unsigned __int32)Shove_Target->Self + 16) = 0; + + if (Aim_Target != nullptr) + { + *(float*)((unsigned __int32)Aim_Target->Self + 16) = Get_Target_Time(Aim_Target); + } + } + + if (Is_Melee == 0) + { + *(__int32*)((unsigned __int32)Client_Module + 7075944) = Command->Random_Seed; + + using Random_Type = float(__cdecl*)(char* Name, float Minimum, float Maximum, void* Unknown_Parameter); + + using Update_Spread_Type = void(__thiscall*)(void* Weapon); + + if (Compensate_Burst == 0) + { + Update_Spread_Type((unsigned __int32)Client_Module + 3197648)(Weapon); + } + + float Maximum_Spread = *(float*)((unsigned __int32)Weapon + 3340); + + float* Recoil = (float*)((unsigned __int32)Local_Player + 4612); + + Command->Angles[0] -= Random_Type((unsigned __int32)Client_Module + 1756592)((char*)"CTerrorGun::FireBullet HorizSpread", -Maximum_Spread, Maximum_Spread, nullptr) + Recoil[0]; + + Command->Angles[1] -= Random_Type((unsigned __int32)Client_Module + 1756592)((char*)"CTerrorGun::FireBullet VertSpread", -Maximum_Spread, Maximum_Spread, nullptr) + Recoil[1]; + + Command->Angles[2] -= Recoil[2]; + } + + Block_Buttons = 2048; + } + } + } + + if (Block_Buttons == 2049) + { + Block_Buttons = 2048 * (Cancelable_Shove == 1) + (Can_Attack ^ 1); + } + } + } + } + } + } + + Command->Buttons &= ~Block_Buttons; + + Byte_Manager::Copy_Bytes(0, Command->Move, sizeof(Previous_Move), Previous_Move); + + Correct_Movement(); + } + + *(__int8*)((unsigned __int32)__builtin_frame_address(0) + 235) = Extra_Commands <= 0; + } + } + + Command->Buttons &= ~524288; + + (decltype(&Redirected_Copy_Command)(Original_Copy_Command_Caller))(Unknown_Parameter, Command); +} \ No newline at end of file diff --git a/Draw_Crosshair.hpp b/Draw_Crosshair.hpp index f4e7a50..7d0b18d 100755 --- a/Draw_Crosshair.hpp +++ b/Draw_Crosshair.hpp @@ -1,6 +1,6 @@ void Redirected_Draw_Crosshair() { - if ((*(__int32*)(*(unsigned __int32*)((unsigned __int32)Client_Module + 7490392) + 5008) | 55) == 55) + if ((*(__int32*)(*(unsigned __int32*)((unsigned __int32)Client_Module + 7498712) + 5008) | 55) == 55) { static float Rotation_Angle; @@ -8,7 +8,7 @@ void Redirected_Draw_Crosshair() { using Set_Color_Type = void(__thiscall**)(void* Surface, unsigned __int8 Red, unsigned __int8 Green, unsigned __int8 Blue, unsigned __int8 Alpha); - void* Surface = *(void**)((unsigned __int32)Client_Module + 8951284); + void* Surface = *(void**)((unsigned __int32)Client_Module + 8960244); (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 0, 0, 0, 255); @@ -43,9 +43,9 @@ void Redirected_Draw_Crosshair() using Get_Screen_Size_Type = __int32(__cdecl*)(); - __int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738528)() / 2; + __int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738576)() / 2; - __int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738496)() / 2; + __int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738544)() / 2; Draw_Storm_Label: { @@ -59,6 +59,6 @@ void Redirected_Draw_Crosshair() } } - Rotation_Angle = __builtin_remainderf(Rotation_Angle + (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7088552))->Frame_Time * Interface_Storm_Speed.Integer, 360); + Rotation_Angle = __builtin_remainderf(Rotation_Angle + (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744))->Frame_Time * Interface_Storm_Speed.Integer, 360); } } \ No newline at end of file diff --git a/Draw_Effect.hpp b/Draw_Effect.hpp index 1cd0f35..8db74f3 100755 --- a/Draw_Effect.hpp +++ b/Draw_Effect.hpp @@ -4,7 +4,7 @@ __int8 __thiscall Redirected_Draw_Effect(void* Effect, void* Unknown_Parameter_1 { using Get_Effect_Name_Type = char*(__thiscall*)(void* a1); - char* Effect_Name = Get_Effect_Name_Type((unsigned __int32)Client_Module + 1423008)((void*)((unsigned __int32)Effect - 8)); + char* Effect_Name = Get_Effect_Name_Type((unsigned __int32)Client_Module + 1423120)((void*)((unsigned __int32)Effect - 8)); if (__builtin_strstr(Effect_Name, "ecloud_") == nullptr) { diff --git a/Entry_Point.cpp b/Entry_Point.cpp index 88ca15d..f296bca 100755 --- a/Entry_Point.cpp +++ b/Entry_Point.cpp @@ -20,16 +20,22 @@ void* Client_Module; #include "Interpolate.hpp" +#include "Update_Animations.hpp" + #include +#include + #include "Estimate_Velocity.hpp" #include "Spawn_Grenade.hpp" -#include "Run_Prediction.hpp" +#include "Update.hpp" #include "Run_Command.hpp" +#include "Process_Movement.hpp" + #include "Play_Footstep_Sound.hpp" #include @@ -46,9 +52,9 @@ void* Client_Module; #include "Move.hpp" -#include +#include "Send_Move.hpp" -#include +#include #include "Copy_Command.hpp" @@ -175,20 +181,13 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi Client_Module = GetModuleHandleW(L"client.dll"); - //DEBUG - { - *(__int32*)((unsigned __int32)Client_Module + 0x7B0528 + 0x14) &= ~0xA; - *(__int32*)((unsigned __int32)Client_Module + 0x7807B8 + 0x14) &= ~0xA; - *(__int32*)((unsigned __int32)Client_Module + 0x77E358 + 0x14) &= ~0xA; - } - _putws(L"[ + ] Events"); { - Redirection_Manager::Redirect_Function(Original_Post_Network_Data_Received_Caller, 0, (void*)((unsigned __int32)Client_Module + 1555088), 1, (void*)Redirected_Post_Network_Data_Received); + Redirection_Manager::Redirect_Function(Original_Post_Network_Data_Received_Caller, 0, (void*)((unsigned __int32)Client_Module + 1555264), 1, (void*)Redirected_Post_Network_Data_Received); Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 316816), 1, 195); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Engine_Module + 521549), 1, 235); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Engine_Module + 521741), 1, 235); } _putws(L"[ + ] Interpolation"); @@ -198,22 +197,22 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi _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); 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::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 3236851), 1, 15); - - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 3237030), 1, 15); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 3244278), 1, 15); } _putws(L"[ + ] Prediction"); { static Prediction_Descriptor_Structure Original_Prediction_Descriptor; - Prediction_Descriptor_Structure* Prediction_Descriptor = (Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7282444); + Prediction_Descriptor_Structure* Prediction_Descriptor = (Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7290836); Byte_Manager::Copy_Bytes(0, &Original_Prediction_Descriptor, sizeof(Prediction_Descriptor_Structure), Prediction_Descriptor); @@ -225,47 +224,49 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi Prediction_Descriptor->Parent = &Original_Prediction_Descriptor; - Redirection_Manager::Redirect_Function(Original_Spawn_Grenade_Caller, 2, (void*)((unsigned __int32)Client_Module + 2227120), 1, (void*)Redirected_Spawn_Grenade); + Redirection_Manager::Redirect_Function(Original_Spawn_Grenade_Caller, 2, (void*)((unsigned __int32)Client_Module + 2227424), 1, (void*)Redirected_Spawn_Grenade); - Redirection_Manager::Redirect_Function(Original_Run_Prediction_Caller, 0, (void*)((unsigned __int32)Engine_Module + 527584), 1, (void*)Redirected_Run_Prediction); + Redirection_Manager::Redirect_Function(Original_Update_Caller, 0, (void*)((unsigned __int32)Client_Module + 1554304), 1, (void*)Redirected_Update); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1557600), 1, 235); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1554528), 1, 235); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1557511), 8, 144); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1557776), 1, 235); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2465971), 5, 144); + Redirection_Manager::Redirect_Function(Original_Run_Command_Caller, 0, (void*)((unsigned __int32)Client_Module + 1553504), 1, (void*)Redirected_Run_Command); - Redirection_Manager::Redirect_Function(Original_Run_Command_Caller, 0, (void*)((unsigned __int32)Client_Module + 1553328), 1, (void*)Redirected_Run_Command); + Redirection_Manager::Redirect_Function(Original_Process_Movement_Caller, 2, (void*)((unsigned __int32)Client_Module + 2590832), 1, (void*)Redirected_Process_Movement); - Redirection_Manager::Redirect_Function(Original_Play_Footstep_Sound_Caller, 0, (void*)((unsigned __int32)Client_Module + 978336), 1, (void*)Redirected_Play_Footstep_Sound); + Redirection_Manager::Redirect_Function(Original_Play_Footstep_Sound_Caller, 0, (void*)((unsigned __int32)Client_Module + 978464), 1, (void*)Redirected_Play_Footstep_Sound); - Redirection_Manager::Redirect_Function(Original_Finish_Move_Caller, 2, (void*)((unsigned __int32)Client_Module + 1553088), 1, (void*)Redirected_Finish_Move); + Redirection_Manager::Redirect_Function(Original_Finish_Move_Caller, 2, (void*)((unsigned __int32)Client_Module + 1553264), 1, (void*)Redirected_Finish_Move); - Redirection_Manager::Redirect_Function(Original_Item_Post_Frame_Caller, 3, (void*)((unsigned __int32)Client_Module + 2535760), 1, (void*)Redirected_Item_Post_Frame); + Redirection_Manager::Redirect_Function(Original_Item_Post_Frame_Caller, 3, (void*)((unsigned __int32)Client_Module + 2542896), 1, (void*)Redirected_Item_Post_Frame); - *(__int32*)((unsigned __int32)Original_Item_Post_Frame_Caller + 5) = (__int32)((unsigned __int32)Client_Module + 2438103) - (__int32)Original_Item_Post_Frame_Caller; + *(__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 + 3086496), 1, (void*)Redirected_Perform_Trace); + Redirection_Manager::Redirect_Function(Original_Perform_Trace_Caller, 0, (void*)((unsigned __int32)Client_Module + 3093744), 1, (void*)Redirected_Perform_Trace); - Original_Perform_Shove_Trace_Caller = (void*)((unsigned __int32)Client_Module + 3213879); + Original_Perform_Shove_Trace_Caller = (void*)((unsigned __int32)Client_Module + 3221111); - Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 3213870), (void*)Redirected_Perform_Shove_Trace); + Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 3221102), (void*)Redirected_Perform_Shove_Trace); } _putws(L"[ + ] Network"); { - Redirection_Manager::Redirect_Function(Original_Read_Packets_Caller, 0, (void*)((unsigned __int32)Engine_Module + 499120), 1, (void*)Redirected_Read_Packets); + Redirection_Manager::Redirect_Function(Original_Read_Packets_Caller, 0, (void*)((unsigned __int32)Engine_Module + 499264), 1, (void*)Redirected_Read_Packets); - Redirection_Manager::Redirect_Function(Original_Move_Caller, 3, (void*)((unsigned __int32)Engine_Module + 512096), 1, (void*)Redirected_Move); + Redirection_Manager::Redirect_Function(Original_Move_Caller, 3, (void*)((unsigned __int32)Engine_Module + 512288), 1, (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 + 1250469), 3, 144); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1250629), 3, 144); Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 417204), 1, 235); - Redirection_Manager::Redirect_Function(Original_Copy_Command_Caller, 0, (void*)((unsigned __int32)Client_Module + 1094448), 1, (void*)Redirected_Copy_Command); + Redirection_Manager::Redirect_Function(Original_Copy_Command_Caller, 0, (void*)((unsigned __int32)Client_Module + 1094624), 1, (void*)Redirected_Copy_Command); } _putws(L"[ + ] Effects"); @@ -274,30 +275,30 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 133424), 1, 235); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2874334), 1, 246); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2881566), 1, 246); - Redirection_Manager::Redirect_Function(Original_Draw_Effect_Caller, 0, (void*)((unsigned __int32)Client_Module + 1425744), 1, (void*)Redirected_Draw_Effect); + Redirection_Manager::Redirect_Function(Original_Draw_Effect_Caller, 0, (void*)((unsigned __int32)Client_Module + 1425888), 1, (void*)Redirected_Draw_Effect); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1868093), 1, 52); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 1868237), 1, 52); - Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2648346), 1, 216); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2655546), 1, 216); - *(void**)((unsigned __int32)Client_Module + 8106800) = (void*)((unsigned __int32)Client_Module + 955612); + *(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") + 100560), 1, (void*)Redirected_Write_Texture); - Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2906288), (void*)Redirected_Paint); + Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2913504), (void*)Redirected_Paint); - Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2455120), (void*)Redirected_Get_Glow_Color); + Redirection_Manager::Redirect_Function(Original_Get_Glow_Color_Caller, 1, (void*)((unsigned __int32)Client_Module + 2455600), 1, (void*)Redirected_Get_Glow_Color); - Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 2300832), (void*)Redirected_Draw_Crosshair); + 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 + 2923737), 1, 235); + Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Client_Module + 2930985), 1, 235); - Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 3111488), (void*)Redirected_Draw_Crosshair); + Redirection_Manager::Redirect_Function(1, (void*)((unsigned __int32)Client_Module + 3118720), (void*)Redirected_Draw_Crosshair); } } } diff --git a/Estimate_Velocity.hpp b/Estimate_Velocity.hpp index da32945..87ab7bf 100755 --- a/Estimate_Velocity.hpp +++ b/Estimate_Velocity.hpp @@ -1,15 +1,155 @@ +__int32 Get_Identifier(void* Entity, __int8 Raw, __int8 Equipment) +{ + using Get_Identifier_Type = void*(__cdecl**)(); + + __int32 Identifier = *(__int32*)((unsigned __int32)(*Get_Identifier_Type(*(unsigned __int32*)((unsigned __int32)Entity + 8) + 4))() + 20); + + if (Raw == 1) + { + return Identifier; + } + + static std::unordered_set<__int32> Targets = + { + 0, + + 13, + + 99, + + 232, + + 263, + + 264, + + 265, + + 270, + + 272, + + 275, + + 276, + + 277 + }; + + if (Targets.contains(Identifier) == 1) + { + __int8 Valid = 0; + + if (Identifier == 13) + { + Valid = *(__int8*)((unsigned __int32)Entity + 324) == 5; + } + else + { + if (*(__int8*)((unsigned __int32)Entity + 221) == 0) + { + if (*(__int32*)((unsigned __int32)Entity + 572) == 131088) + { + using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence); + + if (__builtin_strstr(Get_Sequence_Name_Type((unsigned __int32)Client_Module + 203392)(Entity, *(__int32*)((unsigned __int32)Entity + 2212)), "eath") == nullptr) + { + Valid = 1; + } + } + } + } + + if (Valid == 1) + { + if (Identifier * (*(__int32*)((unsigned __int32)Entity + 228) == 3) == 232) + { + static std::unordered_map<__int32, __int32> Translators = + { + { 1, 270 }, + + { 2, 0 }, + + { 3, 263 }, + + { 4, 272 }, + + { 5, 265 }, + + { 6, 99 }, + + { 8, 276 } + }; + + Identifier = Translators[*(__int32*)((unsigned __int32)Entity + 7312)]; + } + + return (Identifier - 232) % 43 ? Identifier : 232; + } + } + else + { + if (Equipment == 1) + { + static std::unordered_set<__int32> Equipment_List = + { + 73, + + 105, + + 109, + + 121, + + 256, + + 260 + }; + + if (Equipment_List.contains(Identifier) == 1) + { + if (Identifier == 260) + { + static std::unordered_map<__int32, __int32> Translators = + { + { 12, 73 }, + + { 15, 121 }, + + { 23, 105 }, + + { 24, 109 } + }; + + Identifier = Translators[*(__int32*)((unsigned __int32)Entity + 2392)]; + } + + if (Identifier != 0) + { + if (*(void**)((unsigned __int32)Entity + 312) == INVALID_HANDLE_VALUE) + { + return -Identifier; + } + } + } + } + } + + return -1; +} + void* Original_Estimate_Velocity_Caller; void __thiscall Redirected_Estimate_Velocity(void* Entity, float* Velocity) { - static std::unordered_set Invalids = + static std::unordered_set<__int32> Invalids = { - (void*)((unsigned __int32)Client_Module + 6329708), + 264, - (void*)((unsigned __int32)Client_Module + 6332260) + 277 }; - if (Invalids.contains(*(void**)Entity) == 1) + if (Invalids.contains(Get_Identifier(Entity, 1, 0)) == 1) { (decltype(&Redirected_Estimate_Velocity)(Original_Estimate_Velocity_Caller))(Entity, Velocity); } diff --git a/Extended_Interface.hpp b/Extended_Interface.hpp index ea0ad9b..57c6a5e 100755 --- a/Extended_Interface.hpp +++ b/Extended_Interface.hpp @@ -15,6 +15,16 @@ struct Interface_Structure Interface_Structure Interface_Extra_Commands; +Interface_Structure Interface_Interpolate_Extra_Commands; + +Interface_Structure Interface_Target_On_Simulation; + +Interface_Structure Interface_Riot_Deprioritize; + +Interface_Structure Interface_Penetrate_Teammates; + +Interface_Structure Interface_Equipment_Distance; + Interface_Structure Interface_Storm_Rotation_Radius; Interface_Structure Interface_Storm_Radius; @@ -25,17 +35,13 @@ Interface_Structure Interface_Storm_Iterations; Interface_Structure Interface_Storm_Speed; -Interface_Structure Interface_Test; -Interface_Structure Interface_Test2; -Interface_Structure Interface_Test3; - void Implement_Extended_Interface() { auto Create_Console_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); - Create_Console_Variable_Type((unsigned __int32)Engine_Module + 2635296)(Interface, Name, Value, nullptr, nullptr, Handler); + Create_Console_Variable_Type((unsigned __int32)Engine_Module + 2636656)(Interface, Name, Value, nullptr, nullptr, Handler); *(__int32*)((unsigned __int32)Interface + 20) &= ~10; @@ -46,6 +52,16 @@ void Implement_Extended_Interface() Create_Console_Interface(Pointer_Name(Interface_Extra_Commands), (char*)"4", nullptr); + Create_Console_Interface(Pointer_Name(Interface_Interpolate_Extra_Commands), (char*)"1", nullptr); + + Create_Console_Interface(Pointer_Name(Interface_Target_On_Simulation), (char*)"0", nullptr); + + Create_Console_Interface(Pointer_Name(Interface_Riot_Deprioritize), (char*)"0", nullptr); + + Create_Console_Interface(Pointer_Name(Interface_Penetrate_Teammates), (char*)"0", nullptr); + + Create_Console_Interface(Pointer_Name(Interface_Equipment_Distance), (char*)"2048", nullptr); + Create_Console_Interface(Pointer_Name(Interface_Storm_Rotation_Radius), (char*)"24", nullptr); Create_Console_Interface(Pointer_Name(Interface_Storm_Radius), (char*)"8", nullptr); @@ -55,8 +71,4 @@ void Implement_Extended_Interface() Create_Console_Interface(Pointer_Name(Interface_Storm_Iterations), (char*)"16", nullptr); Create_Console_Interface(Pointer_Name(Interface_Storm_Speed), (char*)"512", nullptr); - - Create_Console_Interface(Pointer_Name(Interface_Test), (char*)"0", nullptr); - Create_Console_Interface(Pointer_Name(Interface_Test2), (char*)"0", nullptr); - Create_Console_Interface(Pointer_Name(Interface_Test3), (char*)"0", nullptr); } \ No newline at end of file diff --git a/Get_Glow_Color.hpp b/Get_Glow_Color.hpp index 22d8a4a..91151fa 100755 --- a/Get_Glow_Color.hpp +++ b/Get_Glow_Color.hpp @@ -1,4 +1,9 @@ -void __thiscall Redirected_Get_Glow_Color(void* Entity, float* Red, float* Green, float* Blue, float* Alpha) +void* Original_Get_Glow_Color_Caller; + +void __thiscall Redirected_Get_Glow_Color(void* Entity, void* Unknown_Parameter_1, void* Unknown_Parameter_2, void* Unknown_Parameter_3, void* Unknown_Parameter_4) { - *Alpha = 0; + if (Get_Identifier(Entity, 0, 0) != 232) + { + (decltype(&Redirected_Get_Glow_Color)(Original_Get_Glow_Color_Caller))(Entity, Unknown_Parameter_1, Unknown_Parameter_2, Unknown_Parameter_3, Unknown_Parameter_4); + } } \ No newline at end of file diff --git a/Interpolate.hpp b/Interpolate.hpp index 8c212b9..99074f1 100755 --- a/Interpolate.hpp +++ b/Interpolate.hpp @@ -1,10 +1,27 @@ +struct Global_Variables_Structure +{ + __int8 Additional_Bytes_1[12]; + + float Current_Time; + + float Frame_Time; + + __int8 Additional_Bytes_2[8]; + + float Interval_Per_Tick; +}; + void* Original_Interpolate_Caller; -__int8 __thiscall Redirected_Interpolate(void* Entity, void* Unknown_Parameter) +__int8 __thiscall Redirected_Interpolate(void* Entity, float Time) { - if (Entity == *(void**)((unsigned __int32)Client_Module + 7490392)) + if (Entity == *(void**)((unsigned __int32)Client_Module + 7498712)) { - return (decltype(&Redirected_Interpolate)(Original_Interpolate_Caller))(Entity, Unknown_Parameter); + Time = (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744))->Current_Time; + + *(__int32*)((unsigned __int32)Entity + 5328) -= *(__int32*)((unsigned __int32)Entity + 16); + + return (decltype(&Redirected_Interpolate)(Original_Interpolate_Caller))(Entity, Time); } return 1; diff --git a/Move.hpp b/Move.hpp new file mode 100644 index 0000000..8faf521 --- /dev/null +++ b/Move.hpp @@ -0,0 +1,41 @@ +void* Original_Move_Caller; + +__int32 Extra_Commands; + +void Redirected_Move(float Unknown_Parameter, __int8 Final) +{ + if (*(void**)((unsigned __int32)Client_Module + 7498712) != nullptr) + { + Redirected_Read_Packets(Final); + + using Fire_Events_Type = void(__cdecl*)(); + + Fire_Events_Type((unsigned __int32)Engine_Module + 521648)(); + } + + Extra_Commands = -1; + + Move_Label: + { + (decltype(&Redirected_Move)(Original_Move_Caller))(Unknown_Parameter, Final); + + if (Extra_Commands > 0) + { + Extra_Commands -= 1; + + goto Move_Label; + } + } + + using Update_Animations_Type = void(__cdecl*)(); + + Update_Animations_Type((unsigned __int32)Client_Module + 205296)(); + + Update_Animation_Time = (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744))->Current_Time; + + Update_Animation_Type = 1; + + Update_Animations_Type((unsigned __int32)Client_Module + 205296)(); + + Update_Animation_Type = 0; +} \ No newline at end of file diff --git a/Paint.hpp b/Paint.hpp index 7a24c5d..ddd6c2c 100755 --- a/Paint.hpp +++ b/Paint.hpp @@ -2,9 +2,9 @@ void __thiscall Redirected_Paint(void* Panel) { using Set_Order_Type = void(__thiscall*)(void* Panel, __int32 Order); - Set_Order_Type((unsigned __int32)Client_Module + 4074160)(Panel, -1); + Set_Order_Type((unsigned __int32)Client_Module + 4082160)(Panel, -1); - void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7490392); + void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712); __int32 Entity_Number = 1; @@ -12,23 +12,27 @@ void __thiscall Redirected_Paint(void* Panel) Traverse_Entity_List_Label: { - void* Entity = *(void**)((unsigned __int32)Client_Module + 7636212 + ((Entity_Number - 4097) << 4)); + void* Entity = *(void**)((unsigned __int32)Client_Module + 7644532 + ((Entity_Number - 4097) << 4)); if (Entity != nullptr) { if (Entity != Local_Player) { - __int32 Identifier = Get_Identifier(Entity); + __int32 Identifier = Get_Identifier(Entity, 0, 1); if (Identifier != -1) { - float* Local_Player_Origin = (float*)((unsigned __int32)Local_Player + 292); + __int8 Equipment = Identifier < 0; - float* Entity_Origin = (float*)((unsigned __int32)Entity + 292); + using Get_Origin_Type = float*(__thiscall*)(void* Entity); + + float* Local_Player_Origin = Get_Origin_Type((unsigned __int32)Client_Module + 297584)(Local_Player); + + float* Entity_Origin = Get_Origin_Type((unsigned __int32)Client_Module + 297584)(Entity); Target_Structure Target = { - Identifier, + __builtin_abs(Identifier), Entity, @@ -37,12 +41,22 @@ void __thiscall Redirected_Paint(void* Panel) __builtin_powf(Local_Player_Origin[0] - Entity_Origin[0], 2) + __builtin_powf(Local_Player_Origin[1] - Entity_Origin[1], 2) + __builtin_powf(Local_Player_Origin[2] - Entity_Origin[2], 2) }; - Sorted_Target_List.push_back(Target); + if (Equipment == 0) + { + Sorted_Target_List.push_back(Target); + } + else + { + if (__builtin_sqrtf(Target.Distance) <= Interface_Equipment_Distance.Floating_Point) + { + Sorted_Target_List.push_back(Target); + } + } } } } - if (Entity_Number != *(__int32*)((unsigned __int32)Client_Module + 7636248)) + if (Entity_Number != *(__int32*)((unsigned __int32)Client_Module + 7644568)) { Entity_Number += 1; @@ -71,7 +85,7 @@ void __thiscall Redirected_Paint(void* Panel) { float Bones[128][3][4]; - void* Hitbox_Set = Get_Hitbox_Set(Target, Bones, (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7088552))->Current_Time); + void* Hitbox_Set = Get_Hitbox_Set(Target, Bones, (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744))->Current_Time); if (Hitbox_Set != nullptr) { @@ -125,13 +139,13 @@ void __thiscall Redirected_Paint(void* Panel) float Screen[3]; - if (Screen_Transform_Type((unsigned __int32)Client_Module + 1841488)(Hitbox_Vertices[Vertex_Number], Screen) == 0) + if (Screen_Transform_Type((unsigned __int32)Client_Module + 1841648)(Hitbox_Vertices[Vertex_Number], Screen) == 0) { using Get_Screen_Size_Type = __int32(__cdecl*)(); - __int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738528)(); + __int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738576)(); - __int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738496)(); + __int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738544)(); Screen[0] = Screen[0] / 2 * Screen_Width + Screen_Width / 2; @@ -180,42 +194,48 @@ void __thiscall Redirected_Paint(void* Panel) if (Get_Bounds() == 1) { - void* Surface = *(void**)((unsigned __int32)Client_Module + 8951284); + void* Surface = *(void**)((unsigned __int32)Client_Module + 8960244); struct Paint_Data_Structure { unsigned __int8 Color[3]; - unsigned __int8 Fill_Color[3]; - wchar_t* Name; }; static std::unordered_map<__int32, Paint_Data_Structure> Paint_Data_List = { - { 0, { { 255, 128, 0 }, { 128, 64, 0 }, (wchar_t*)L"Boomer" } }, + { 0, { { 255, 128, 0 }, (wchar_t*)L"Boomer" } }, - { 13, { { 0, 128, 255 }, { 0, 64, 128 }, (wchar_t*)L"Rock" } }, + { 13, { { 0, 128, 255 }, (wchar_t*)L"Rock" } }, - { 99, { { 255, 128, 0 }, { 128, 64, 0 }, (wchar_t*)L"Charger" } }, + { 73, { { 255, 255, 255 }, (wchar_t*)L"Aid" } }, - { 232, { { 0, 255, 0 }, { 0, 128, 0 }, (wchar_t*)L"Survivor" } }, + { 99, { { 255, 128, 0 }, (wchar_t*)L"Charger" } }, - { 263, { { 255, 128, 0 }, { 128, 64, 0 }, (wchar_t*)L"Hunter" } }, + { 105, { { 255, 255, 255 }, (wchar_t*)L"Adrenaline" } }, - { 264, { { 255, 0, 0 }, { 128, 0, 0 }, (wchar_t*)L"Infected" } }, + { 109, { { 255, 255, 255 }, (wchar_t*)L"Defibrillator" } }, - { 265, { { 255, 128, 0 }, { 128, 64, 0 }, (wchar_t*)L"Jockey" } }, + { 121, { { 255, 255, 255 }, (wchar_t*)L"Pain" } }, - { 270, { { 255, 128, 0 }, { 128, 64, 0 }, (wchar_t*)L"Smoker" } }, + { 232, { { 0, 255, 0 }, (wchar_t*)L"Survivor" } }, - { 272, { { 255, 128, 0 }, { 128, 64, 0 }, (wchar_t*)L"Spitter" } }, + { 256, { { 255, 255, 255 }, (wchar_t*)L"Ammo" } }, - { 275, { { 0, 255, 0 }, { 0, 128, 0 }, (wchar_t*)L"Survivor" } }, + { 263, { { 255, 128, 0 }, (wchar_t*)L"Hunter" } }, - { 276, { { 0, 128, 255 }, { 0, 64, 128 }, (wchar_t*)L"Tank" } }, + { 264, { { 255, 0, 0 }, (wchar_t*)L"Infected" } }, - { 277, { { 0, 128, 255 }, { 0, 64, 128 }, (wchar_t*)L"Witch" } } + { 265, { { 255, 128, 0 }, (wchar_t*)L"Jockey" } }, + + { 270, { { 255, 128, 0 }, (wchar_t*)L"Smoker" } }, + + { 272, { { 255, 128, 0 }, (wchar_t*)L"Spitter" } }, + + { 276, { { 0, 128, 255 }, (wchar_t*)L"Tank" } }, + + { 277, { { 0, 128, 255 }, (wchar_t*)L"Witch" } } }; Paint_Data_Structure* Paint_Data = &Paint_Data_List[Target->Identifier]; @@ -245,18 +265,18 @@ void __thiscall Redirected_Paint(void* Panel) } else { - (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 255, 255, 255, 255); + (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 128, 128, 128, 255); } (*Draw_Rect_Type(*(unsigned __int32*)Surface + 56))(Surface, From_X, From_Y, To_X, To_Y); if (Ghost == 0) { - (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, Paint_Data->Fill_Color[0], Paint_Data->Fill_Color[1], Paint_Data->Fill_Color[2], 128); + (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, (__int32)(Paint_Data->Color[0] / 2 + 0.5f), (__int32)(Paint_Data->Color[1] / 2 + 0.5f), (__int32)(Paint_Data->Color[2] / 2 + 0.5f), 128); } else { - (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 128, 128, 128, 128); + (*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 64, 64, 64, 128); } using Draw_Filled_Rect_Type = void(__thiscall**)(void* Surface, __int32 From_X, __int32 From_Y, __int32 To_X, __int32 To_Y); @@ -266,7 +286,7 @@ void __thiscall Redirected_Paint(void* Panel) Draw_Box(Bounds[0], Bounds[2], Bounds[1], Bounds[3]); - using Draw_Text_Type = void(__cdecl*)(void* Font, __int32 X, __int32 Y, __int32 R, __int32 G, __int32 B, __int32 A, wchar_t* Text); + using Draw_Text_Type = void(__cdecl*)(void* Font, __int32 X, __int32 Y, __int32 Red, __int32 Green, __int32 Blue, __int32 Alpha, wchar_t* Text); auto Create_Font = [&]() -> void* { @@ -286,7 +306,7 @@ void __thiscall Redirected_Paint(void* Panel) Write_Character = Text[0]; - Draw_Text_Type((unsigned __int32)Engine_Module + 2217776)(Font, 0, 0, 0, 0, 0, 0, Text); + Draw_Text_Type((unsigned __int32)Engine_Module + 2219056)(Font, 0, 0, 0, 0, 0, 0, Text); if (Character != L'~') { @@ -344,11 +364,11 @@ void __thiscall Redirected_Paint(void* Panel) if (Ghost == 0) { - Draw_Text_Type((unsigned __int32)Engine_Module + 2217776)(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 + 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); } else { - Draw_Text_Type((unsigned __int32)Engine_Module + 2217776)(Font, Bounds[1] + 7 + Offset_X - Character_Bounds[0], Bounds[2] + Offset_Y, 255, 255, 255, 255, Text); + 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); } Write_Character = 0; diff --git a/Perform_Shove_Trace.hpp b/Perform_Shove_Trace.hpp index 8799b75..c2e0689 100755 --- a/Perform_Shove_Trace.hpp +++ b/Perform_Shove_Trace.hpp @@ -17,7 +17,7 @@ void __declspec(naked) Redirected_Perform_Shove_Trace() asm("call *%edx"); asm("pusha"); asm("mov %esp, %ecx"); - asm("call %0" : : "m"(Perform_Shove_Trace)); + asm("calll %0" : : "m"(Perform_Shove_Trace)); asm("popa"); asm("jmp *%0" : : "m"(Original_Perform_Shove_Trace_Caller)); } \ No newline at end of file diff --git a/Perform_Trace.hpp b/Perform_Trace.hpp index d88cf70..5fc6699 100755 --- a/Perform_Trace.hpp +++ b/Perform_Trace.hpp @@ -4,20 +4,33 @@ float Vector_Normalize(float* Vector) { using Vector_Normalize_Type = float(__thiscall*)(float* Vector); - return Vector_Normalize_Type((unsigned __int32)Client_Module + 3528928)(Vector); + return Vector_Normalize_Type((unsigned __int32)Client_Module + 3536176)(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 + 3532128)(Angles, Forward, Right, Up); + Angle_Vectors_Type((unsigned __int32)Client_Module + 3539376)(Angles, Forward, Right, Up); }; void __thiscall Perform_Trace(void* Stack) { void* Entity = *(void**)((unsigned __int32)Stack + 312); + if (Interface_Penetrate_Teammates.Integer == 0) + { + if (Get_Identifier(Entity, 0, 0) == 232) + { + void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712); + + if (*(__int32*)((unsigned __int32)Entity + 228) == *(__int32*)((unsigned __int32)Local_Player + 228)) + { + Perform_Trace_Target = nullptr; + } + } + } + if (Entity == (void*)((unsigned __int32)Perform_Trace_Target ^ 1)) { void* Trace_Information = *(void**)((unsigned __int32)Stack + 36); @@ -70,7 +83,7 @@ void __declspec(naked) Redirected_Perform_Trace() { asm("pusha"); asm("mov %esp, %ecx"); - asm("call %0" : : "m"(Perform_Trace)); + asm("calll %0" : : "m"(Perform_Trace)); asm("popa"); asm("jmp *%0" : : "m"(Original_Perform_Trace_Caller)); } \ No newline at end of file diff --git a/Play_Footstep_Sound.hpp b/Play_Footstep_Sound.hpp index eea4f67..0a9f258 100755 --- a/Play_Footstep_Sound.hpp +++ b/Play_Footstep_Sound.hpp @@ -2,7 +2,7 @@ void* Original_Play_Footstep_Sound_Caller; void __thiscall Redirected_Play_Footstep_Sound(void* Unknown_Parameter_1, void* Unknown_Parameter_2, void* Unknown_Parameter_3, void* Unknown_Parameter_4, void* Unknown_Parameter_5, void* Unknown_Parameter_6) { - void* Prediction = *(void**)((unsigned __int32)Engine_Module + 5171076); + void* Prediction = (void*)((unsigned __int32)Client_Module + 8072728); if (*(__int8*)((unsigned __int32)Prediction + 8) == 1) { diff --git a/Post_Network_Data_Received.hpp b/Post_Network_Data_Received.hpp index 709a523..8c2f18e 100755 --- a/Post_Network_Data_Received.hpp +++ b/Post_Network_Data_Received.hpp @@ -31,19 +31,30 @@ struct Prediction_Copy_Structure { using Construct_Type = void(__fastcall*)(void* Prediction_Copy, void* Unknown_Parameter, __int32 Type, void* Destination, __int8 Destination_Packed, void* Source, __int8 Source_Packed, __int32 Operation_Type, void* Handler); - Construct_Type((unsigned __int32)Client_Module + 1564336)(this, nullptr, 2, Destination, 1, Source, 0, 3, Handler); + Construct_Type((unsigned __int32)Client_Module + 1564512)(this, nullptr, 2, Destination, 1, Source, 0, 3, Handler); } }; Prediction_Copy_Structure Predicton_Copy; -void Predicton_Copy_Compare(void* Unknown_Parameter_1, char* Name, void* Unknown_Parameter_3, void* Unknown_Parameter_4, void* Unknown_Parameter_5, void* Unknown_Parameter_6, __int8 Within_Tolerance, void* Unknown_Parameter_7) +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); - - 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])); + 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])); + } } } @@ -64,9 +75,9 @@ void* Original_Post_Network_Data_Received_Caller; void __thiscall Redirected_Post_Network_Data_Received(void* Unknown_Parameter, __int32 Commands_Acknowledged) { - void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7490392); + void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712); - void* Result = *(void**)((unsigned __int32)Local_Player + 900 + (150 - Commands_Acknowledged * 150 % -~150) * 4); + void* Result = *(void**)((unsigned __int32)Local_Player + 900 + (150 - ((Commands_Acknowledged - 1) % 150 + 1) * 150 % -~150) * 4); if (Result != nullptr) { @@ -74,7 +85,7 @@ void __thiscall Redirected_Post_Network_Data_Received(void* Unknown_Parameter, _ 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 + 1573568)(&Predicton_Copy, nullptr, -1, (Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7228288)); + Transfer_Data_Type((unsigned __int32)Client_Module + 1573744)(&Predicton_Copy, nullptr, -1, (Prediction_Descriptor_Structure*)((unsigned __int32)Client_Module + 7236480)); } (decltype(&Redirected_Post_Network_Data_Received)(Original_Post_Network_Data_Received_Caller))(Unknown_Parameter, Commands_Acknowledged); diff --git a/Process_Movement.hpp b/Process_Movement.hpp new file mode 100644 index 0000000..4e0db37 --- /dev/null +++ b/Process_Movement.hpp @@ -0,0 +1,32 @@ +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) + { + 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) |= 4u; + } + + *(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); + } +} \ No newline at end of file diff --git a/README.md b/README.md index 1aefc97..89fb972 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ -placeholder for l4d2 project (code is hidden until finished) -> [!NOTE] -> some parts of code are published for moment my hdd is dysfunctional +to achieve least interpolation time `cl_updaterate -1;cl_interp_ratio 0;cl_interp 0` +``` +code: https://github.com/qwertyuiop3/Storm + +credits: +me (for something) +noop (for being helpful, specifically on debugging and reversing) +d3x (for telling me that i don't have to bruteforce prediction frame) +polak (for strafe deltas) +ucuser0 (for his post regarding backup commands) +kamay (for crossproducts of movement) +deniz (for being friend) + +songs: +david bowie - art decade +scratch acid - cannibal + +edited by "obviously who" +``` \ No newline at end of file diff --git a/Read_Packets.hpp b/Read_Packets.hpp index 7e940d9..722d645 100755 --- a/Read_Packets.hpp +++ b/Read_Packets.hpp @@ -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 + 1631103); + Parsed_Packets = __builtin_return_address(0) != (void*)((unsigned __int32)Engine_Module + 1631551); } \ No newline at end of file diff --git a/Run_Command.hpp b/Run_Command.hpp new file mode 100644 index 0000000..142044c --- /dev/null +++ b/Run_Command.hpp @@ -0,0 +1,36 @@ +struct Command_Structure +{ + __int8 Additional_Bytes_1[4]; + + __int32 Command_Number; + + __int32 Tick_Number; + + float Angles[3]; + + float Move[3]; + + __int32 Buttons; + + __int8 Additional_Bytes_2[9]; + + __int32 Random_Seed; +}; + +struct Extended_Command_Structure +{ + __int32 Extra_Commands; +}; + +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) +{ + Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Command_Number % 150]; + + *(__int32*)((unsigned __int32)Player + 5324) -= Extended_Command->Extra_Commands; + + (decltype(&Redirected_Run_Command)(Original_Run_Command_Caller))(Prediction, Player, Command, Unknown_Parameter); +} \ No newline at end of file diff --git a/Send_Move.hpp b/Send_Move.hpp new file mode 100644 index 0000000..b1e99a6 --- /dev/null +++ b/Send_Move.hpp @@ -0,0 +1,70 @@ +void Redirected_Send_Move() +{ + struct Message_Structure + { + __int8 Message[160]; + + void Construct(__int8* Data, unsigned __int32 Size) + { + Byte_Manager::Set_Bytes(0, Message, sizeof(Message), 0); + + *(void**)Message = (void*)((unsigned __int32)Engine_Module + 3501348); + + *(void**)((unsigned __int32)Message + 132) = Data; + + *(__int32*)((unsigned __int32)Message + 136) = Size; + + *(__int32*)((unsigned __int32)Message + 140) = Size * 8; + } + }; + + Message_Structure Message; + + __int8 Data[4000]; + + Message.Construct(Data, sizeof(Data)); + + void* Client = *(void**)((unsigned __int32)Engine_Module + 4352236); + + __int32 Choked_Commands = *(__int32*)((unsigned __int32)Client + 19024); + + __int32 Commands_Queue = min(Choked_Commands + 1, 15); + + *(__int32*)((unsigned __int32)&Message + 88) = Commands_Queue; + + __int32 Extra_Commands_Queue = Choked_Commands + 1 - Commands_Queue; + + __int32 Backup_Commands = min(Extra_Commands_Queue, 7); + + *(__int32*)((unsigned __int32)&Message + 84) = Backup_Commands; + + __int32 From_Command_Number = -1; + + __int32 Next_Command_Number = *(__int32*)((unsigned __int32)Client + 19020) + Choked_Commands + 2; + + __int32 To_Command_Number = Next_Command_Number - Commands_Queue - Backup_Commands; + + Write_Command_Label: + { + using Write_Command_Type = __int8(__thiscall*)(void* Client, void* Unknown_Parameter_1, void* Data, __int32 From, __int32 To, void* Unknown_Parameter_2); + + Write_Command_Type((unsigned __int32)Client_Module + 691088)(*(void**)((unsigned __int32)Engine_Module + 5171072), nullptr, (void*)((unsigned __int32)&Message + 132), From_Command_Number, To_Command_Number, nullptr); + + From_Command_Number = To_Command_Number; + + To_Command_Number += 1; + + if (To_Command_Number != Next_Command_Number) + { + goto Write_Command_Label; + } + } + + void* Network_Channel = *(void**)(*(unsigned __int32*)((unsigned __int32)Engine_Module + 4352236) + 24); + + *(__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); + + (*Send_Network_Message_Type(*(unsigned __int32*)Network_Channel + 164))(Network_Channel, &Message, nullptr, nullptr); +} \ No newline at end of file diff --git a/Spawn_Grenade.hpp b/Spawn_Grenade.hpp index 8a41b0f..fb3b1ef 100755 --- a/Spawn_Grenade.hpp +++ b/Spawn_Grenade.hpp @@ -2,24 +2,26 @@ void* Original_Spawn_Grenade_Caller; void __thiscall Redirected_Spawn_Grenade(void* Entity) { + *(__int32*)((unsigned __int32)Entity + 228) = 3; + using Set_Size_Type = void(__thiscall*)(void* Entity, float* Minimum, float* Maximum); float Minimum[3] = { - -4, + -16, - -4, + -16, - -4 + -16 }; float Maximum[3] = { - 4, + 16, - 4, + 16, - 4 + 16 }; Set_Size_Type((unsigned __int32)Client_Module + 281664)(Entity, Minimum, Maximum); diff --git a/Storm.vcxproj b/Storm.vcxproj new file mode 100644 index 0000000..fc21b23 --- /dev/null +++ b/Storm.vcxproj @@ -0,0 +1,112 @@ + + + + + Release + Win32 + + + + 16.0 + Win32Proj + {9e56cc0a-5a40-4957-8031-ab3cc4108170} + Storm + 10.0 + + + + DynamicLibrary + false + ClangCL + true + Unicode + + + + + + + + + + + false + false + .cpl + + + false + + + + true + true + false + _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) + true + stdcpplatest + $(ProjectDir);%(AdditionalIncludeDirectories) + None + MaxSpeed + AnySuitable + Speed + true + false + StreamingSIMDExtensions2 + Fast + /Zc:threadSafeInit- /clang:-fno-unwind-tables -Wno-multichar -Wno-microsoft-goto %(AdditionalOptions) + true + false + false + false + false + Level3 + true + + + Windows + true + true + false + %(AdditionalLibraryDirectories) + false + + + + + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Storm.vcxproj.filters b/Storm.vcxproj.filters new file mode 100644 index 0000000..79f07ae --- /dev/null +++ b/Storm.vcxproj.filters @@ -0,0 +1,92 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + + + C++ + + + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + Header++ + + + \ No newline at end of file diff --git a/Update.hpp b/Update.hpp new file mode 100644 index 0000000..f39b516 --- /dev/null +++ b/Update.hpp @@ -0,0 +1,6 @@ +void* Original_Update_Caller; + +void __thiscall Redirected_Update(void* Unknown_Parameter_1, void* Unknown_Parameter_2, void* Unknown_Parameter_3, __int32 Incoming_Sequence_Number, int Outgoing_Sequence_Number) +{ + (decltype(&Redirected_Update)(Original_Update_Caller))(Unknown_Parameter_1, Unknown_Parameter_2, Unknown_Parameter_3, Incoming_Sequence_Number, Incoming_Sequence_Number + (Outgoing_Sequence_Number - Incoming_Sequence_Number) % 150); +} \ No newline at end of file diff --git a/Update_Animations.hpp b/Update_Animations.hpp new file mode 100644 index 0000000..91b693a --- /dev/null +++ b/Update_Animations.hpp @@ -0,0 +1,45 @@ +float Update_Animation_Time; + +__int8 Update_Animation_Type; + +void __cdecl Redirected_Update_Animations() +{ + Global_Variables_Structure* Global_Variables = *(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744); + + float Previous_Current_Time = Global_Variables->Current_Time; + + Global_Variables->Current_Time = Update_Animation_Time; + + float Previous_Frame_Time = Global_Variables->Frame_Time; + + Global_Variables->Frame_Time = Global_Variables->Interval_Per_Tick * Update_Animation_Type; + + __int32 Entity_Number = 0; + + Traverse_Animation_List_Label: + { + if (Entity_Number != *(__int32*)((unsigned __int32)Client_Module + 7479624)) + { + void* Animation_List = *(void**)((unsigned __int32)Client_Module + 7479612); + + if ((*(__int8*)((unsigned __int32)Animation_List + 8 * Entity_Number + 4) & 1) != 0) + { + void* Entity = *(void**)((unsigned __int32)Animation_List + 8 * Entity_Number); + + *(float*)((unsigned __int32)Entity + 328) = Update_Animation_Time - Global_Variables->Frame_Time; + + using Update_Animation_Type = void(__thiscall**)(void* Entity); + + (*Update_Animation_Type(*(unsigned __int32*)Entity + 808))(Entity); + } + + Entity_Number += 1; + + goto Traverse_Animation_List_Label; + } + } + + Global_Variables->Frame_Time = Previous_Frame_Time; + + Global_Variables->Current_Time = Previous_Current_Time; +} \ No newline at end of file