Created
November 2, 2015 13:53
-
-
Save shahril96/e8c55ba1dddebf3e197b to your computer and use it in GitHub Desktop.
borismilner's 4N006135 level-2.exe keygenme solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
char key[40] = {0}; | |
memset(key, 'O', 32); | |
int i = 0; | |
unsigned id; | |
printf("enter id : "); | |
scanf("%u", &id); | |
if(id & 1) // check least significant bit for set | |
key[i] = '*'; | |
i++; | |
if(id <= 0xb16b00b5) | |
key[i] = '*'; | |
key[++i] = '*'; | |
key[++i] = '*'; | |
for(int z = 28; z > 0; z--) | |
{ | |
id >>= 1; | |
int rem = id % 26; | |
// z & 1 to check either number is odd | |
key[i++] = rem + ((z & 1) ? 'A' : 'a'); | |
} | |
printf("key : %s\n", key); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment