All pastes #732316 Raw Edit

Untitled

public text v1 · immutable
·published 2007-10-10 21:22 UTC
rendered paste body
checksum_hash(string tmp)
    checksum = 0;
    for each char in tmp
        checksum += char;
    checksum = checksum % 9 + 1;
    do checksum times
        tmp = string(md5(tmp));

    return tmp;


Key must be at least 22 chars long

AAAAA-AAAAA-AAAAA-BBBB

firstpart = the A's without hyphens
secondpart = BBBB

struct_reg_environment:
+008: hKey (for HKEY_CURRENT_USER)
+00C: "Software\TopLang\OEBackup\Registration"
+138: "A21....." (registry key name)
+16C: 3         ;Number of parts in 1st part
+170: 5         ;Number of chars / part in 1st part
+17C: {9, 2, 6} ;Divisibility constant for the first part
+19C: "OEBackup"
+1D0: 4         ;Number of hyphens | number of chars in 2nd part
+1E0: Encrypted (not-ed) name
+244: Encrypted (not-ed) 1st part of key (w/o hyphens)
+2A8: Encrypted (not-ed) md5sum
+30C: Number of trial days


check1:
    namehash    = checksum_hash(name);
    producthash = checksum_hash("OEBackup") = "A1C4139DAD1DE8597E1F87D8CFBF2AE7";

    for(i = 0; i < 4; i++)
        key[i] = "ABCDEFGHJKLMNPQRSTUVWXY123456789"[(namehash[i] + producthash[i]) % 32];

    return checksum_hash(second_part) == checksum_hash(key);
    /* second_part == key */

check2:
    divisor = {9, 2, 6};
    for(i = 0; i < 3; i++)
        checksum = 0;
        for each char in part[i]
            checksum += char;
        checksum %= 256;
        if checksum % divisor[i] != 0
            return false;

    return true;