Skip to content

Commit

Permalink
OE patterns (most of them).
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Oct 4, 2014
1 parent 54baa9f commit 223a5e3
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spt/OrangeBox/modules/ClientDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void ClientDLL::Hook(const std::wstring& moduleName, HMODULE hModule, uintptr_t
else
{
EngineDevWarning("[client dll] Could not find CHLClient::HudUpdate.\n");
EngineWarning("y_spt_afterframes has no effect.\n");
EngineWarning("_y_spt_afterframes has no effect.\n");
}

// GetButtonBits
Expand Down
21 changes: 20 additions & 1 deletion spt/OrangeBox/modules/EngineDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@ void EngineDLL::Hook(const std::wstring& moduleName, HMODULE hModule, uintptr_t
pM_bLoadgame = (*(bool **)(pSpawnPlayer + 8));
pGameServer = (*(void **)(pSpawnPlayer + 21));
break;

case 4:
pM_bLoadgame = (*(bool **)(pSpawnPlayer + 26));
//pGameServer = (*(void **)(pSpawnPlayer + 21)); - We get this one from SV_ActivateServer in OE.
break;
}

EngineDevMsg("m_bLoadGame is situated at %p.\n", pM_bLoadgame);

#if !defined( OE )
EngineDevMsg("pGameServer is %p.\n", pGameServer);
#endif
}
else
{
Expand All @@ -91,12 +99,23 @@ void EngineDLL::Hook(const std::wstring& moduleName, HMODULE hModule, uintptr_t
{
ORIG_SV_ActivateServer = (_SV_ActivateServer)pSV_ActivateServer;
EngineDevMsg("Found SV_ActivateServer at %p (using the build %s pattern).\n", pSV_ActivateServer, Patterns::ptnsSV_ActivateServer[ptnNumber].build.c_str());

switch (ptnNumber)
{
case 3:
pGameServer = (*(void **)(pSV_ActivateServer + 223));
break;
}

#if defined( OE )
EngineDevMsg("pGameServer is %p.\n", pGameServer);
#endif
}
else
{
EngineDevWarning("Could not find SV_ActivateServer!\n");
EngineWarning("y_spt_pause 2 has no effect.\n");
EngineWarning("y_spt_afterframes_reset_on_server_activate has no effect.\n");
EngineWarning("_y_spt_afterframes_reset_on_server_activate has no effect.\n");
}

// FinishRestore
Expand Down
9 changes: 9 additions & 0 deletions spt/OrangeBox/modules/ServerDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ void ServerDLL::Hook(const std::wstring& moduleName, HMODULE hModule, uintptr_t
off1M_nOldButtons = 2;
off2M_nOldButtons = 40;
break;

case 8:
off1M_nOldButtons = 1;
off2M_nOldButtons = 40;
break;
}
}
else
Expand Down Expand Up @@ -162,6 +167,10 @@ void ServerDLL::Hook(const std::wstring& moduleName, HMODULE hModule, uintptr_t
case 7:
offM_vecAbsVelocity = 532;
break;

case 8:
offM_vecAbsVelocity = 592;
break;
}
}
else
Expand Down
64 changes: 64 additions & 0 deletions spt/OrangeBox/patterns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x14, 0x80, 0x3D, '?', '?', '?', '?', 0x00, 0x56, 0x8B, 0xF1, 0x74, '?', 0x6A, 0x00, 0xB9, '?', '?', '?', '?', 0xE8, '?', '?', '?', '?', 0xEB, 0x1F, 0x8B, 0x0D, '?', '?', '?', '?', 0xFF, 0xB6, '?', '?', '?', '?', 0x8B, 0x01, 0xFF, 0x50, 0x0C, 0xFF, 0xB6, '?', '?', '?', '?', 0xE8, '?', '?', '?', '?', 0x83, 0xC4, 0x04, 0x8B, 0x46, 0x0C, 0x8D, 0x4E, 0x04, 0x40
},
"xxxxxxxx????xxxxx?xxx????x????xxxx????xx????xxxxxxx????x????xxxxxxxxxx"
},

