MCPcopy Create free account
hub / github.com/NtQuery/Scylla / checkMemoryRangeAndAddToList

Method checkMemoryRangeAndAddToList

Scylla/IATReferenceScan.cpp:532–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530}
531
532void 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
562void IATReferenceScan::patchDirectJumpTableEntry(DWORD_PTR targetIatPointer, DWORD_PTR stdImagebase, DWORD directImportsJumpTableRVA, PeParser * peParser, BYTE * jmpTableMemory, DWORD newIatBase )
563{

Callers

nothing calls this directly

Calls 2

logMethod · 0.80

Tested by

no test coverage detected