Skip to content

Commit

Permalink
Working with a mounted flash drive
Browse files Browse the repository at this point in the history
If a flash drive smaller than 80 GB is mounted, there will be a false positive.
  • Loading branch information
CyberGreg05 authored Mar 6, 2024
1 parent 1f7c4a6 commit a7268ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions al-khaser/AntiVM/Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ BOOL disk_size_wmi()
// Iterate over our enumator
while (pEnumerator)
{
BOOL detectedRealDisk = FALSE;
hRes = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn);
if (0 == uReturn)
break;
Expand All @@ -561,6 +562,9 @@ BOOL disk_size_wmi()
if (diskSizeBytes < minHardDiskSize) { // Less than 80GB
bFound = TRUE;
}
else { // Detect real disk
detectedRealDisk = TRUE;
}
}

// release the current result object
Expand All @@ -572,7 +576,7 @@ BOOL disk_size_wmi()
pclsObj->Release();

// break from while
if (bFound)
if (bFound || detectedRealDisk)
break;
}

Expand Down Expand Up @@ -2011,4 +2015,4 @@ BOOL number_SMBIOS_tables()
free(smbios);
}
return result;
}
}

0 comments on commit a7268ff

Please sign in to comment.