| 506 | } |
| 507 | |
| 508 | void LibraryManager::FindStatusTypesEoCApp() |
| 509 | { |
| 510 | Pattern p; |
| 511 | p.FromString( |
| 512 | "45 33 C9 " // xor r9d, r9d |
| 513 | "48 8D 15 XX XX XX XX " // lea rdx, fsx_TargetDependentHeal |
| 514 | "48 8B CB " // mov rcx, rbx |
| 515 | "FF 90 B0 01 00 00 " // call qword ptr [rax+1B0h] |
| 516 | ); |
| 517 | |
| 518 | Pattern p2; |
| 519 | p2.FromString( |
| 520 | "48 89 5C 24 10 " // mov [rsp-8+arg_8], rbx |
| 521 | "48 89 74 24 18 " // mov [rsp-8+arg_10], rsi |
| 522 | ); |
| 523 | |
| 524 | p.Scan(moduleStart_, moduleSize_, [this, &p2](const uint8_t * match) { |
| 525 | auto fsx = AsmLeaToAbsoluteAddress(match + 3); |
| 526 | if (IsFixedStringRef(fsx, "TargetDependentHeal")) { |
| 527 | p2.Scan(match - 0x200, 0x200, [this](const uint8_t * match) { |
| 528 | // Look for this function ptr |
| 529 | auto ptr = (uint64_t)match; |
| 530 | for (auto p = moduleStart_; p < moduleStart_ + moduleSize_; p += 8) { |
| 531 | if (*reinterpret_cast<uint64_t const *>(p) == ptr) { |
| 532 | StatusHealVMT = reinterpret_cast<esv::StatusVMT const *>(p - 25 * 8); |
| 533 | } |
| 534 | } |
| 535 | }); |
| 536 | } |
| 537 | }); |
| 538 | |
| 539 | if (StatusHealVMT == nullptr) { |
| 540 | Debug("LibraryManager::FindStatusTypesEoCApp(): Could not find esv::StatusHeal"); |
| 541 | InitFailed = true; |
| 542 | } |
| 543 | |
| 544 | Pattern p3; |
| 545 | p3.FromString( |
| 546 | "4C 8D 0D XX XX XX XX " // lea r9, fsx_Dummy_BodyFX |
| 547 | "48 8D 15 XX XX XX XX " // lea rdx, fsx_RS3_FX_GP_Status_Retaliation_Beam_01 |
| 548 | "E8 XX XX XX XX " // call esv__EffectFactory__CreateEffectWrapper |
| 549 | "48 8B D8 " // mov rbx, rax |
| 550 | ); |
| 551 | |
| 552 | Pattern p4; |
| 553 | p4.FromString( |
| 554 | "40 55 " // push rbp |
| 555 | "41 54 " // push r12 |
| 556 | "41 55 " // push r13 |
| 557 | "41 57 " // push r15 |
| 558 | ); |
| 559 | |
| 560 | p3.Scan(moduleStart_, moduleSize_, [this, &p4](const uint8_t * match) { |
| 561 | auto fsx = AsmLeaToAbsoluteAddress(match + 7); |
| 562 | if (IsFixedStringRef(fsx, "RS3_FX_GP_Status_Retaliation_Beam_01")) { |
| 563 | p4.Scan(match - 0xa00, 0xa00, [this](const uint8_t * match) { |
| 564 | // Look for this function ptr |
| 565 | auto ptr = (uint64_t)match; |
nothing calls this directly
no test coverage detected