Skip to content

Instantly share code, notes, and snippets.

@yohanes

yohanes/re-faq1-decompiled.c Secret

Created Dec 7, 2018
Embed
What would you like to do?
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