{
"2707",
{
0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x6A, 0xFF, 0x68, '?', '?', '?', '?', 0x50, 0x64, 0x89, 0x25, 0x00, 0x00, 0x00, 0x00, 0x83, 0xEC, 0x14, 0x80, 0x3D, '?', '?', '?', '?', 0x00, 0x56, 0x8B, 0xF1, 0x74, 0x0E, 0x6A, 0x00, 0xB9, '?', '?', '?', '?', 0xE8, '?', '?', '?', '?', 0xEB, 0x21, 0x8B, 0x0D
},
"xxxxxxxxx????xxxxxxxxxxxxx????xxxxxxxxx????x????xxxx"
}
};

Expand Down Expand Up @@ -64,6 +72,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x0C, 0x53, 0x8B, 0x1D, '?', '?', '?', '?', 0x57, 0x68, '?', '?', '?', '?', 0xFF, 0xD3, 0x83, 0xC4, 0x04, 0xE8, '?', '?', '?', '?', 0x6A, 0x0B
},
"xxxxxxxxx????xx????xxxxxx????xx"
},

{
"2707",
{
0x6A, 0xFF, 0x68, '?', '?', '?', '?', 0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x50, 0x64, 0x89, 0x25, 0x00, 0x00, 0x00, 0x00, 0x51, 0x68, '?', '?', '?', '?', 0xE8, '?', '?', '?', '?', 0x83, 0xC4, 0x04, 0xE8, '?', '?', '?', '?', 0x8B, 0x10, 0x6A, 0x0B, 0x8B, 0xC8, 0xFF, 0x92
},
"xxx????xxxxxxxxxxxxxxxx????x????xxxx????xxxxxxxx"
}
};

Expand Down Expand Up @@ -91,6 +107,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x81, 0xEC, 0xA4, 0x06, 0x00, 0x00, 0x33, 0xC0, 0x53, 0x8B, 0xD9, 0x89, 0x85, 0x5C, 0xF9, 0xFF, 0xFF, 0x8D, 0x8D, 0x74, 0xF9, 0xFF, 0xFF
},
"xxxxxxxxxxxxxxxxxxxxxxxxxx"
},

{
"2707",
{
0x55, 0x8B, 0xEC, 0x83, 0xE4, 0xF8, 0x81, 0xEC, 0x8C, 0x06, 0x00, 0x00, 0x55, 0x56, 0x57, 0x8B, 0xE9, 0x80, 0xBD, '?', '?', '?', '?', 0x00, 0x0F, 0x84, 0xC0, 0x00, 0x00, 0x00
},
"xxxxxxxxxxxxxxxxxxx????xxxxxxx"
}
};

Expand Down Expand Up @@ -126,6 +150,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x14, 0x56, 0x8B, 0xF1, 0x8B, 0x06, 0x8B, 0x40, '?', 0xFF, 0xD0, 0x84, 0xC0, 0x74, '?', 0x8B, 0x06, 0x8B, 0xCE, 0x8B, 0x40, '?', 0xFF, 0xD0, 0x84, 0xC0, 0x74, '?', 0x8A, 0x4D, 0x08, 0x33, 0xC0, 0x84, 0xC9, 0x88, 0x4D, 0xFC, 0x6A, 0x00
},
"xxxxxxxxxxxxx?xxxxx?xxxxxx?xxxxx?xxxxxxxxxxxx"
},

{
"2707",
{
0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x6A, 0xFF, 0x68, '?', '?', '?', '?', 0x50, 0x64, 0x89, 0x25, 0x00, 0x00, 0x00, 0x00, 0x83, 0xEC, 0x14, 0x56, 0x8B, 0xF1, 0x8B, 0x06, 0xFF, 0x50, '?', 0x84, 0xC0, 0x74, 0x59, 0x8B, 0x16, 0x8B, 0xCE, 0xFF, 0x52
},
"xxxxxxxxx????xxxxxxxxxxxxxxxxxx?xxxxxxxxxx"
}
};

Expand Down Expand Up @@ -240,6 +272,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x51, 0xA1, '?', '?', '?', '?', 0xF3, 0x0F, 0x10, 0x40, 0x10, 0x56, 0xF3, 0x0F, 0x11, 0x45, 0xFC, 0x83, 0xEC, 0x08, 0x0F, 0x5A, 0xC0, 0xF2, 0x0F, 0x11, 0x04, 0x24, 0xE8, '?', '?', '?', '?', 0x8B, 0xC8
},
"xxxxx????xxxxxxxxxxxxxxxxxxxxxxx????xx"
},

