2022-05-27 08:15:03 -04:00
|
|
|
#include <STDInclude.hpp>
|
2022-12-26 07:07:24 -05:00
|
|
|
#include "Ceg.hpp"
|
2022-05-27 08:15:03 -04:00
|
|
|
|
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
Ceg::Ceg()
|
|
|
|
{
|
2022-07-04 15:09:26 -04:00
|
|
|
Utils::Hook::Signature signature(0x401000, 0x340000);
|
2022-05-27 08:15:03 -04:00
|
|
|
|
|
|
|
// Generic killer caller.
|
|
|
|
signature.add({
|
|
|
|
"\x56\x8B\x00\x24\x0c\x85\xF6\x7F\x0E", "xx?xxxxxx", [](char* address)
|
|
|
|
{
|
2022-11-07 19:19:17 -05:00
|
|
|
Utils::Hook::Set<std::uint8_t>(address, 0xC3);
|
2022-05-27 08:15:03 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
signature.process();
|
|
|
|
|
|
|
|
// Some more generic obfuscation (mov al, 1; retn)
|
2022-11-07 19:19:17 -05:00
|
|
|
Utils::Hook::Set<std::uint32_t>(0x471B20, 0xC301B0);
|
|
|
|
Utils::Hook::Set<std::uint32_t>(0x43A070, 0xC301B0);
|
|
|
|
Utils::Hook::Set<std::uint32_t>(0x4C8B30, 0xC301B0);
|
|
|
|
Utils::Hook::Set<std::uint32_t>(0x469340, 0xC301B0);
|
2022-05-27 08:15:03 -04:00
|
|
|
|
|
|
|
// Other checks
|
2022-11-07 19:19:17 -05:00
|
|
|
Utils::Hook::Set<std::uint32_t>(0x401000, 0xC301B0);
|
|
|
|
Utils::Hook::Set<std::uint32_t>(0x45F8B0, 0xC301B0);
|
|
|
|
Utils::Hook::Set<std::uint32_t>(0x46FAE0, 0xC301B0);
|
2022-05-27 08:15:03 -04:00
|
|
|
|
|
|
|
// Removed in 159 SP binaries
|
|
|
|
Utils::Hook::Nop(0x46B173, 9);
|
|
|
|
Utils::Hook::Nop(0x43CA16, 9);
|
|
|
|
Utils::Hook::Nop(0x505426, 9);
|
|
|
|
|
2023-01-11 10:30:20 -05:00
|
|
|
// Removed on IW5 MP (Unprotected) but present on IW5 SP (protected) - CEG uninitialization / Steam Shutdown
|
2023-01-11 10:19:42 -05:00
|
|
|
Utils::Hook::Set<std::uint8_t>(0x4F6370, 0xC3);
|
|
|
|
|
2022-06-05 05:45:50 -04:00
|
|
|
// Disable some checks on certain game events
|
|
|
|
Utils::Hook::Nop(0x43EC96, 9);
|
|
|
|
Utils::Hook::Nop(0x4675C6, 9);
|
2022-10-10 09:07:42 -04:00
|
|
|
Utils::Hook::Nop(0x405A36, 9);
|
2022-06-05 05:45:50 -04:00
|
|
|
|
2022-05-27 08:15:03 -04:00
|
|
|
// Random checks scattered throughout the binary
|
2022-11-07 19:19:17 -05:00
|
|
|
Utils::Hook::Set<std::uint8_t>(0x499F90, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x4FC700, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x4C4170, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x49E8C0, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x42DB00, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x4F4CF0, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x432180, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x461930, 0xC3);
|
|
|
|
Utils::Hook::Set<std::uint8_t>(0x430410, 0xC3);
|
2022-07-05 12:43:24 -04:00
|
|
|
|
2022-09-01 10:54:28 -04:00
|
|
|
// Used next to file system functions
|
2022-11-07 19:19:17 -05:00
|
|
|
Utils::Hook::Set<std::uint8_t>(0x47BC00, 0xC3);
|
2022-09-01 10:54:28 -04:00
|
|
|
|
2022-07-05 12:43:24 -04:00
|
|
|
// Looking for stuff in the registry
|
|
|
|
Utils::Hook::Nop(0x4826F8, 5);
|
2022-07-08 12:40:09 -04:00
|
|
|
|
|
|
|
// Live_Init
|
|
|
|
Utils::Hook::Nop(0x420937, 5);
|
2022-05-27 08:15:03 -04:00
|
|
|
}
|
|
|
|
}
|