| 530 | } |
| 531 | |
| 532 | void IATReferenceScan::checkMemoryRangeAndAddToList( IATReference * ref, _DInst * instruction ) |
| 533 | { |
| 534 | #ifdef DEBUG_COMMENTS |
| 535 | _DecodedInst inst; |
| 536 | #endif |
| 537 | |
| 538 | if (ref->targetAddressInIat > 0x000FFFFF && ref->targetAddressInIat != (DWORD_PTR)-1) |
| 539 | { |
| 540 | if ((ref->targetAddressInIat < ImageBase) || (ref->targetAddressInIat > (ImageBase+ImageSize))) //outside pe image |
| 541 | { |
| 542 | //if (isAddressValidImageMemory(ref->targetAddressInIat)) |
| 543 | { |
| 544 | bool isSuspect = false; |
| 545 | if (apiReader->getApiByVirtualAddress(ref->targetAddressInIat, &isSuspect) != 0) |
| 546 | { |
| 547 | ref->addressVA = (DWORD_PTR)instruction->addr; |
| 548 | ref->instructionSize = instruction->size; |
| 549 | ref->targetPointer = lookUpIatForPointer(ref->targetAddressInIat); |
| 550 | |
| 551 | #ifdef DEBUG_COMMENTS |
| 552 | distorm_format(&ProcessAccessHelp::decomposerCi, instruction, &inst); |
| 553 | Scylla::debugLog.log(PRINTF_DWORD_PTR_FULL L" " PRINTF_DWORD_PTR_FULL L" %S %S %d %d - target address: " PRINTF_DWORD_PTR_FULL,(DWORD_PTR)instruction->addr, ImageBase, inst.mnemonic.p, inst.operands.p, instruction->ops[0].type, instruction->size, ref->targetAddressInIat); |
| 554 | #endif |
| 555 | iatDirectImportList.push_back(*ref); |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | void IATReferenceScan::patchDirectJumpTableEntry(DWORD_PTR targetIatPointer, DWORD_PTR stdImagebase, DWORD directImportsJumpTableRVA, PeParser * peParser, BYTE * jmpTableMemory, DWORD newIatBase ) |
| 563 | { |
nothing calls this directly
no test coverage detected