-
-
Save bbayles/83667160d0129056dd0781494abfb961 to your computer and use it in GitHub Desktop.
The Lost World: Jurassic Park (PlayStation) - password solver
This file contains hidden or 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
def check_password(password_buffer): | |
uVar4 = 0 | |
options_customized_01 = 0 | |
uVar2 = password_buffer[10] + password_buffer[6] * 4 | |
for i, c in enumerate(password_buffer): | |
if (i == 6) or (i == 10): | |
continue | |
uVar1 = c ^ (uVar2 & 0xFF) >> 2 ^ uVar2 & 3 | |
uVar4 = uVar4 + uVar1 | |
password_buffer[i] = uVar1 | |
if (uVar2 & 0xFF) != (uVar4 & 0xF): | |
return 0 | |
uVar2 = (password_buffer[5] & 1) * 4 + password_buffer[8] | |
if uVar2 != 0: | |
if 5 < uVar2: | |
return 0 | |
if password_buffer[2] < 3: | |
uVar2 = ( | |
(password_buffer[5] >> 1) * 0x40 | |
+ password_buffer[7] * 0x10 | |
+ password_buffer[3] * 4 | |
+ password_buffer[4] | |
) | |
if (uVar2 != 0) and (uVar2 < 100): | |
if options_customized_01 == '\0': | |
password_effect_01 = password_buffer[2] | |
password_effect_02 = password_buffer[0xB] & 1 | |
password_effect_03 = password_buffer[0] | |
password_effect_04 = password_buffer[1] | |
password_effect_05 = ( | |
password_buffer[4] | |
+ (password_buffer[5] >> 1) * 0x40 | |
+ password_buffer[7] * 0x10 | |
+ password_buffer[3] * 0x04 | |
) | |
password_effect_06 = (password_buffer[5] & 1) * 4 + password_buffer[8] | |
if password_effect_06 != 4: | |
password_effect_07 = password_buffer[9] & 1 | |
password_effect_08 = password_buffer[9] >> 1 | |
return (password_effect_06, password_effect_07, password_effect_08) | |
password_effect_09 = 10 | |
password_effect_07 = password_buffer[9] & 1 | |
password_effect_08 = password_buffer[9] >> 1 | |
return (password_effect_06, password_effect_07, password_effect_08) | |
return 0 | |
if __name__ == '__main__': | |
# Human Hunter 1: Square, Square, Square, Square, Square, Square, Square, O, Square, Square, O, Square | |
# Human Hunter 2: Square, Square, Square, Square, Square, Square, Square, O, Square, Square, O, Triangle | |
from itertools import product | |
mapping = 'SXCT' | |
valid_set = set() | |
total = 0 | |
for password in product([0, 1, 2, 3], repeat=12): | |
result = check_password(list(password)) | |
if not result: | |
continue | |
total += 1 | |
if result in valid_set: | |
continue | |
valid_set.add(result) | |
print(' '.join(mapping[c] for c in password)) | |
print(total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment