Skip to content

Instantly share code, notes, and snippets.

@exjam
Created March 7, 2017 00:41
Show Gist options
  • Save exjam/c0a6d530555909bab72330a2267307a8 to your computer and use it in GitHub Desktop.
Save exjam/c0a6d530555909bab72330a2267307a8 to your computer and use it in GitHub Desktop.
.text:03ABBA74 .globl start
.text:03ABBA74 start:
.text:03ABBA74
.text:03ABBA74 .set var_C, -0xC
.text:03ABBA74 .set var_8, -8
.text:03ABBA74 .set var_4, -4
.text:03ABBA74 .set arg_4, 4
.text:03ABBA74
.text:03ABBA74 mflr r0
.text:03ABBA78 stwu r1, -0x18(r1)
.text:03ABBA7C stw r30, 0x18+var_8(r1)
.text:03ABBA80 stw r31, 0x18+var_4(r1)
.text:03ABBA84 mr r31, r4
.text:03ABBA88 mr r30, r3
.text:03ABBA8C stw r29, 0x18+var_C(r1)
.text:03ABBA90 stw r0, 0x18+arg_4(r1)
.text:03ABBA94 bl OSGetCurrentThread
.text:03ABBA98 mr r29, r3
.text:03ABBA9C bl OSIsDebuggerInitialized
.text:03ABBAA0 cmpwi r3, 0
.text:03ABBAA4 beq loc_3ABBAC0
.text:03ABBAA8 lis r4, sub_2B43BD4@h
.text:03ABBAAC lis r5, sub_3ABB9F0@ha
.text:03ABBAB0 addi r4, r4, sub_2B43BD4@l
.text:03ABBAB4 li r3, 2
.text:03ABBAB8 addi r5, r5, sub_3ABB9F0@l
.text:03ABBABC tw 31, r30, r0
.text:03ABBAC0
.text:03ABBAC0 loc_3ABBAC0: # CODE XREF: start+30j
.text:03ABBAC0 lis r9, 0 # 0
.text:03ABBAC4 addic. r9, r9, 0 # 0
.text:03ABBAC8 beq loc_3ABBAF4
.text:03ABBACC lis r0, 0 # 0
.text:03ABBAD0 lis r8, dword_419B658@ha
.text:03ABBAD4 lis r11, 0 # 0
.text:03ABBAD8 addic r0, r0, 0 # 0
.text:03ABBADC lis r6, dword_419B650@ha
.text:03ABBAE0 addi r11, r11, 0 # 0
.text:03ABBAE4 stw r0, dword_419B658@l(r8)
.text:03ABBAE8 addi r3, r29, 0x408
.text:03ABBAEC stw r11, dword_419B650@l(r6)
.text:03ABBAF0 bl byte_4000000
.text:03ABBAF4
.text:03ABBAF4 loc_3ABBAF4: # CODE XREF: start+54j
.text:03ABBAF4 lis r12, 0 # 0
.text:03ABBAF8 addic. r12, r12, 0 # 0
.text:03ABBAFC beq loc_3ABBB04
.text:03ABBB00 bl byte_4000000
.text:03ABBB04
.text:03ABBB04 loc_3ABBB04: # CODE XREF: start+88j
.text:03ABBB04 bl sub_3ABB9F0
.text:03ABBB08 lis r3, loc_4058AD0@ha
.text:03ABBB0C addi r3, r3, loc_4058AD0@l
.text:03ABBB10 bl sub_4058A24
.text:03ABBB14 mr r3, r30
.text:03ABBB18 mr r4, r31
.text:03ABBB1C bl sub_2B43BD4
.text:03ABBB20 lis r0, -0x2153 # 0xDEADF00D
.text:03ABBB24 ori r0, r0, 0xF00D # 0xDEADF00D
.text:03ABBB28 cmplw r30, r0
.text:03ABBB2C bne loc_3ABBBEC
.text:03ABBB30 lis r11, 0
.text:03ABBB34 lwzu r0, 0(r11)
.text:03ABBB38 cmpwi r0, 0
.text:03ABBB3C beq loc_3ABBB58
.text:03ABBB40 lwz r9, 0(r11)
.text:03ABBB44 lwz r12, 0(r11)
.text:03ABBB48 slwi r11, r30, 2
.text:03ABBB4C add r10, r12, r11
.text:03ABBB50 lwz r0, 4(r10)
.text:03ABBB54 stwx r0, r9, r11
.text:03ABBB58
.text:03ABBB58 loc_3ABBB58: # CODE XREF: start+C8j
.text:03ABBB58 lis r9, 0
.text:03ABBB5C lwzu r0, 0(r9)
.text:03ABBB60 cmpwi r0, 0
.text:03ABBB64 beq loc_3ABBB80
.text:03ABBB68 lwz r8, 0(r9)
.text:03ABBB6C lwz r12, 0(r9)
.text:03ABBB70 slwi r11, r30, 2
.text:03ABBB74 add r10, r12, r11
.text:03ABBB78 lwz r0, 4(r10)
.text:03ABBB7C stwx r0, r8, r11
.text:03ABBB80
.text:03ABBB80 loc_3ABBB80: # CODE XREF: start+F0j
.text:03ABBB80 lis r31, unk_104140F4@h
.text:03ABBB84 addi r31, r31, unk_104140F4@l
.text:03ABBB88 li r4, 1
.text:03ABBB8C mr r3, r31
.text:03ABBB90 bl sub_405D788
.text:03ABBB94 lis r30, unk_104140F8@h
.text:03ABBB98 mr r4, r31
.text:03ABBB9C addi r30, r30, unk_104140F8@l
.text:03ABBBA0 li r5, 4
.text:03ABBBA4 mr r3, r30
.text:03ABBBA8 bl memcpy
.text:03ABBBAC lis r3, unk_104140FC@h
.text:03ABBBB0 mr r4, r30
.text:03ABBBB4 li r5, 4
.text:03ABBBB8 addi r3, r3, unk_104140FC@l
.text:03ABBBBC bl sub_3ABB98C
.text:03ABBBC0 lis r31, dword_1053E348@ha
.text:03ABBBC4 lwz r3, dword_1053E348@l(r31)
.text:03ABBBC8 bl __ghs_mtx_init
.text:03ABBBCC lwz r3, dword_1053E348@l(r31)
.text:03ABBBD0 bl __ghs_mtx_dst
.text:03ABBBD4 lwz r3, dword_1053E348@l(r31)
.text:03ABBBD8 bl __ghs_mtx_lock
.text:03ABBBDC lwz r3, dword_1053E348@l(r31)
.text:03ABBBE0 bl __ghs_mtx_unlock
.text:03ABBBE4 li r3, 0
.text:03ABBBE8 bl exit
.text:03ABBBEC # ---------------------------------------------------------------------------
.text:03ABBBEC
.text:03ABBBEC loc_3ABBBEC: # CODE XREF: start+B8j
.text:03ABBBEC lwz r29, 0x18+var_C(r1)
.text:03ABBBF0 lwz r0, 0x18+arg_4(r1)
.text:03ABBBF4 lwz r30, 0x18+var_8(r1)
.text:03ABBBF8 mtlr r0
.text:03ABBBFC lwz r31, 0x18+var_4(r1)
.text:03ABBC00 addi r1, r1, 0x18
.text:03ABBC04 blr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment