| 780 | |
| 781 | |
| 782 | void LibraryManager::FindCharacterStatFuncsEoCApp() |
| 783 | { |
| 784 | memset(&StatsGetters.Ptrs, 0, sizeof(StatsGetters.Ptrs)); |
| 785 | |
| 786 | Pattern p; |
| 787 | p.FromString( |
| 788 | "40 84 ED " // test bpl, bpl |
| 789 | "74 08 " // jz short loc_141C7A428 |
| 790 | "8B 86 44 03 00 00 " // mov eax, [rsi+344h] |
| 791 | "EB 06 " // jmp short loc_141C7A42E |
| 792 | "8B 86 40 03 00 00 " // mov eax, [rsi+340h] |
| 793 | "40 0F B6 D5 " // movzx edx, bpl |
| 794 | "89 43 44 " // mov [rbx+44h], eax |
| 795 | ); |
| 796 | |
| 797 | uint8_t const * gettersStart{ nullptr }; |
| 798 | p.Scan(moduleStart_, moduleSize_, [&gettersStart](const uint8_t * match) { |
| 799 | gettersStart = match; |
| 800 | }, false); |
| 801 | |
| 802 | if (gettersStart != nullptr) { |
| 803 | unsigned ptrIndex = 0; |
| 804 | for (auto p = gettersStart; p < gettersStart + 0x240; p++) { |
| 805 | auto insn = *reinterpret_cast<uint32_t const *>(p); |
| 806 | if (insn == 0xE8CE8B48 /* 48 8B CE E8 -- mov rcx, rsi; call */ |
| 807 | || insn == 0xE8084389 /* 89 43 08 E8 -- mov [rbx+8], eax; call */) { |
| 808 | if (ptrIndex < std::size(StatsGetters.Ptrs)) { |
| 809 | auto ptr = AsmCallToAbsoluteAddress(p + 3); |
| 810 | StatsGetters.Ptrs[ptrIndex++] = (void *)ptr; |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | if (StatsGetters.Funcs.GetUnknown == nullptr) { |
| 817 | Debug("LibraryManager::FindCharacterStatFuncsEoCApp(): Could not find all stat getters"); |
| 818 | InitFailed = true; |
| 819 | } |
| 820 | } |
| 821 | } |
| 822 | #endif |
nothing calls this directly
no test coverage detected