| 128 | } |
| 129 | |
| 130 | static __forceinline PRUNTIME_FUNCTION findFunctionEntry(const CachedModule *mod, DWORD rva, int &hint) { |
| 131 | PRUNTIME_FUNCTION table = mod->pdata; |
| 132 | int lo = 0, hi = (int)mod->pdataLast; |
| 133 | int mid = hint; |
| 134 | goto first_check; |
| 135 | do { |
| 136 | mid = (lo + hi) >> 1; |
| 137 | first_check: |
| 138 | if (rva < table[mid].BeginAddress) hi = mid - 1; |
| 139 | else if (rva >= table[mid].EndAddress) lo = mid + 1; |
| 140 | else { hint = mid; return &table[mid]; } |
| 141 | } while (lo <= hi); |
| 142 | return nullptr; |
| 143 | } |
| 144 | |
| 145 | static __forceinline PRUNTIME_FUNCTION cachedLookupOnly(ULONG64 pc, const CachedModule *&lastModule, |
| 146 | ULONG64 &imageBase, int &pdataHint) { |