Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Logic for keygen ripped off from assembly
- http://crackmes.de/users/lucifer/first_c_crackme/
- **/
- #ifdef _MSC_VER
- #define _CRT_SECURE_NO_WARNINGS
- #endif
- #include <stdio.h>
- #include <conio.h>
- #include <string.h>
- #include <stdlib.h>
- void main()
- {
- char test[20];
- int res;
- printf("Enter Username: ");
- scanf("%s", test);
- int len = strlen(test);
- __asm
- {
- pushad; //save contents of registry - so that we don't screw the flow
- sub esp, 50; //for our dirty work
- mov edx, len;
- imul edx, edx, 0x875CD;
- mov eax, 0x51EB851F;
- mul edx;
- mov eax, edx;
- shr eax, 5;
- imul eax, eax, -0x370;
- mov edx, 0;
- push edx;
- push eax;
- fild QWORD PTR SS : [ESP];
- lea esp, DWORD PTR SS : [ESP + 0x8];
- fstp QWORD PTR SS : [ESP + 0x8];
- mov eax, [ESP + 8];
- mov res, eax; //save the result required
- add esp, 50; //adjust stack
- popad; //reload saved registry entries
- }
- printf("%i-x019871", res);
- _getch();
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement