Skip to content

Instantly share code, notes, and snippets.

@yohanes
Created December 7, 2018 04:19
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 yohanes/6fb142e4775b6d613059a2b7f8933452 to your computer and use it in GitHub Desktop.
Save yohanes/6fb142e4775b6d613059a2b7f8933452 to your computer and use it in GitHub Desktop.
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx@0
const char *v4; // r12@2
const char *v5; // rbp@2
size_t v6; // rax@2
const char *v7; // rdx@2
const char *v8; // rax@2
int v9; // ecx@3
const char *v10; // rdi@5
size_t v11; // rax@5
int v12; // edx@6
int result; // eax@9
if ( argc <= 2 )
{
puts("Usage: serial3 <user> <serial>");
result = 0;
}
else
{
v4 = argv[1];
v5 = argv[2];
v6 = strlen(argv[1]);
v7 = v4;
v8 = &v4[v6];
while ( v7 != v8 )
{
v9 = *v7++;
v3 += v9;
}
v10 = v5;
v11 = (size_t)&v5[strlen(v5)];
while ( v10 != (const char *)v11 )
{
v12 = *v10++;
v3 += v12;
}
if ( 100057 * (v3 + 17) % 1871 == 812 )
result = puts("correct serial");
else
result = puts("incorrect serial");
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment