crackme6 分析
注册机:
- #include <stdio.h>
- #include <stdlib.h>
- #define _DEBUG
- int main (int argc, const char * argv[])
- {
- // title : crackme6
- // author: edmond
- // date: 2012.6.25
- // Register Name: edmond
- // Serial: T8166813790
- char *name = "";
- // f1(Name) = mid_serial;
- char *code_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- char *sec_mid_serial = {0};
- int name_sum = 0;
- sec_mid_serial = malloc(strlen(name)+1);
- for (int i=0; i<strlen(name); i++)
- name_sum += name[i];
- for (int i=0; i<strlen(name); i++)
- sec_mid_serial[i] = (char)(
- (
- (
- ( (code_table[i*3-1]^name[i]) +
- (name_sum*(i-1)^0xFFFFFFFF) +
- 0x14D +
- strlen(name)*(i+3)*name[i]
- )%10+0x30
- )^0xADAC
- )*(i+2)%10+0x30
- );
- char *mid_serial = malloc(100);
- sprintf(mid_serial, "T%s-%d", sec_mid_serial, (int)(strlen(name)*name_sum%0x64+0x30));
- // f2(mid_serial) = last_serial;
- char *final_serial = malloc(100);
- final_serial[0] = mid_serial[0];
- for (int i=1; i<strlen(mid_serial); i++)
- final_serial[i] = (mid_serial[i]^0x20)%10+0x30;
- #ifdef _DEBUG
- printf("%s\n",final_serial);
- #endif
- free(sec_mid_serial);
- free(mid_serial);
- free(final_serial);
- return 0;
- }