| 579 | } |
| 580 | |
| 581 | void LibraryManager::FindHitFuncsEoCApp() |
| 582 | { |
| 583 | Pattern p; |
| 584 | p.FromString( |
| 585 | "74 74 " // jz short loc_141A3EED4 |
| 586 | "48 8B 00 " // mov rax, [rax] |
| 587 | "48 8D 15 XX XX XX XX " // lea rdx, fs_DamageItems |
| 588 | "48 8B CE " // mov rcx, rsi |
| 589 | "FF 50 28 " // call qword ptr [rax+28h] |
| 590 | ); |
| 591 | |
| 592 | Pattern p2; |
| 593 | p2.FromString( |
| 594 | "C7 44 24 20 05 00 00 00 " // mov dword ptr [rsp+140h+var_120], 5 |
| 595 | "44 89 65 50 " // mov [rbp+40h+arg_0], r12d |
| 596 | "E8 XX XX XX XX " // call esv__Character__Hit |
| 597 | "4C 8B AE A0 01 00 00 " // mov r13, [rsi+1A0h] |
| 598 | "EB 5F " // jmp short xxx |
| 599 | ); |
| 600 | |
| 601 | p.Scan(moduleStart_, moduleSize_, [this, &p2](const uint8_t * match) { |
| 602 | auto fsx = AsmLeaToAbsoluteAddress(match + 5); |
| 603 | if (IsFixedStringRef(fsx, "DamageItems")) { |
| 604 | p2.Scan(match, 0x400, [this](const uint8_t * match) { |
| 605 | auto actionAddr = AsmCallToAbsoluteAddress(match + 12); |
| 606 | CharacterHit = (esv::Character__Hit)actionAddr; |
| 607 | }); |
| 608 | } |
| 609 | }); |
| 610 | |
| 611 | if (CharacterHit == nullptr) { |
| 612 | Debug("LibraryManager::FindHitFuncsEoCApp(): Could not find Character::Hit"); |
| 613 | InitFailed = true; |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | void LibraryManager::FindItemFuncsEoCApp() |
| 618 | { |
nothing calls this directly
no test coverage detected