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

Method FindStatusMachineEoCApp

OsiInterface/DataLibrariesEoCApp.cpp:457–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455 }
456
457 void LibraryManager::FindStatusMachineEoCApp()
458 {
459 Pattern p;
460 p.FromString(
461 "83 7A 1C 00 " // cmp dword ptr [rdx+1Ch], 0
462 "48 8B F2 " // mov rsi, rdx
463 "4C 8B F1 " // mov r14, rcx
464 "0F 8E 8C 00 00 00 " // jle short xxx
465 "4C 8B 05 XX XX XX XX " // mov r8, cs:?Unassigned@ObjectHandle@ls@@2V12@B
466 "48 8D 15 XX XX XX XX " // lea rdx, fs_LIFESTEAL
467 "48 89 5C 24 30 " // mov [rsp+28h+arg_0], rbx
468 "48 89 7C 24 40 " // mov [rsp+28h+arg_10], rdi
469 "48 8B B9 A0 01 00 00 " // mov rdi, [rcx+1A0h]
470 "48 8B CF " // mov rcx, rdi
471 "E8 XX XX XX XX " // call esv__StatusMachine__CreateStatus
472 );
473
474 uint8_t const * lastMatch;
475 p.Scan(moduleStart_, moduleSize_, [this, &lastMatch](const uint8_t * match) {
476 auto fsx = AsmLeaToAbsoluteAddress(match + 23);
477 if (IsFixedStringRef(fsx, "LIFESTEAL")) {
478 auto actionAddr = AsmCallToAbsoluteAddress(match + 50);
479 lastMatch = match + 55;
480 StatusMachineCreateStatus = (esv::StatusMachine__CreateStatus)actionAddr;
481 }
482 });
483
484 if (StatusMachineCreateStatus == nullptr) {
485 Debug("LibraryManager::FindStatusMachineEoCApp(): Could not find StatusMachine::CreateStatus");
486 InitFailed = true;
487 }
488
489 Pattern p2;
490 p2.FromString(
491 "C7 43 2C 00 00 00 00 " // mov dword ptr [rbx+2Ch], 0
492 "48 8B CF " // mov rcx, rdi
493 "E8 XX XX XX XX " // call esv__StatusMachine__ApplyStatus
494 "48 8B 7C 24 40 " // mov rdi, [rsp+28h+arg_10]
495 );
496
497 p2.Scan(lastMatch, 0x100, [this](const uint8_t * match) {
498 auto actionAddr = AsmCallToAbsoluteAddress(match + 10);
499 StatusMachineApplyStatus = (esv::StatusMachine__ApplyStatus)actionAddr;
500 });
501
502 if (StatusMachineApplyStatus == nullptr) {
503 Debug("LibraryManager::FindStatusMachineEoCApp(): Could not find StatusMachine::ApplyStatus");
504 InitFailed = true;
505 }
506 }
507
508 void LibraryManager::FindStatusTypesEoCApp()
509 {

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