Solve Lagos

This commit is contained in:
2023-04-23 13:40:47 -04:00
parent 57338cd6fd
commit e139538d7e
2 changed files with 83 additions and 0 deletions

15
lagos.py Normal file
View File

@@ -0,0 +1,15 @@
FILL_BYTE = "30"
ADD_8_TO_R10 = "7a52"
ADD_1_TO_R10 = "5a53"
ADD_R10_TO_R14 = "4e5a"
JMP_6F_FORWARD = "7a34"
NOP = "4f5a" # ADD_R10_TO_R15 but since we do not need R15 it acts as a NOP
SHELL_CODE = FILL_BYTE * 89 # fill memory till conditional_unlock_door
SHELL_CODE += ADD_8_TO_R10 * 15
SHELL_CODE += ADD_1_TO_R10 * 7 # increment r10 to 0x7f
SHELL_CODE += ADD_R10_TO_R14 # set r14 to 0x7f (r14 is '0' initially)
SHELL_CODE += NOP * 76 # forward PC
SHELL_CODE += JMP_6F_FORWARD # jump to 4602
print(SHELL_CODE)