Skip to content

Commit

Permalink
Add Sleep(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Dec 6, 2023
1 parent 4beaf27 commit fa8e6c1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions GravitGuard/GravitGuard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,15 @@ GravitGuard::CheckResult GravitGuard::checkStacktrace(unsigned int flags)
bool lastUnknownMemoryRegion = true;
unsigned short captured;
int max = 128;
do {
while(true) {
captured = getStackTrace(1, 1024, ptrs, NULL);
max--;
} while (captured == 0 && max > 0);
if (captured > 0 || max <= 0) {
break;
} else {
Sleep(0);
}
}
for (int i = 0; i < captured; ++i)
{
module_t mod = getModuleByAddress(ptrs[i]);
Expand Down

0 comments on commit fa8e6c1

Please sign in to comment.