diff --git a/thps1.c b/thps1.c index 26db6be..062c651 100644 --- a/thps1.c +++ b/thps1.c @@ -55,7 +55,7 @@ s32 mult_lo(s32 a, s32 b) { return (s32)(((s64)a * (s64)b) & 0xFFFFFFFF); } -void fuckery(code_t *code) { +void decode(code_t *code) { u32 r = 0; u32 a3 = 0x98534637; @@ -101,11 +101,13 @@ void print_code(const code_t *code) { int validate_entry(const char *entry) { code_t code = {0}; - int i = 0; - while (entry[i] && i < 13) code.name[i++] = entry[i]; + for (int i = 0; i < 13; i++) { + code.name[i] = entry[i]; + if (entry[i] == '\0') break; + } translate(code.name); - fuckery(&code); + decode(&code); int result = validate(&code); if (result) print_code(&code); @@ -137,7 +139,7 @@ CEIQQHURYAJAV while (found < count) { for (int j = 0; j < 13; j++) code.name[j] = prng() % 27; //for (int j = 3; j < 13; j++) code.name[j] = 26; - fuckery(&code); + decode(&code); if (validate(&code)) { found++; print_code(&code);