Skip to content

Commit e778895

Browse files
NtQueryNtQuery
authored andcommitted
fix iat search bug
1 parent b06ed91 commit e778895

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

Scylla/IATSearch.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ void IATSearch::filterIATPointersList( std::set<DWORD_PTR> & iatPointers )
486486

487487
while(erased)
488488
{
489+
if (iatPointers.size() <= 1)
490+
break;
491+
489492
iter = iatPointers.begin();
490493
lastPointer = *iter;
491494
iter++;
@@ -494,9 +497,15 @@ void IATSearch::filterIATPointersList( std::set<DWORD_PTR> & iatPointers )
494497
{
495498
if ((*iter - lastPointer) > 0x100) //check pointer difference, a typical difference is 4 on 32bit systems
496499
{
497-
if (isIATPointerValid(lastPointer, false) == false || isIATPointerValid(*iter, false) == false)
500+
bool isLastValid = isIATPointerValid(lastPointer, false);
501+
bool isCurrentValid = isIATPointerValid(*iter, false);
502+
if (isLastValid == false || isCurrentValid == false)
498503
{
499-
iter--;
504+
if (isLastValid == false)
505+
{
506+
iter--;
507+
}
508+
500509
iatPointers.erase(iter);
501510
erased = true;
502511
break;

0 commit comments

Comments
 (0)