| 577 | |
| 578 | |
| 579 | void LibraryManager::FindHitFuncsEoCPlugin() |
| 580 | { |
| 581 | Pattern p; |
| 582 | p.FromString( |
| 583 | "4C 89 XX 24 18 01 00 00 " // mov [rsp+150h+var_38], r15 |
| 584 | "E8 XX XX XX XX " // call eoc__StatusPrototype__GetMappedValue |
| 585 | "85 C0 " // test eax, eax |
| 586 | "48 8D 15 XX XX XX XX " // lea rdx, fsx_DamageItems |
| 587 | "48 8B CB " // mov rcx, rbx |
| 588 | "40 0F 95 C7 " // setnz dil |
| 589 | ); |
| 590 | |
| 591 | Pattern p2; |
| 592 | p2.FromString( |
| 593 | "48 89 44 24 30 " // mov qword ptr [rsp+150h+a7], rax |
| 594 | "C6 44 24 28 00 " // mov byte ptr [rsp+150h+a6], 0 |
| 595 | "C7 44 24 20 05 00 00 00 " // mov [rsp+150h+a5], 5 |
| 596 | "E8 XX XX XX XX " // call esv__Character__Hit |
| 597 | "XX 8B XX B0 01 00 00 " // mov r13, [r15+1B0h] |
| 598 | "EB 66 " // jmp short xxx |
| 599 | ); |
| 600 | |
| 601 | p.Scan(moduleStart_, moduleSize_, [this, &p2](const uint8_t * match) { |
| 602 | auto fsx = AsmLeaToAbsoluteAddress(match + 15); |
| 603 | if (IsFixedStringRef(fsx, "DamageItems")) { |
| 604 | p2.Scan(match, 0x300, [this](const uint8_t * match) { |
| 605 | auto actionAddr = AsmCallToAbsoluteAddress(match + 18); |
| 606 | CharacterHit = (esv::Character__Hit)actionAddr; |
| 607 | }); |
| 608 | } |
| 609 | }); |
| 610 | |
| 611 | if (CharacterHit == nullptr) { |
| 612 | Debug("LibraryManager::FindHitFuncsEoCPlugin(): Could not find Character::Hit"); |
| 613 | InitFailed = true; |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | void LibraryManager::FindItemFuncsEoCPlugin() |
| 618 | { |
nothing calls this directly
no test coverage detected