Here I demostrate very simple Cracks_me in C. I write the programm in C were the password is a login.
Open the IDA to analysis
In IDA we searching our main function in .text section - code section
Compiler
The use the IDA function F5 and see the row code
int sub_411890() { char v1; // [sp+0h] [bp-1C8h]@1 char v2; // [sp+Ch] [bp-1BCh]@1 size_t v3; // [sp+D0h] [bp-F8h]@1 size_t v4; // [sp+DCh] [bp-ECh]@1 int v5; // [sp+E8h] [bp-E0h]@7 int i; // [sp+F4h] [bp-D4h]@2 char v7[100]; // [sp+100h] [bp-C8h]@1 char Str[96]; // [sp+164h] [bp-64h]@1 unsigned int v9; // [sp+1C4h] [bp-4h]@1 int savedregs; // [sp+1C8h] [bp+0h]@1 memset(&v2, 0xCCu, 0x1BCu); v9 = (unsigned int)&savedregs ^ __security_cookie; ((void (__cdecl *)(_DWORD, char))sub_41132A)("Enter Login:", v1); sub_411230("%s", (unsigned int)Str); ((void (__cdecl *)(_DWORD, char))sub_41132A)("Password: ", v1); sub_411230("%s", v7); v4 = j_strlen(Str); v3 = j_strlen(v7); if ( v4 == v3 ) { for ( i = 0; Str[i]; ++i ) { if ( Str[i] != v7[i] ) { sub_41132A("%c IncorrectPas_0", v4); goto LABEL_10; } } sub_41132A("%c PasswordIsCorr", v4); v5 = 0; } else { sub_41132A("%c IncorrectPassw", v4); v5 = 1; } getchar(); sub_411118(); getchar(); sub_411118(); LABEL_10: sub_411262(&savedregs, &dword_411A28); sub_411276(); return sub_411118(); }
The Keygen on this Crack
#include <stdio.h>
#include <string.h> //string function
int main()
{
char login[90];
int i;
printf("Enter Login:");
scanf("%s", login);
printf("Password: ");
for (i = 0; login[i] !='\0'; i++) //password
{
putchar(login[i]);
}
printf("\n");
return 0;
}
ON THE SCREEN
Enter Login:hellofr
Password: hellofr
Open the IDA to analysis
In IDA we searching our main function in .text section - code section
Compiler
The use the IDA function F5 and see the row code
int sub_411890() { char v1; // [sp+0h] [bp-1C8h]@1 char v2; // [sp+Ch] [bp-1BCh]@1 size_t v3; // [sp+D0h] [bp-F8h]@1 size_t v4; // [sp+DCh] [bp-ECh]@1 int v5; // [sp+E8h] [bp-E0h]@7 int i; // [sp+F4h] [bp-D4h]@2 char v7[100]; // [sp+100h] [bp-C8h]@1 char Str[96]; // [sp+164h] [bp-64h]@1 unsigned int v9; // [sp+1C4h] [bp-4h]@1 int savedregs; // [sp+1C8h] [bp+0h]@1 memset(&v2, 0xCCu, 0x1BCu); v9 = (unsigned int)&savedregs ^ __security_cookie; ((void (__cdecl *)(_DWORD, char))sub_41132A)("Enter Login:", v1); sub_411230("%s", (unsigned int)Str); ((void (__cdecl *)(_DWORD, char))sub_41132A)("Password: ", v1); sub_411230("%s", v7); v4 = j_strlen(Str); v3 = j_strlen(v7); if ( v4 == v3 ) { for ( i = 0; Str[i]; ++i ) { if ( Str[i] != v7[i] ) { sub_41132A("%c IncorrectPas_0", v4); goto LABEL_10; } } sub_41132A("%c PasswordIsCorr", v4); v5 = 0; } else { sub_41132A("%c IncorrectPassw", v4); v5 = 1; } getchar(); sub_411118(); getchar(); sub_411118(); LABEL_10: sub_411262(&savedregs, &dword_411A28); sub_411276(); return sub_411118(); }
The we can rewrite the tool on C
#include <stdio.h>
#include <string.h> //string function
int main(void)
{
char login[90];
char pass[90];
int i;
int result;
printf("Enter Login:");
scanf("%s", login);
printf("Password: ");
scanf("%s", pass);
int v3 = strlen(login);
int v4 = strlen(pass);
if (v3 == v4)
{
for (i = 0; login[i] !='\0'; i++)
{
if (login[i] != pass[i]) //password is a login
{
printf("%c IncorrectPas_0", v3);
return 1;
}
}
printf("%c PasswordIsCorr", v3);
result = 0;
}
else
{
printf("%c IncorrectPassw", v3);
result = 1;
}
getchar();
getchar();
return result;
}
ON THE SCREEN
Enter Login:develop
Password: helll
IncorrectPassw
Enter Login:open
Password: open
PasswordIsCorr
#include <string.h> //string function
int main(void)
{
char login[90];
char pass[90];
int i;
int result;
printf("Enter Login:");
scanf("%s", login);
printf("Password: ");
scanf("%s", pass);
int v3 = strlen(login);
int v4 = strlen(pass);
if (v3 == v4)
{
for (i = 0; login[i] !='\0'; i++)
{
if (login[i] != pass[i]) //password is a login
{
printf("%c IncorrectPas_0", v3);
return 1;
}
}
printf("%c PasswordIsCorr", v3);
result = 0;
}
else
{
printf("%c IncorrectPassw", v3);
result = 1;
}
getchar();
getchar();
return result;
}
ON THE SCREEN
Enter Login:develop
Password: helll
IncorrectPassw
Enter Login:open
Password: open
PasswordIsCorr
The Keygen on this Crack
#include <stdio.h>
#include <string.h> //string function
int main()
{
char login[90];
int i;
printf("Enter Login:");
scanf("%s", login);
printf("Password: ");
for (i = 0; login[i] !='\0'; i++) //password
{
putchar(login[i]);
}
printf("\n");
return 0;
}
ON THE SCREEN
Enter Login:hellofr
Password: hellofr
Комментариев нет:
Отправить комментарий