Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .thumb
- @x800D is the argument, is the var to use. this uses two vars, in sucession.
- start:
- push {r4-r5, lr}
- get_decrypt_var:
- ldr r0, last_result
- ldrh r0, [r0] @var number is in r0
- add r1, r0, #0x1 @gets second var for month/day
- push {r1} @second var number stored for later
- ldr r1, decrypt_var
- bl call_with_r1 @r0 now holds the offset of the first var
- mov r4, r0 @r4 holds a copy of that offset
- pop {r0} @second var in r0
- ldr r1, decrypt_var
- bl call_with_r1
- mov r5, r0 @r4 holds year offset, r5 holds month/day offset
- ldr r2, clock
- year_check:
- ldrh r0, [r4] @r0 holds the last checked year
- ldrh r1, [r2] @r1 holds the current year
- cmp r0, r1
- bcc checked_yesterday @if last checked year is lower than current, jumps
- month_check:
- ldrb r0, [r5, #0x1] @r0 now holds the last checked month
- ldrb r1, [r2, #0x3] @r1 holds current month
- cmp r0, r1
- bcc checked_yesterday
- day_check:
- ldrb r0, [r5]
- ldrb r1, [r2, #0x4]
- cmp r0, r1
- bcc checked_yesterday
- checked_today:
- ldr r0, last_result
- mov r1, #0x0
- strh r1, [r0]
- pop {r4-r5, pc}
- checked_yesterday:
- @r2 holds the rtc, r4 holds the offset for the year, r5 holds the offset for the month/day
- ldrh r0, [r2]
- strh r0, [r4] @the current year gets stored
- add r2, r2, #0x3
- ldrh r0, [r2]
- strh r0, [r5]
- ldr r0, last_result
- mov r1, #0x1
- strh r1, [r0]
- pop {r4-r5, pc}
- call_with_r1:
- bx r1
- .align 2
- last_result: .word 0x020370D0
- decrypt_var: .word 0x0806E454 + 1
- clock: .word 0x0300553C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement