A very easy crackme
int __fastcall main(int argc, const char **argv, const char **envp)
{
char v4[4]; // [rsp+24h] [rbp-Ch] BYREF
int v5; // [rsp+28h] [rbp-8h] BYREF
int v6; // [rsp+2Ch] [rbp-4h]
_main(argc, argv, envp);
v6 = 1234;
printf("Please enter the password: ");
scanf("%d", &v5);
if ( v6 == v5 )
{
puts("You cracked it!");
puts("You cracked it!");
puts("You cracked it!");
puts("You cracked it!");
puts("You cracked it!");
printf("Press enter to exit: ");
scanf("%d", v4);
}
else
{
printf("You are close :)");
}
return 0;
} |
==> |
int __stdcall getPassword()
{
int v1; // [esp+0h] [ebp-4h] BYREF
v1 = 1986487925;
return (int)&v1;
}
The returned value seems dynamic to me. I don't know how to do next. |
==> |
Enter any string and you will get "Wrong Password!".
Search for it in IDA Pro and you will get the following code
v1 = sub_14000148A("\"gpPGcG*+wBq}b]VP[Zdy$ej\\jyj\"g", 19);
v2 = strcmp(Str1, v1);
if ( v2 )
{
v2 = 1;
sub_140001400("Wrong password!\n");
}
else
{
sub_140001400("Correct password!\n");
}
Run the first line in C++ then you will get the correct password |
==> |