MCPcopy Create free account
hub / github.com/Norbyte/ositools / FindGameActionManagerEoCPlugin

Method FindGameActionManagerEoCPlugin

OsiInterface/DataLibrariesEoCPlugin.cpp:260–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 }
259
260 void LibraryManager::FindGameActionManagerEoCPlugin()
261 {
262 Pattern p;
263 p.FromString(
264 "48 8D 15 XX XX XX XX " // lea rdx, fsx_GameAction
265 "4C 8B 05 XX XX XX XX " // mov r8, cs:xxx
266 "48 8B CF " // mov rcx, rdi
267 "FF 90 80 00 00 00 " // call qword ptr [rax+80h]
268 "84 C0 " // test al, al
269 "0F 84 XX 00 00 00 " // jz xxx
270 "49 8B D6 " // mov rdx, r14
271 "48 8D 4D FF " // lea rcx, [rbp+57h+Memory]
272 "E8 XX XX XX XX " // call xxx
273 "45 84 E4 " // test r12b, r12b
274 "74 XX " // jz short xxx
275 "49 8B D6 " // mov rdx, r14
276 "48 8D 4D FF " // lea rcx, [rbp+57h+Memory]
277 "48 8B D8 " // mov rbx, rax
278 "E8 XX XX XX XX " // call xxx
279 "4C 8B 03 " // mov r8, [rbx]
280 "49 8B CD " // mov rcx, r13
281 "8B 50 08 " // mov edx, [rax+8]
282 "E8 XX XX XX XX " // call esv__GameActionManager__CreateAction
283 );
284
285 p.Scan(moduleStart_, moduleSize_, [this](const uint8_t * match) {
286 auto fsx = AsmLeaToAbsoluteAddress(match);
287 if (IsFixedStringRef(fsx, "GameAction")) {
288 auto actionAddr = AsmCallToAbsoluteAddress(match + 72);
289 CreateGameAction = (esv::GameActionManager__CreateAction)actionAddr;
290 }
291 });
292
293 if (CreateGameAction == nullptr) {
294 Debug("LibraryManager::FindGameActionManagerEoCPlugin(): Could not find GameActionManager::CreateAction");
295 InitFailed = true;
296 }
297
298 Pattern p2;
299 p2.FromString(
300 "41 83 C8 FF " // or r8d, 0FFFFFFFFh
301 "48 8D 15 XX XX XX XX " // lea rdx, fsx_ForceMove
302 "48 8B C8 " // mov rcx, rax
303 "E8 XX XX XX XX " // call eoc__SkillPrototype__GetMappedValue
304 "85 C0 " // test eax, eax
305 "75 25 " // jnz short loc_180EE4875
306 "4C 8D 46 70 " // lea r8, [rsi+70h]
307 );
308
309 Pattern p3;
310 p3.FromString(
311 "48 8B 0D XX XX XX XX " // mov rcx, cs:ls__gServerLevelAllocator
312 "48 89 7C 24 50 " // mov [rsp+38h+arg_10], rdi
313 "E8 XX XX XX XX " // call esv__LevelManager__GetGameActionManager
314 "4C 8B 05 XX XX XX XX " // mov r8, cs:xxx
315 "BA 08 00 00 00 " // mov edx, 8
316 "48 8B C8 " // mov rcx, rax
317 "48 8B F8 " // mov rdi, rax

Callers

nothing calls this directly

Calls 5

DebugFunction · 0.85
FromStringMethod · 0.80
ScanMethod · 0.80
AsmLeaToAbsoluteAddressFunction · 0.70
AsmCallToAbsoluteAddressFunction · 0.70

Tested by

no test coverage detected