| 236 | } |
| 237 | |
| 238 | void LibraryManager::FindGlobalStringTableEoCApp() |
| 239 | { |
| 240 | static uint8_t const sig1[] = { |
| 241 | 0xB9, 0x88, 0xFA, 0x5F, 0x00, // mov ecx, 5FFA88h |
| 242 | 0xE8, // call xxx |
| 243 | }; |
| 244 | |
| 245 | static uint8_t const sig2[] = { |
| 246 | 0x48, 0x85, 0xC0, // test rax, rax |
| 247 | 0x74, 0x14, // jz xxx |
| 248 | 0x48, 0x8B, 0xC8, // mov rcx, rax |
| 249 | 0xE8, // call xxx |
| 250 | }; |
| 251 | |
| 252 | static uint8_t const sig3[] = { |
| 253 | 0x48, 0x89, 0x05 // mov xxx, rax |
| 254 | }; |
| 255 | |
| 256 | uint8_t const * p = (uint8_t const *)moduleStart_; |
| 257 | uint8_t const * moduleEnd = p + moduleSize_; |
| 258 | |
| 259 | for (; p < moduleEnd - 100; p++) { |
| 260 | if (*p == 0xB9 |
| 261 | && memcmp(p, sig1, sizeof(sig1)) == 0 |
| 262 | && memcmp(p + 10, sig2, sizeof(sig2)) == 0 |
| 263 | && memcmp(p + 23, sig3, sizeof(sig3)) == 0) { |
| 264 | int32_t rel = *(int32_t *)(p + 26); |
| 265 | |
| 266 | GlobalStrings = (GlobalStringTable const **)(p + rel + 23 + 7); |
| 267 | GlobalStringTable::UseMurmur = true; |
| 268 | break; |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | if (GlobalStrings == nullptr) { |
| 273 | Debug("LibraryManager::FindGlobalStringTableEoCApp(): Could not find global string table"); |
| 274 | CriticalInitFailed = true; |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | void LibraryManager::FindGameActionManagerEoCApp() |
| 279 | { |