wip tf2 stuff post 2024-04-18

This commit is contained in:
rtldg 2024-04-19 18:08:41 +00:00
parent 66c730a897
commit 7ce6233cf4
2 changed files with 33 additions and 6 deletions

View File

@ -1,6 +1,6 @@
"Games"
{
// A guide to find most of these signatures and offsets: https://www.youtube.com/watch?v=ekyLf6hu4qI
// A guide to find most of these signatures and offsets: https://www.youtube.com/watch?v=ekyLf6hu4qI and another https://www.youtube.com/watch?v=J7eHgK_UYOk
"#default"
{
@ -331,9 +331,10 @@
{
// search string: "BumperCar.Jump" to find CTFGameMovement::CheckJumpButton.
// Then the call to PreventBunnyJumping is right above the string reference somewhere...
// Update 2024-04-18: This fucking bitch got inlined on Windows so this signature is now to the first jump instruction of it to gtfo of doing the velocity stuff. https://i.imgur.com/LDq6Ubo.png
"CTFGameMovement::PreventBunnyJumping"
{
"windows" "\x56\x8B\xF1\x6A\x52\x8B\x8E\x2A\x2A\x2A\x2A\x81\xC1\xE0\x1A\x00\x00\xE8\x2A\x2A\x2A\x2A\x84\xC0\x75"
"windows" "\x75\x2A\x8B\x47\x2A\x8D\x77\x2A\x0F\x57\xC0"
"linux" "@_ZN15CTFGameMovement19PreventBunnyJumpingEv"
}
// search string: "Usage: setang_exact pitch yaw" to find setang_exact's handler. Then the last function call in the handler is DoAnimationEvent.
@ -358,13 +359,13 @@
// Find PhysicsCheckForEntityUntouch by checking the functions that call PhysicsRemoveToucher.
"PhysicsCheckForEntityUntouch"
{
"windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\x8B\x86\x2A\x2A\x2A\x2A\xD1\xE8\xA8\x01"
"windows" "\x55\x8B\xEC\x83\xEC\x08\x57\x8B\xF9\x8B\x87\x2A\x2A\x2A\x2A\xD1\xE8"
"linux" "@_ZN11CBaseEntity28PhysicsCheckForEntityUntouchEv"
}
// search string: "scoreboard_minigame"
"CTFGameRules::CalcPlayerScore"
{
"windows" "\x55\x8B\xEC\x56\x8B\x75\x2A\x85\xF6\x75\x2A\x33\xC0\x5E\x5D\xC3\x8B\x56"
"windows" "\x55\x8B\xEC\x57\x8B\x7D\x2A\x85\xFF\x75\x2A\x33\xC0\x5F\x5D\xC3\x8B\x57"
"linux" "@_ZN12CTFGameRules15CalcPlayerScoreEP12RoundStats_tP9CTFPlayer"
}
// search string: "remove 0x%p: %s-%s (%d-%d) [%d in play, %d max]\n".

View File

@ -58,6 +58,7 @@ bool gB_Protobuf = false;
// hook stuff
DynamicHook gH_AcceptInput; // used for hooking player_speedmod's AcceptInput
DynamicHook gH_TeleportDhook = null;
Address gI_TF2PreventBunnyJumpingAddr = Address_Null;
// database handle
Database gH_SQL = null;
@ -115,6 +116,7 @@ Cookie gH_IHateMain = null;
// late load
bool gB_Late = false;
bool gB_Linux = false;
// modules
bool gB_Eventqueuefix = false;
@ -530,7 +532,9 @@ void LoadDHooks()
DHookAddParam(processMovementPost, HookParamType_ObjectPtr);
DHookRaw(processMovementPost, true, IGameMovement);
if (gEV_Type == Engine_TF2)
gB_Linux = GameConfGetOffset(gamedataConf, "OS") == 2;
if (gEV_Type == Engine_TF2 && gB_Linux)
{
Handle PreventBunnyJumping = DHookCreateDetour(Address_Null, CallConv_THISCALL, ReturnType_Void, ThisPointer_Ignore);
@ -544,6 +548,20 @@ void LoadDHooks()
SetFailState("Failed to find CTFGameMovement::PreventBunnyJumping signature");
}
}
else if (gEV_Type == Engine_TF2 && !gB_Linux)
{
gI_TF2PreventBunnyJumpingAddr = GameConfGetAddress(gamedataConf, "CTFGameMovement::PreventBunnyJumping");
if (gI_TF2PreventBunnyJumpingAddr == Address_Null)
{
SetFailState("Failed to find CTFGameMovement::PreventBunnyJumping signature");
}
else
{
// Write the original JNZ byte but with updateMemAccess=true so we don't repeatedly page-protect it later.
StoreToAddress(gI_TF2PreventBunnyJumpingAddr, 0x75, NumberType_Int8, true);
}
}
LoadPhysicsUntouch(gamedataConf);
@ -3062,6 +3080,14 @@ public MRESReturn DHook_ProcessMovement(Handle hParams)
int client = DHookGetParam(hParams, 1);
gI_ClientProcessingMovement = client;
if (gI_TF2PreventBunnyJumpingAddr != Address_Null)
{
if (GetStyleSettingBool(gA_Timers[client].bsStyle, "bunnyhopping"))
StoreToAddress(gI_TF2PreventBunnyJumpingAddr, 0xEB, NumberType_Int8, false); // jmp
else
StoreToAddress(gI_TF2PreventBunnyJumpingAddr, 0x75, NumberType_Int8, false); // jnz
}
// Causes client to do zone touching in movement instead of server frames.
// From https://github.com/rumourA/End-Touch-Fix
MaybeDoPhysicsUntouch(client);
@ -3753,7 +3779,7 @@ void TestAngles(int client, float dirangle, float yawdelta, const float vel[3])
gA_Timers[client].iGoodGains++;
}
}
// backwards
else if(dirangle > 157.5 || dirangle < 202.5)
{