{
"2707",
{
0x51, 0xA1, '?', '?', '?', '?', 0x8B, 0x48, 0x10, 0x89, 0x4C, 0x24, 0x00, 0xE8, '?', '?', '?', '?', 0xD9, 0x44, 0x24, 0x00, 0x83, 0xEC, 0x08, 0xDD, 0x1C, 0x24, 0xE8, '?', '?', '?', '?', 0x8B, 0xC8, 0xE8
},
"xx????xxxxxxxx????xxxxxxxxxxx????xxx"
}
};

Expand Down Expand Up @@ -267,6 +307,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x51, 0x8B, 0x15, '?', '?', '?', '?', 0xB8, 0x00, 0x00, 0x02, 0x00, 0x53, 0x56, 0x33, 0xF6, 0x8B, 0xD9, 0xF6, 0xC2, 0x03, 0xB9, 0xFD, 0xFF, 0xFF, 0xFF, 0x57, 0x0F, 0x45, 0xF0, 0xBF, 0xFC, 0xFF, 0xFF, 0xFF
},
"xxxxxx????xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},

{
"2707",
{
0x51, 0xA0, '?', '?', '?', '?', 0xB2, 0x03, 0x84, 0xC2, 0xC7, 0x44, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xC7, 0x44, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x8B, 0x0D, '?', '?', '?', '?', 0xF7, 0xC1, 0x00, 0x00, 0x02, 0x00
},
"xx????xxxxxxxxxxxxxxxxxxxxxxxx????xxxxxx"
}
};

Expand Down Expand Up @@ -378,6 +426,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x20, 0x56, 0x8B, 0xF1, 0x8B, 0x4E, 0x04, 0x80, 0xB9, 0x44, 0x0A, 0x00, 0x00, 0x00, 0x74, 0x0E, 0x8B, 0x76, 0x08, 0x83, 0x4E, 0x28, 0x02, 0x32, 0xC0, 0x5E, 0x8B, 0xE5, 0x5D, 0xC3, 0xF3, 0x0F, 0x10, 0x89, 0xB0, 0x0D, 0x00, 0x00, 0x0F, 0x57, 0xC0, 0x0F, 0x2E
},
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},

{
"2707",
{
0x83, 0xEC, 0x10, 0x53, 0x56, 0x8B, 0xF1, 0x8B, 0x4E, 0x08, 0x8A, 0x81, '?', '?', '?', '?', 0x84, 0xC0, 0x74, 0x0F, 0x8B, 0x76, 0x04, 0x83, 0x4E, '?', 0x02, 0x5E, 0x32, 0xC0, 0x5B, 0x83, 0xC4, 0x10, 0xC3, 0xD9, 0x81, 0x30, 0x0C, 0x00, 0x00, 0xD8, 0x1D
},
"xxxxxxxxxxxx????xxxxxxxxx?xxxxxxxxxxxxxxxxx"
}
};

Expand Down Expand Up @@ -456,6 +512,14 @@ namespace Patterns
0x55, 0x8B, 0xEC, 0x56, 0x8B, 0x75, 0x08, 0x57, 0x8B, 0xF9, 0x33, 0xC0, 0x88, 0x87, 0xB4, 0x0B, 0x00, 0x00, 0x39, 0x87, 0x58, 0x0A, 0x00, 0x00, 0x75, 0x1B, 0xD9, 0x46, 0x0C, 0xD9, 0x9F, 0x48, 0x0A, 0x00, 0x00, 0xD9, 0x46, 0x10, 0xD9, 0x9F, 0x4C, 0x0A, 0x00, 0x00, 0xD9, 0x46, 0x14, 0xD9
},
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},

{
"2707",
{
0x8B, 0x81, '?', '?', '?', '?', 0x8B, 0x54, 0x24, 0x04, 0x53, 0x33, 0xDB, 0x3B, 0xC3, 0x88, 0x99, 0x2C, 0x0A, 0x00, 0x00, 0x75, 0x1B, 0x8B, 0x42, 0x0C, 0x89, 0x81, 0xFC, 0x08, 0x00, 0x00, 0x8B, 0x42, 0x10, 0x89, 0x81, 0x00, 0x09, 0x00, 0x00, 0x8B, 0x42, 0x14, 0x89, 0x81, 0x04, 0x09, 0x00
},
"xx????xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
};
}

0 comments on commit 223a5e3

Please sign in to comment.