Skip to content

Commit

Permalink
Fix incorrect comparison when counting smbios tables (#271)
Browse files Browse the repository at this point in the history
+Fix incorrect comparison. Table counting may have completed early due to an incorrect comparison.
+refacto.
  • Loading branch information
CyberGreg05 authored Mar 18, 2024
1 parent 3878b27 commit 967afa0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions al-khaser/AntiVM/Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1978,11 +1978,11 @@ BOOL handle_one_table(BYTE* currentPosition, UINT& bias, BYTE* smBiosTableBounda
return TRUE;
}

currentPosition += tableHeader->length * sizeof(BYTE);
currentPosition += tableHeader->length;
UINT i = 0;
// Find the end of the table
while (!(currentPosition[i] == 0 && currentPosition[i + 1] == 0)
&& (currentPosition[i + 1] < smBiosTableBoundary[0]))
&& (currentPosition + i + 1 < smBiosTableBoundary))
{
i++;
}
Expand Down Expand Up @@ -2017,7 +2017,7 @@ BOOL check_tables_number(const PBYTE smbios)
{
break;
}
currentPosition += biasNewTable * sizeof(BYTE);
currentPosition += biasNewTable;
}

const UINT tableMinReal = 40;
Expand Down

0 comments on commit 967afa0

Please sign in to comment.