Skip to content

Instantly share code, notes, and snippets.

@Saket-Upadhyay
Created May 13, 2021 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Saket-Upadhyay/b8d0c640e0607ce1b0dce843c55e61af to your computer and use it in GitHub Desktop.
Save Saket-Upadhyay/b8d0c640e0607ce1b0dce843c55e61af to your computer and use it in GitHub Desktop.
Code that checks for mod7 in Windows95 product key check function in setupx.dll
//reversed by x64mayhem for educational purpose only.
bool __cdecl16far MOD7check(char *param_1,undefined2 param_2)
{
int IndexCounter;
int SUM;
char character;
IndexCounter = 0;
SUM = 0;
while( true ) {
character = *param_1;
if ((character < '0') || ('9' < character)) break;
/* Convert Char to Int ?? */
SUM = SUM + character + -48;
IndexCounter = IndexCounter + 1;
param_1 = param_1 + 1;
if (6 < IndexCounter) {
return SUM % 7 == 0;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment