.text:00001820 .text:00001820 ; =============== S U B R O U T I N E ======================================= .text:00001820 .text:00001820 .text:00001820 sub_1820 ; CODE XREF: sub_1B10+64Ep .text:00001820 .text:00001820 s = -0xE8 .text:00001820 fd = -0xE4 .text:00001820 var_E0 = -0xE0 .text:00001820 var_DC = -0xDC .text:00001820 var_D4 = -0xD4 .text:00001820 var_3C = -0x3C .text:00001820 var_3B = -0x3B .text:00001820 var_3A = -0x3A .text:00001820 var_39 = -0x39 .text:00001820 var_38 = -0x38 .text:00001820 var_37 = -0x37 .text:00001820 var_36 = -0x36 .text:00001820 var_35 = -0x35 .text:00001820 var_34 = -0x34 .text:00001820 var_33 = -0x33 .text:00001820 var_32 = -0x32 .text:00001820 var_31 = -0x31 .text:00001820 var_30 = -0x30 .text:00001820 var_2F = -0x2F .text:00001820 var_2E = -0x2E .text:00001820 var_2D = -0x2D .text:00001820 var_2C = -0x2C .text:00001820 .text:00001820 LDR R3, =(__stack_chk_guard_ptr - 0x182A) .text:00001822 PUSH.W {R4-R11,LR} .text:00001826 ADD R3, PC ; __stack_chk_guard_ptr .text:00001828 LDR R3, [R3] ; __stack_chk_guard .text:0000182A SUB SP, SP, #0xC4 .text:0000182C MOV R11, R1 .text:0000182E MOVS R1, #0x20 ; c .text:00001830 STR R2, [SP,#0xE8+fd] .text:00001832 LDR R2, [R3] .text:00001834 STR R3, [SP,#0xE8+var_E0] .text:00001836 STR R2, [SP,#0xE8+var_2C] .text:00001838 BLX strchr .text:0000183C LDR R2, =(dword_6B00 - 0x1842) .text:0000183E ADD R2, PC ; dword_6B00 .text:00001840 LDRB.W R1, [R2,#(dword_6C90 - 0x6B00)] .text:00001844 MOV R8, R0 .text:00001846 ADDS R4, R0, #1 .text:00001848 CMP R1, #0 .text:0000184A BEQ.W loc_1A6A .text:0000184E .text:0000184E loc_184E ; CODE XREF: sub_1820+27Ej .text:0000184E LDR R6, =(dword_6B00 - 0x1858) .text:00001850 MOVW R7, #0x539 .text:00001854 ADD R6, PC ; dword_6B00 .text:00001856 ADD.W R0, R6, #0x190 ; s .text:0000185A BLX strlen .text:0000185E CMP R11, R7 .text:00001860 MOV R10, R0 .text:00001862 BEQ loc_18A8 .text:00001864 .text:00001864 loc_1864 ; CODE XREF: sub_1820+A4j .text:00001864 ; sub_1820+284j .text:00001864 LDR R7, =(dword_6B00 - 0x186A) .text:00001866 ADD R7, PC ; dword_6B00 .text:00001868 SUBS R5, R7, #4 .text:0000186A ADD.W R7, R7, #0x18C .text:0000186E B loc_1874 .text:00001870 ; --------------------------------------------------------------------------- .text:00001870 .text:00001870 loc_1870 ; CODE XREF: sub_1820+5Aj .text:00001870 ; sub_1820+60j .text:00001870 CMP R5, R7 .text:00001872 BEQ loc_1896 .text:00001874 .text:00001874 loc_1874 ; CODE XREF: sub_1820+4Ej .text:00001874 ; sub_1820+74j .text:00001874 LDR.W R6, [R5,#(dword_6B00 - 0x6AFC)]! .text:00001878 CMP R6, #0 .text:0000187A BEQ loc_1870 .text:0000187C LDR R3, [R6,#0x14] .text:0000187E CMP R3, R11 .text:00001880 BNE loc_1870 .text:00001882 MOV R0, R4 ; s .text:00001884 BLX strlen .text:00001888 MOV R1, R4 ; buf .text:0000188A MOV R2, R0 ; n .text:0000188C LDR R0, [R6,#0x10] ; fd .text:0000188E BLX write .text:00001892 CMP R5, R7 .text:00001894 BNE loc_1874 .text:00001896 .text:00001896 loc_1896 ; CODE XREF: sub_1820+52j .text:00001896 LDR R3, [SP,#0xE8+var_E0] .text:00001898 LDR R2, [SP,#0xE8+var_2C] .text:0000189A LDR R3, [R3] .text:0000189C CMP R2, R3 .text:0000189E BNE.W loc_1ADE .text:000018A2 ADD SP, SP, #0xC4 .text:000018A4 POP.W {R4-R11,PC} .text:000018A8 ; --------------------------------------------------------------------------- .text:000018A8 .text:000018A8 loc_18A8 ; CODE XREF: sub_1820+42j .text:000018A8 LDRB.W R2, [R6,#(dword_6CA0 - 0x6B00)] .text:000018AC CMP R2, #0 .text:000018AE BEQ.W loc_1AA6 .text:000018B2 .text:000018B2 loc_18B2 ; CODE XREF: sub_1820+2BCj .text:000018B2 LDR R1, =(dword_6B00 - 0x18BC) .text:000018B4 MOV R0, R4 ; s1 .text:000018B6 MOV R2, R10 ; n .text:000018B8 ADD R1, PC ; dword_6B00 .text:000018BA ADD.W R1, R1, #0x1A0 ; s2 .text:000018BE BLX strncmp .text:000018C2 CMP R0, #0 .text:000018C4 BNE loc_1864 .text:000018C6 LDR.W R12, =(aNlGMfgl - 0x18D8) .text:000018CA ADD.W R2, R10, #2 .text:000018CE LDR R3, =(dword_6B00 - 0x18DE) .text:000018D0 MOV R5, R0 .text:000018D2 LDR R7, =(dword_6B00 - 0x18F0) .text:000018D4 ADD R12, PC ; "NL]]@G\[email protected]]\tMFGL" .text:000018D6 LDR.W R9, =(aNlGMfgl - 0x18F2) .text:000018DA ADD R3, PC ; dword_6B00 .text:000018DC ADD.W R3, R3, #0x1B0 .text:000018E0 STR.W R11, [SP,#0xE8+var_DC] .text:000018E4 ADD.W R10, R12, #0x20 .text:000018E8 ADD R6, SP, #0xE8+var_D4 .text:000018EA STR R3, [SP,#0xE8+s] .text:000018EC ADD R7, PC ; dword_6B00 .text:000018EE ADD R9, PC ; "NL]]@G\[email protected]]\tMFGL" .text:000018F0 MOV R11, R2 .text:000018F2 B loc_190A .text:000018F4 ; --------------------------------------------------------------------------- .text:000018F4 .text:000018F4 loc_18F4 ; CODE XREF: sub_1820+1D8j .text:000018F4 ; sub_1820+248j .text:000018F4 LDR R0, [SP,#0xE8+s] ; s .text:000018F6 BLX strlen .text:000018FA LDR R1, [SP,#0xE8+s] ; buf .text:000018FC MOV R2, R0 ; n .text:000018FE LDR R0, [SP,#0xE8+fd] ; fd .text:00001900 BLX write .text:00001904 .text:00001904 loc_1904 ; CODE XREF: sub_1820+11Cj .text:00001904 ; sub_1820+128j ... .text:00001904 ADDS R5, #1 .text:00001906 ADD.W R10, R10, #0x40 .text:0000190A .text:0000190A loc_190A ; CODE XREF: sub_1820+D2j .text:0000190A MOV R0, R4 ; s .text:0000190C BLX strlen .text:00001910 CMP R5, R0 .text:00001912 BCS.W loc_1AA0 .text:00001916 MOV R0, R6 .text:00001918 BL sub_15A0 .text:0000191C ADD.W R1, R5, R11 .text:00001920 MOVS R2, #1 .text:00001922 ADD R1, R8 .text:00001924 MOV R0, R6 .text:00001926 BL sub_15D8 .text:0000192A MOV R1, R6 .text:0000192C ADD R0, SP, #0xE8+var_3C .text:0000192E BL sub_1668 .text:00001932 LDRB.W R2, [SP,#0xE8+var_3C] .text:00001936 LDR.W R1, [R10] .text:0000193A CMP R1, R2 .text:0000193C BNE loc_1904 .text:0000193E LDRB.W R2, [SP,#0xE8+var_3B] .text:00001942 LDR.W R1, [R10,#(dword_6024 - 0x6020)] .text:00001946 CMP R1, R2 .text:00001948 BNE loc_1904 .text:0000194A LDRB.W R2, [SP,#0xE8+var_3A] .text:0000194E LDR.W R1, [R10,#(dword_6028 - 0x6020)] .text:00001952 CMP R1, R2 .text:00001954 BNE loc_1904 .text:00001956 LDRB.W R2, [SP,#0xE8+var_39] .text:0000195A LDR.W R1, [R10,#(dword_602C - 0x6020)] .text:0000195E CMP R1, R2 .text:00001960 BNE loc_1904 .text:00001962 LDRB.W R2, [SP,#0xE8+var_38] .text:00001966 LDR.W R1, [R10,#(dword_6030 - 0x6020)] .text:0000196A CMP R1, R2 .text:0000196C BNE loc_1904 .text:0000196E LDRB.W R2, [SP,#0xE8+var_37] .text:00001972 LDR.W R1, [R10,#(dword_6034 - 0x6020)] .text:00001976 CMP R1, R2 .text:00001978 BNE loc_1904 .text:0000197A LDRB.W R2, [SP,#0xE8+var_36] .text:0000197E LDR.W R1, [R10,#(dword_6038 - 0x6020)] .text:00001982 CMP R1, R2 .text:00001984 BNE loc_1904 .text:00001986 LDRB.W R2, [SP,#0xE8+var_35] .text:0000198A LDR.W R1, [R10,#(dword_603C - 0x6020)] .text:0000198E CMP R1, R2 .text:00001990 BNE loc_1904 .text:00001992 LDRB.W R2, [SP,#0xE8+var_34] .text:00001996 LDR.W R1, [R10,#(dword_6040 - 0x6020)] .text:0000199A CMP R1, R2 .text:0000199C BNE loc_1904 .text:0000199E LDRB.W R2, [SP,#0xE8+var_33] .text:000019A2 LDR.W R1, [R10,#(dword_6044 - 0x6020)] .text:000019A6 CMP R1, R2 .text:000019A8 BNE loc_1904 .text:000019AA LDRB.W R2, [SP,#0xE8+var_32] .text:000019AE LDR.W R1, [R10,#(dword_6048 - 0x6020)] .text:000019B2 CMP R1, R2 .text:000019B4 BNE loc_1904 .text:000019B6 LDRB.W R2, [SP,#0xE8+var_31] .text:000019BA LDR.W R1, [R10,#(dword_604C - 0x6020)] .text:000019BE CMP R1, R2 .text:000019C0 BNE loc_1904 .text:000019C2 LDRB.W R2, [SP,#0xE8+var_30] .text:000019C6 LDR.W R1, [R10,#(dword_6050 - 0x6020)] .text:000019CA CMP R1, R2 .text:000019CC BNE loc_1904 .text:000019CE LDRB.W R2, [SP,#0xE8+var_2F] .text:000019D2 LDR.W R1, [R10,#(dword_6054 - 0x6020)] .text:000019D6 CMP R1, R2 .text:000019D8 BNE loc_1904 .text:000019DA LDRB.W R2, [SP,#0xE8+var_2E] .text:000019DE LDR.W R1, [R10,#(dword_6058 - 0x6020)] .text:000019E2 CMP R1, R2 .text:000019E4 BNE loc_1904 .text:000019E6 LDRB.W R2, [SP,#0xE8+var_2D] .text:000019EA LDR.W R1, [R10,#(dword_605C - 0x6020)] .text:000019EE CMP R1, R2 .text:000019F0 BNE loc_1904 .text:000019F2 LDRB.W R2, [R7,#0x1B0] .text:000019F6 CMP R2, #0 .text:000019F8 BNE.W loc_18F4 .text:000019FC LDRB.W R1, [R9,#0x8E1] .text:00001A00 LDRB.W R2, [R9,#0x8E2] .text:00001A04 EOR.W R1, R1, #0x26 .text:00001A08 STRB.W R1, [R7,#0x1B1] .text:00001A0C EOR.W R2, R2, #0x26 .text:00001A10 LDRB.W R1, [R9,#0x8E3] .text:00001A14 STRB.W R2, [R7,#0x1B2] .text:00001A18 LDRB.W R2, [R9,#0x8E4] .text:00001A1C EOR.W R1, R1, #0x26 .text:00001A20 STRB.W R1, [R7,#0x1B3] .text:00001A24 EOR.W R2, R2, #0x26 .text:00001A28 LDRB.W R1, [R9,#0x8E5] .text:00001A2C STRB.W R2, [R7,#0x1B4] .text:00001A30 LDRB.W R2, [R9,#0x8E6] .text:00001A34 EOR.W R1, R1, #0x26 .text:00001A38 LDRB.W R0, [R9,#0x8E0] .text:00001A3C EOR.W R2, R2, #0x26 .text:00001A40 STRB.W R1, [R7,#0x1B5] .text:00001A44 STRB.W R2, [R7,#0x1B6] .text:00001A48 EOR.W R0, R0, #0x26 .text:00001A4C LDRB.W R1, [R9,#0x8E7] .text:00001A50 LDRB.W R2, [R9,#0x8E8] .text:00001A54 EOR.W R1, R1, #0x26 .text:00001A58 STRB.W R0, [R7,#0x1B0] .text:00001A5C EOR.W R2, R2, #0x26 .text:00001A60 STRB.W R1, [R7,#0x1B7] .text:00001A64 STRB.W R2, [R7,#0x1B8] .text:00001A68 B loc_18F4 .text:00001A6A ; --------------------------------------------------------------------------- .text:00001A6A .text:00001A6A loc_1A6A ; CODE XREF: sub_1820+2Aj .text:00001A6A LDR R5, =(aNlGMfgl - 0x1A70) .text:00001A6C ADD R5, PC ; "NL]]@G\[email protected]]\tMFGL" .text:00001A6E LDMIA.W R5, {R0,R1,R6} ; "NL]]@G\[email protected]]\tMFGL" .text:00001A72 EOR.W R7, R0, #0x29292929 .text:00001A76 LDRB R0, [R5,#(aNlGMfgl+0xC - 0x6000)] ; "GL" .text:00001A78 LDRB R5, [R5,#(aNlGMfgl+0xD - 0x6000)] ; "L" .text:00001A7A EOR.W R1, R1, #0x29292929 .text:00001A7E EOR.W R6, R6, #0x29292929 .text:00001A82 EOR.W R0, R0, #0x29 .text:00001A86 STR.W R1, [R2,#(dword_6C94 - 0x6B00)] .text:00001A8A EOR.W R1, R5, #0x29 .text:00001A8E STR.W R7, [R2,#(dword_6C90 - 0x6B00)] .text:00001A92 STR.W R6, [R2,#(dword_6C98 - 0x6B00)] .text:00001A96 STRB.W R0, [R2,#(byte_6C9C - 0x6B00)] .text:00001A9A STRB.W R1, [R2,#(byte_6C9D - 0x6B00)] .text:00001A9E B loc_184E .text:00001AA0 ; --------------------------------------------------------------------------- .text:00001AA0 .text:00001AA0 loc_1AA0 ; CODE XREF: sub_1820+F2j .text:00001AA0 LDR.W R11, [SP,#0xE8+var_DC] .text:00001AA4 B loc_1864 .text:00001AA6 ; --------------------------------------------------------------------------- .text:00001AA6 .text:00001AA6 loc_1AA6 ; CODE XREF: sub_1820+8Ej .text:00001AA6 LDR R0, =(aNlGMfgl - 0x1AAC) .text:00001AA8 ADD R0, PC ; "NL]]@G\[email protected]]\tMFGL" .text:00001AAA ADD.W R1, R0, #0x10 .text:00001AAE LDMIA R1, {R1,R2,R5} .text:00001AB0 EOR.W R7, R1, #0x2E2E2E2E .text:00001AB4 LDRB R1, [R0,#(byte_601C - 0x6000)] .text:00001AB6 LDRB R0, [R0,#(byte_601D - 0x6000)] .text:00001AB8 EOR.W R2, R2, #0x2E2E2E2E .text:00001ABC EOR.W R5, R5, #0x2E2E2E2E .text:00001AC0 EOR.W R1, R1, #0x2E .text:00001AC4 STR.W R2, [R6,#(dword_6CA4 - 0x6B00)] .text:00001AC8 EOR.W R2, R0, #0x2E .text:00001ACC STR.W R7, [R6,#(dword_6CA0 - 0x6B00)] .text:00001AD0 STR.W R5, [R6,#(dword_6CA8 - 0x6B00)] .text:00001AD4 STRB.W R1, [R6,#(byte_6CAC - 0x6B00)] .text:00001AD8 STRB.W R2, [R6,#(byte_6CAD - 0x6B00)] .text:00001ADC B loc_18B2 .text:00001ADE ; --------------------------------------------------------------------------- .text:00001ADE .text:00001ADE loc_1ADE ; CODE XREF: sub_1820+7Ej .text:00001ADE BLX __stack_chk_fail .text:00001ADE ; End of function sub_1820 .text:00001ADE .text:00001ADE ; ---------------------------------------------------------------------------