After getting my 680 somewhat operational again, I remembered about this thread, decompiled the MIPS
(because the SuperH decompiler is quite lacking right now
) binary of PocketBrowser 1.6 in Ghidra and was able to develop a keygen
(in the form of a Python script
).
Posting it here because PocketBrowser is effectively abandonware...
# Rules: the key is 20 digits long.
# key[14] should be 2.
# Another branch is activated when it's 1, but the registration number is not derived by that method.
# The last digit of the key is chosen so that the sum of digits is 0 mod 10.
# weirdHash(registrationNumber, reorderAndInvert(key[0:5]) + key[14:19], 9)
# should be equal to key[5:14]
# Another rule applies.
# int(key[15:17]) < 17 and int(key[17:19]) > 15
def reorderAndInvert(digits):
assert len(digits) == 5
return "".join([chr(0x69 - ord(x)) for x in [digits[1], digits[0], digits[2], digits[3], digits[4]]])
def weirdHash(s1, s2, n):
def signedfix(x):
if x >= 2**31:
x = -(2**32 - x)
return x
total = 0
# Swap the strings if necessary...
if len(s1) < len(s2):
s1, s2 = s2, s1
for i in range(len(s1) - len(s2) + 1):
for j in range(len(s2)):
x = ord(s1[i + j]) * 0x5c47 * ord(s2[j])
total = signedfix((total + x) & 0xffffffff)
total = signedfix((total * 0xe9) & 0xffffffff)
total = abs(total) % 10**n
return ("%%0%dd" % n) % total
def testKey(registrationNumber, key):
assert len(key) == 20
if not key[14] == "2":
return False
if not sum(int(x) for x in key) % 10 == 0:
return False
# Digit condition.
if not (int(key[15:17]) < 17 and int(key[17:19]) > 15):
return False
return weirdHash(registrationNumber, reorderAndInvert(key[0:5]) + key[14:19], 9) == key[5:14]
def makeKey(registrationNumber):
template = list("0" * 19)
# This should be 2.
template[14] = "2"
# This group should be less than 17.
template[15] = "1"
template[16] = "6"
# This group should be greater than 15.
template[17] = "1"
template[18] = "6"
template = "".join(template)
middle = weirdHash(registrationNumber, reorderAndInvert(template[0:5]) + template[14:19], 9)
key = template[0:5] + middle + template[14:19]
checkDigit = -sum(int(x) for x in key) % 10
key += str(checkDigit)
return key
regNum = input("Enter a 5-digit registration number: ")
if not len(regNum) == 5:
print("Error, the registration number should be 5 digits long")
exit(1)
k = makeKey(regNum)
assert testKey(regNum, k), "Verification error!"
print("Key: ", k)
Edited by SopaXorzTaker 2021-08-21 4:10 PM