[*] Binary protection state of libapr-1.so.0.7.0
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of libapr-1.so.0.7.0
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1f81a */
| #include <stdint.h>
|
; (fcn) case.0x1b7ea.16 () | void case_0x1b7ea_16 (int16_t arg1, int16_t arg2, uint32_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0001f81c sbcvc lr, r3, 0x42000 | __asm ("sbcvc lr, r3, aav.0x000000ff");
0x0001f820 lsrs r3, r3, 1 | r3 >>= 1;
0x0001f822 b 0x1f83a |
| while (r4 >= r2) {
0x0001f824 subs r4, r4, r2 | r4 -= r2;
0x0001f826 sbc.w r5, r5, r3 | __asm ("sbc.w r5, r5, r3");
0x0001f82a adds r4, r4, r4 | r4 += r4;
0x0001f82c adcs r5, r5 | __asm ("adcs r5, r5");
0x0001f82e adds r4, 1 | r4++;
0x0001f830 adc r5, r5, 0 | __asm ("adc r5, r5, 0");
0x0001f834 subs.w r8, r8, 1 | r8--;
| if (r8 == r8) {
0x0001f838 beq 0x1f84c | goto label_1;
| }
| label_0:
0x0001f83a cmp r4, r2 |
0x0001f83c sbcs.w sb, r5, r3 | __asm ("sbcs.w sb, r5, r3");
0x0001f840 bhs 0x1f824 |
| }
0x0001f842 adds r4, r4, r4 | r4 += r4;
0x0001f844 adcs r5, r5 | __asm ("adcs r5, r5");
0x0001f846 subs.w r8, r8, 1 | r8--;
| if (r8 != r8) {
0x0001f84a bne 0x1f83a | goto label_0;
| }
| label_1:
0x0001f84c adds r0, r0, r4 | r0 += r4;
0x0001f84e lsl.w lr, r5, lr | lr = r5 << lr;
0x0001f852 lsr.w r4, r4, r6 | r4 >>= r6;
0x0001f856 lsr.w ip, r5, ip |
0x0001f85a adc.w r1, r1, r5 | __asm ("adc.w r1, r1, r5");
0x0001f85e orr.w r4, r4, lr | r4 |= lr;
0x0001f862 lsrs r5, r6 | r5 >>= r6;
0x0001f864 orr.w r4, r4, ip | r4 |= ip;
0x0001f868 sub.w ip, r6, 0x20 |
0x0001f86c lsl.w ip, r4, ip |
0x0001f870 lsl.w r2, r5, r6 | r2 = r5 << r6;
0x0001f874 rsb.w r3, r6, 0x20 | r3 = 0x20 - r6;
0x0001f878 orr.w r2, r2, ip | r2 |= ip;
0x0001f87c lsr.w r3, r4, r3 | r3 = r4 >> r3;
0x0001f880 orrs r2, r3 | r2 |= r3;
0x0001f882 lsl.w r3, r4, r6 | r3 = r4 << r6;
0x0001f886 subs r0, r0, r3 | r0 -= r3;
0x0001f888 sbc.w r1, r1, r2 | __asm ("sbc.w r1, r1, r2");
| if (r7 != 0) {
0x0001f88c cbz r7, 0x1f892 |
0x0001f88e strd r4, r5, [r7] | __asm ("strd r4, r5, [r7]");
| }
0x0001f892 pop.w {r4, r5, r6, r7, r8, sb, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xe888 */
| #include <stdint.h>
|
; (fcn) fcn.0000e888 () | void fcn_0000e888 (int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0000e888 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000e88c mov r6, r1 | r6 = r1;
0x0000e88e ldr r7, [r0] | r7 = *(r0);
0x0000e890 sub sp, 0x14 |
0x0000e892 mov r5, r0 | r5 = r0;
0x0000e894 and r1, r2, 8 | r1 = r2 & 8;
0x0000e898 and sb, r2, 1 | sb = r2 & 1;
0x0000e89c and r4, r2, 2 | r4 = r2 & 2;
0x0000e8a0 ldrb.w sl, [r7] | sl = *(r7);
0x0000e8a4 cmp.w sl, 0x5b |
| if (sl == 0x5b) {
0x0000e8a8 beq 0xe944 | goto label_12;
| }
0x0000e8aa cmp.w sl, 0x3f |
| if (sl == 0x3f) {
0x0000e8ae beq 0xe914 | goto label_13;
| }
0x0000e8b0 eor r3, sb, 1 | r3 = sb ^ 1;
0x0000e8b4 cmp.w sl, 0x5c |
0x0000e8b8 ite ne |
| if (sl == 0x5c) {
0x0000e8ba movne r3, 0 | r3 = 0;
| }
| if (sl != 0x5c) {
0x0000e8bc andeq r3, r3, 1 | r3 &= 1;
| }
0x0000e8c0 cmp r3, 0 |
| if (r3 != 0) {
0x0000e8c2 bne.w 0xea3c | goto label_14;
| }
| do {
| label_6:
0x0000e8c6 ldr r3, [r6] | r3 = *(r6);
0x0000e8c8 ldrb.w r8, [r3] | r8 = *(r3);
0x0000e8cc cmp r8, sl |
0x0000e8ce it eq |
| if (r8 != sl) {
0x0000e8d0 moveq r0, 0 | r0 = 0;
| }
| if (r8 != sl) {
0x0000e8d2 beq 0xe902 |
| label_8:
0x0000e8d4 cmp r1, 0 |
| if (r1 == 0) {
0x0000e8d6 beq 0xe98a | goto label_15;
| }
0x0000e8d8 blx 0xa3a8 | r0 = fcn_0000a3a8 ();
0x0000e8dc ldr r3, [r0] | r3 = *(r0);
0x0000e8de sxth.w sb, r8 | __asm ("sxth.w sb, r8");
0x0000e8e2 sxth.w fp, sl | __asm ("sxth.w fp, sl");
0x0000e8e6 ldrh.w r2, [r3, sb, lsl 1] | offset_0 = sb << 1;
| r2 = *((r3 + offset_0));
0x0000e8ea lsls r2, r2, 0x17 | r2 <<= 0x17;
| if (r2 >= r2) {
0x0000e8ec bpl 0xe982 | goto label_16;
| }
| label_2:
0x0000e8ee blx 0xa330 | r0 = fcn_0000a330 ();
0x0000e8f2 ldr r3, [r0] | r3 = *(r0);
0x0000e8f4 ldr.w r0, [r3, sb, lsl 2] | offset_1 = sb << 2;
| r0 = *((r3 + offset_1));
0x0000e8f8 ldr.w r3, [r3, fp, lsl 2] | offset_2 = fp << 2;
| r3 = *((r3 + offset_2));
0x0000e8fc subs r0, r0, r3 | r0 -= r3;
0x0000e8fe it ne |
| if (r0 != r0) {
0x0000e900 movne r0, 1 | r0 = 1;
| goto label_3;
| }
| }
| label_3:
0x0000e902 cmp.w r8, 0 |
0x0000e906 it ne |
| if (r8 != 0) {
0x0000e908 cmpne sl, 0 | __asm ("cmpne sl, 0");
| }
| if (r8 != 0) {
0x0000e90c bne 0xe970 | goto label_17;
| }
| label_1:
0x0000e90e add sp, 0x14 |
0x0000e910 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_13:
0x0000e914 ldr r3, [r6] | r3 = *(r6);
0x0000e916 ldrb r0, [r3] | r0 = *(r3);
0x0000e918 cmp r0, 0 |
| if (r0 == 0) {
0x0000e91a beq.w 0xea34 | goto label_18;
| }
0x0000e91e sub.w r0, r0, 0x2f | r0 -= 0x2f;
0x0000e922 cmp r4, 0 |
0x0000e924 clz r0, r0 | r0 &= r0;
0x0000e928 lsr.w r0, r0, 5 | r0 >>= 5;
0x0000e92c it eq |
| if (r4 != 0) {
0x0000e92e moveq r0, 0 | r0 = 0;
| }
0x0000e930 cmp r0, 0 |
| if (r0 != 0) {
0x0000e932 bne 0xea34 | goto label_18;
| }
| label_0:
0x0000e934 adds r7, 1 | r7++;
0x0000e936 str r7, [r5] | *(r5) = r7;
0x0000e938 ldr r3, [r6] | r3 = *(r6);
0x0000e93a adds r3, 1 | r3++;
0x0000e93c str r3, [r6] | *(r6) = r3;
0x0000e93e add sp, 0x14 |
0x0000e940 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_12:
0x0000e944 adds r3, r7, 1 | r3 = r7 + 1;
0x0000e946 str r3, [r0] | *(r0) = r3;
0x0000e948 ldrb r2, [r7, 1] | r2 = *((r7 + 1));
0x0000e94a cmp r2, 0x5e |
0x0000e94c it ne |
| if (r2 != 0x5e) {
0x0000e94e cmpne r2, 0x21 | __asm ("cmpne r2, 0x21");
| }
0x0000e950 ittte eq |
| if (r2 != 0x5e) {
0x0000e952 addeq r3, r7, 2 | r3 = r7 + 2;
| }
| if (r2 != 0x5e) {
0x0000e954 moveq r8, 1 | r8 = 1;
| }
| if (r2 == 0x5e) {
0x0000e958 strne r3, [r0] | *(r0) = r3;
| }
| if (r2 != 0x5e) {
0x0000e95a mov.w r8, 0 | r8 = 0;
| }
0x0000e95e it eq |
| if (r2 != 0x5e) {
0x0000e960 ldrbeq r2, [r7, 2] | r2 = *((r7 + 2));
| }
0x0000e962 cmp r2, 0x5d |
| if (r2 == 0x5d) {
0x0000e964 beq 0xea4c | goto label_19;
| }
| if (r2 != 0) {
0x0000e966 cbnz r2, 0xe98e | goto label_20;
| }
| label_4:
0x0000e968 str r7, [r5] | *(r5) = r7;
0x0000e96a ldrb.w sl, [r7] | sl = *(r7);
0x0000e96e b 0xe8c6 |
| } while (1);
| label_17:
0x0000e970 cmp r4, 0 |
| if (r4 == 0) {
0x0000e972 beq 0xe934 | goto label_0;
| }
0x0000e974 cmp.w r8, 0x2f |
0x0000e978 it ne |
| if (r8 == 0x2f) {
0x0000e97a cmpne sl, 0x2f | __asm ("cmpne sl, 0x2f");
| goto label_21;
| }
| if (r8 != 0x2f) {
| label_21:
0x0000e97e bne 0xe934 | goto label_0;
| }
0x0000e980 b 0xe90e | goto label_1;
| label_16:
0x0000e982 ldrh.w r3, [r3, fp, lsl 1] | offset_3 = fp << 1;
| r3 = *((r3 + offset_3));
0x0000e986 lsls r3, r3, 0x17 | r3 <<= 0x17;
| if (r3 < r3) {
0x0000e988 bmi 0xe8ee | goto label_2;
| }
| label_15:
0x0000e98a movs r0, 1 | r0 = 1;
0x0000e98c b 0xe902 | goto label_3;
| label_20:
0x0000e98e mov.w fp, 1 |
| label_5:
0x0000e992 eor r0, sb, 1 | r0 = sb ^ 1;
0x0000e996 cmp r2, 0x5c |
0x0000e998 ite ne |
| if (r2 == 0x5c) {
0x0000e99a movne r0, 0 | r0 = 0;
| }
| if (r2 != 0x5c) {
0x0000e99c andeq r0, r0, 1 | r0 &= 1;
| }
0x0000e9a0 cmp r0, 0 |
| if (r0 != 0) {
0x0000e9a2 bne.w 0xeb24 | goto label_22;
| }
0x0000e9a6 ldr r3, [r5] | r3 = *(r5);
| if (r4 == 0) {
| label_11:
0x0000e9a8 cbz r4, 0xe9b0 | goto label_7;
| }
0x0000e9aa ldrb r2, [r3] | r2 = *(r3);
0x0000e9ac cmp r2, 0x2f |
| if (r2 == 0x2f) {
0x0000e9ae beq 0xe968 | goto label_4;
| }
| label_7:
0x0000e9b0 ldrb r2, [r3, 1] | r2 = *((r3 + 1));
0x0000e9b2 cmp r2, 0x2d |
| if (r2 == 0x2d) {
0x0000e9b4 beq 0xea68 | goto label_23;
| }
| label_9:
0x0000e9b6 ldr r2, [r6] | r2 = *(r6);
0x0000e9b8 ldrb.w sl, [r2] | sl = *(r2);
0x0000e9bc ldrb r2, [r3] | r2 = *(r3);
0x0000e9be cmp sl, r2 |
0x0000e9c0 str r2, [sp] | *(sp) = r2;
0x0000e9c2 it eq |
| if (sl != r2) {
0x0000e9c4 moveq fp, 0 |
| }
| if (sl != r2) {
0x0000e9c8 beq 0xea16 |
| if (r1 == 0) {
0x0000e9ca cbz r1, 0xea16 | goto label_24;
| }
0x0000e9cc strd r1, r3, [sp, 4] | __asm ("strd r1, r3, [var_4h]");
0x0000e9d0 sxth.w sl, sl | __asm ("sxth.w sl, sl");
0x0000e9d4 blx 0xa3a8 | r0 = fcn_0000a3a8 ();
0x0000e9d8 ldr r0, [r0] | r0 = *(r0);
0x0000e9da ldr r2, [sp] | r2 = *(sp);
0x0000e9dc ldrd r1, r3, [sp, 4] | __asm ("ldrd r1, r3, [var_4h]");
0x0000e9e0 ldrh.w ip, [r0, sl, lsl 1] | offset_4 = sl << 1;
| ip = *((r0 + offset_4));
0x0000e9e4 sxth r2, r2 | __asm ("sxth r2, r2");
0x0000e9e6 tst.w ip, 0x100 |
| if ((ip & 0x100) == 0) {
0x0000e9ea bne 0xe9f4 |
0x0000e9ec ldrh.w r0, [r0, r2, lsl 1] | offset_5 = r2 << 1;
| r0 = *((r0 + offset_5));
0x0000e9f0 lsls r0, r0, 0x17 | r0 <<= 0x17;
| if (r0 >= r0) {
0x0000e9f2 bpl 0xea16 | goto label_24;
| }
| }
0x0000e9f4 strd r3, r2, [sp, 4] | __asm ("strd r3, r2, [var_4h]");
0x0000e9f8 str r1, [sp] | *(sp) = r1;
0x0000e9fa blx 0xa330 | fcn_0000a330 ();
0x0000e9fe ldr r2, [sp, 8] | r2 = var_8h;
0x0000ea00 ldr r0, [r0] | r0 = *(r0);
0x0000ea02 ldrd r1, r3, [sp] | __asm ("ldrd r1, r3, [sp]");
0x0000ea06 ldr.w ip, [r0, r2, lsl 2] | offset_6 = r2 << 2;
| ip = *((r0 + offset_6));
0x0000ea0a ldr.w r2, [r0, sl, lsl 2] | offset_7 = sl << 2;
| r2 = *((r0 + offset_7));
0x0000ea0e cmp ip, r2 |
0x0000ea10 it eq |
| if (ip == r2) {
0x0000ea12 moveq fp, 0 | goto label_24;
| }
| }
| label_24:
0x0000ea16 adds r3, 1 | r3++;
| label_10:
0x0000ea18 str r3, [r5] | *(r5) = r3;
0x0000ea1a ldrb r2, [r3] | r2 = *(r3);
0x0000ea1c cmp r2, 0 |
| if (r2 == 0) {
0x0000ea1e beq 0xe968 | goto label_4;
| }
0x0000ea20 cmp r2, 0x5d |
| if (r2 != 0x5d) {
0x0000ea22 bne 0xe992 | goto label_5;
| }
0x0000ea24 adds r3, 1 | r3++;
0x0000ea26 eor.w r0, r8, fp | r0 = r8 ^ fp;
0x0000ea2a str r3, [r5] | *(r5) = r3;
0x0000ea2c ldr r3, [r6] | r3 = *(r6);
0x0000ea2e adds r3, 1 | r3++;
0x0000ea30 str r3, [r6] | *(r6) = r3;
0x0000ea32 b 0xe90e | goto label_1;
| label_18:
0x0000ea34 movs r0, 1 | r0 = 1;
0x0000ea36 add sp, 0x14 |
0x0000ea38 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_14:
0x0000ea3c ldrb r0, [r7, 1] | r0 = *((r7 + 1));
| if (r0 != 0) {
0x0000ea3e cbz r0, 0xea52 |
0x0000ea40 adds r3, r7, 1 | r3 = r7 + 1;
0x0000ea42 str r3, [r5] | *(r5) = r3;
0x0000ea44 ldrb.w sl, [r7, 1] | sl = *((r7 + 1));
0x0000ea48 mov r7, r3 | r7 = r3;
0x0000ea4a b 0xe8c6 | goto label_6;
| label_19:
0x0000ea4c mov.w fp, 1 |
0x0000ea50 b 0xe9b0 | goto label_7;
| }
0x0000ea52 ldr r3, [r6] | r3 = *(r6);
0x0000ea54 ldrb.w r8, [r3] | r8 = *(r3);
0x0000ea58 cmp.w r8, 0x5c |
0x0000ea5c it ne |
| if (r8 != 0x5c) {
0x0000ea5e movne sl, 0x5c | sl = 0x5c;
| goto label_25;
| }
| if (r8 != 0x5c) {
| label_25:
0x0000ea62 bne.w 0xe8d4 | goto label_8;
| }
0x0000ea66 b 0xe934 | goto label_0;
| label_23:
0x0000ea68 ldrb r2, [r3, 2] | r2 = *((r3 + 2));
0x0000ea6a cmp r2, 0x5d |
| if (r2 == 0x5d) {
0x0000ea6c beq 0xe9b6 | goto label_9;
| }
0x0000ea6e eor r0, sb, 1 | r0 = sb ^ 1;
0x0000ea72 cmp r2, 0x5c |
0x0000ea74 ite ne |
| if (r2 == 0x5c) {
0x0000ea76 movne r0, 0 | r0 = 0;
| }
| if (r2 != 0x5c) {
0x0000ea78 andeq r0, r0, 1 | r0 &= 1;
| }
0x0000ea7c adds r0, 2 | r0 += 2;
0x0000ea7e adds r2, r3, r0 | r2 = r3 + r0;
0x0000ea80 str r2, [r5] | *(r5) = r2;
0x0000ea82 ldrb.w sl, [r3, r0] | sl = *((r3 + r0));
0x0000ea86 cmp.w sl, 0 |
| if (sl == 0) {
0x0000ea8a beq.w 0xe968 | goto label_4;
| }
0x0000ea8e sub.w ip, sl, 0x2f |
0x0000ea92 cmp r4, 0 |
0x0000ea94 clz ip, ip |
0x0000ea98 lsr.w ip, ip, 5 |
0x0000ea9c it eq |
| if (r4 != 0) {
0x0000ea9e moveq ip, 0 |
| }
0x0000eaa2 cmp.w ip, 0 |
| if (ip != 0) {
0x0000eaa6 bne.w 0xe968 | goto label_4;
| }
0x0000eaaa ldr r0, [r6] | r0 = *(r6);
0x0000eaac ldrb r3, [r3] | r3 = *(r3);
0x0000eaae ldrb r0, [r0] | r0 = *(r0);
0x0000eab0 str r3, [sp] | *(sp) = r3;
0x0000eab2 cmp r0, r3 |
0x0000eab4 it hs |
| if (r0 >= r3) {
0x0000eab6 cmphs sl, r0 | __asm ("cmphs sl, r0");
| }
0x0000eab8 it hs |
| if (r0 < r3) {
0x0000eaba movhs fp, ip |
| }
| if (r0 < r3) {
0x0000eabc bhs 0xeb20 |
| if (r1 == 0) {
0x0000eabe cbz r1, 0xeb20 | goto label_26;
| }
0x0000eac0 sxth r3, r0 | __asm ("sxth r3, r0");
0x0000eac2 strd r1, r2, [sp, 8] | __asm ("strd r1, r2, [var_8h]");
0x0000eac6 str r3, [sp, 4] | var_4h = r3;
0x0000eac8 blx 0xa3a8 | fcn_0000a3a8 ();
0x0000eacc ldr r3, [sp, 4] | r3 = var_4h;
0x0000eace ldr r0, [r0] | r0 = *(r0);
0x0000ead0 ldrd r1, r2, [sp, 8] | __asm ("ldrd r1, r2, [var_8h]");
0x0000ead4 ldrh.w ip, [r0, r3, lsl 1] | offset_8 = r3 << 1;
| ip = *((r0 + offset_8));
0x0000ead8 ldr r3, [sp] | r3 = *(sp);
0x0000eada tst.w ip, 0x100 |
0x0000eade sxth r3, r3 | __asm ("sxth r3, r3");
| if ((ip & 0x100) == 0) {
0x0000eae0 bne 0xeaf4 |
0x0000eae2 ldrh.w ip, [r0, r3, lsl 1] | offset_9 = r3 << 1;
| ip = *((r0 + offset_9));
0x0000eae6 tst.w ip, 0x100 |
| if ((ip & 0x100) != 0) {
0x0000eaea bne 0xeaf4 | goto label_27;
| }
0x0000eaec ldrh.w r0, [r0, sl, lsl 1] | offset_10 = sl << 1;
| r0 = *((r0 + offset_10));
0x0000eaf0 lsls r0, r0, 0x17 | r0 <<= 0x17;
| if (r0 >= r0) {
0x0000eaf2 bpl 0xeb20 | goto label_26;
| }
| }
| label_27:
0x0000eaf4 strd r2, r3, [sp, 8] | __asm ("strd r2, r3, [var_8h]");
0x0000eaf8 str r1, [sp] | *(sp) = r1;
0x0000eafa blx 0xa330 | fcn_0000a330 ();
0x0000eafe ldr r3, [sp, 4] | r3 = var_4h;
0x0000eb00 ldr r0, [r0] | r0 = *(r0);
0x0000eb02 ldr r1, [sp] | r1 = *(sp);
0x0000eb04 ldr r2, [sp, 8] | r2 = var_8h;
0x0000eb06 ldr.w ip, [r0, r3, lsl 2] | offset_11 = r3 << 2;
| ip = *((r0 + offset_11));
0x0000eb0a ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000eb0c ldr.w r3, [r0, r3, lsl 2] | offset_12 = r3 << 2;
| r3 = *((r0 + offset_12));
0x0000eb10 cmp ip, r3 |
| if (ip < r3) {
0x0000eb12 blt 0xeb20 | goto label_26;
| }
0x0000eb14 ldr.w r3, [r0, sl, lsl 2] | offset_13 = sl << 2;
| r3 = *((r0 + offset_13));
0x0000eb18 cmp r3, ip |
0x0000eb1a it ge |
| if (r3 >= ip) {
0x0000eb1c movge fp, 0 | goto label_26;
| }
| }
| label_26:
0x0000eb20 adds r3, r2, 1 | r3 = r2 + 1;
0x0000eb22 b 0xea18 | goto label_10;
| label_22:
0x0000eb24 adds r2, r3, 1 | r2 = r3 + 1;
0x0000eb26 str r2, [r5] | *(r5) = r2;
0x0000eb28 ldrb r3, [r3, 1] | r3 = *((r3 + 1));
0x0000eb2a cmp r3, 0 |
| if (r3 == 0) {
0x0000eb2c beq.w 0xe968 | goto label_4;
| }
0x0000eb30 mov r3, r2 | r3 = r2;
0x0000eb32 b 0xe9a8 | goto label_11;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xf068 */
| #include <stdint.h>
|
; (fcn) fcn.0000f068 () | void fcn_0000f068 (int16_t arg1, int16_t arg2, int16_t arg3, uint32_t arg4) {
| int16_t var_1ch;
| int16_t var_4h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000f068 push.w {r4, r5, r6, r7, r8, sb, lr} |
0x0000f06c movs r5, 1 | r5 = 1;
0x0000f06e lsls r5, r2 | r5 <<= r2;
0x0000f070 cmp r3, 0x58 |
0x0000f072 mov ip, r0 |
0x0000f074 ldr.w sb, [sp, 0x1c] | sb = var_1ch;
0x0000f078 add.w r5, r5, -1 | r5 += -1;
| if (r3 == 0x58) {
0x0000f07c beq 0xf0c4 | goto label_2;
| }
| if (r1 == 0) {
0x0000f07e cbz r1, 0xf0ce | goto label_3;
| }
0x0000f080 ldr r6, [pc, 0x74] |
0x0000f082 add r6, pc | r6 = 0x1e17e;
0x0000f084 adds r6, 0x28 | r6 += 0x28;
| label_0:
0x0000f086 mov r0, sb | r0 = sb;
0x0000f088 rsb.w r8, r2, 0x20 | r8 = 0x20 - r2;
0x0000f08c sub.w r7, r2, 0x20 | r7 = r2 - 0x20;
| do {
0x0000f090 lsr.w lr, ip, r2 | lr = ip >> r2;
0x0000f094 lsl.w r4, r1, r8 | r4 = r1 << r8;
0x0000f098 and.w ip, r5, ip |
0x0000f09c orr.w lr, lr, r4 | lr |= r4;
0x0000f0a0 ldrb.w r3, [r6, ip] | r3 = *((r6 + ip));
0x0000f0a4 lsr.w ip, r1, r7 |
0x0000f0a8 lsrs r1, r2 | r1 >>= r2;
0x0000f0aa orr.w ip, lr, ip |
0x0000f0ae strb r3, [r0, -0x1]! | *((r0 -= 0x1)) = r3;
0x0000f0b2 orrs.w r3, ip, r1 | r3 = ip | r1;
0x0000f0b6 bne 0xf090 |
| } while (r3 != ip);
0x0000f0b8 ldr r2, [sp, 0x20] | r2 = var_4h;
0x0000f0ba sub.w r3, sb, r0 | r3 = sb - r0;
0x0000f0be str r3, [r2] | *(r2) = r3;
0x0000f0c0 pop.w {r4, r5, r6, r7, r8, sb, pc} |
| if (r1 == 0) {
| label_2:
0x0000f0c4 cbz r1, 0xf0f2 | goto label_4;
| }
0x0000f0c6 ldr r6, [pc, 0x34] |
0x0000f0c8 add r6, pc | r6 = 0x1e1ca;
0x0000f0ca adds r6, 0x3c | r6 += 0x3c;
0x0000f0cc b 0xf086 | goto label_0;
| label_3:
0x0000f0ce ldr r1, [pc, 0x30] |
0x0000f0d0 add r1, pc | r1 = 0x1e1d6;
0x0000f0d2 adds r1, 0x14 | r1 += 0x14;
| label_1:
0x0000f0d4 mov r0, sb | r0 = sb;
| do {
0x0000f0d6 and.w r3, ip, r5 | r3 = ip & r5;
0x0000f0da lsrs.w ip, ip, r2 |
0x0000f0de ldrb r3, [r1, r3] | r3 = *((r1 + r3));
0x0000f0e0 strb r3, [r0, -0x1]! | *((r0 -= 0x1)) = r3;
0x0000f0e4 bne 0xf0d6 |
| } while (ip != ip);
0x0000f0e6 ldr r2, [sp, 0x20] | r2 = var_4h;
0x0000f0e8 sub.w r3, sb, r0 | r3 = sb - r0;
0x0000f0ec str r3, [r2] | *(r2) = r3;
0x0000f0ee pop.w {r4, r5, r6, r7, r8, sb, pc} |
| label_4:
0x0000f0f2 ldr r1, [pc, 0x10] |
0x0000f0f4 add r1, pc | r1 = 0x1e1fe;
0x0000f0f6 b 0xf0d4 | goto label_1;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xf110 */
| #include <stdint.h>
|
; (fcn) fcn.0000f110 () | void fcn_0000f110 (int16_t arg_50h, uint32_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_8h;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000f110 cmp r0, 0x4e |
0x0000f112 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0000f116 it ge |
| if (r0 < 0x4e) {
0x0000f118 movge r0, 0x4e | r0 = 0x4e;
| }
0x0000f11a ldr r4, [pc, 0x1e4] |
0x0000f11c mov r8, r0 | r8 = r0;
0x0000f11e mov r7, r3 | r7 = r3;
0x0000f120 ldr r0, [pc, 0x1e0] | r0 = *(0xf304);
0x0000f122 mov r6, r1 | r6 = r1;
0x0000f124 add r4, pc | r4 = 0x1e42a;
0x0000f126 vpush {d8, d9, d10} | __asm ("vpush {d8, d9, d10}");
0x0000f12a vcmpe.f64 d0, 0 | __asm ("vcmpe.f64 d0, 0");
0x0000f12e sub sp, 0x18 |
0x0000f130 ldr r0, [r4, r0] |
0x0000f132 mov sb, sp | sb = sp;
0x0000f134 vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
0x0000f138 ite pl |
| if (r0 < 0x4e) {
0x0000f13a movpl r3, 0 | r3 = 0;
| }
| if (r0 >= 0x4e) {
0x0000f13c movmi r3, 1 | r3 = 1;
| }
0x0000f13e ldr r0, [r0] | r0 = *(0x1e42a);
0x0000f140 str r0, [sp, 0x14] | var_14h = r0;
0x0000f142 mov.w r0, 0 | r0 = 0;
0x0000f146 it mi |
| if (r0 < 0x4e) {
0x0000f148 vnegmi d0, d0 | __asm ("vnegmi d0, d0");
| }
0x0000f14c mov r0, sb | r0 = sb;
0x0000f14e str r3, [r2] | *(r2) = r3;
0x0000f150 ldr r5, [sp, 0x50] | r5 = *(arg_50h);
0x0000f152 blx 0xa33c | fcn_0000a33c ();
0x0000f156 vmov.f64 d9, d0 | __asm ("vmov.f64 d9, d0");
0x0000f15a vldr d0, [sp] | __asm ("vldr d0, [sp]");
0x0000f15e vcmp.f64 d0, 0 | __asm ("vcmp.f64 d0, 0");
0x0000f162 vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
| if (r0 == 0x4e) {
0x0000f166 beq.w 0xf294 | goto label_3;
| }
0x0000f16a vldr d8, [pc, 0x18c] | __asm ("vldr d8, aav.0x000000ff");
0x0000f16e add.w r4, r5, 0x50 | r4 = r5 + 0x50;
0x0000f172 vmov.f64 d10, 1.000000e+01 | __asm ("vmov.f64 d10, 1");
0x0000f176 mov sl, r4 | sl = r4;
| do {
0x0000f178 vdiv.f64 d0, d0, d10 | __asm ("vdiv.f64 d0, d0, d10");
0x0000f17c mov r0, sb | r0 = sb;
0x0000f17e blx 0xa33c | fcn_0000a33c ();
0x0000f182 vadd.f64 d16, d0, d8 | __asm ("vadd.f64 d16, d0, d8");
0x0000f186 mov r3, sl | r3 = sl;
0x0000f188 vstr d0, [sp, 8] | __asm ("vstr d0, [sp, 8]");
0x0000f18c vmul.f64 d16, d16, d10 | __asm ("vmul.f64 d16, d16, d10");
0x0000f190 vcvt.s32.f64 s15, d16 | __asm ("vcvt.s32.f64 s15, d16");
0x0000f194 vmov r2, s15 | __asm ("vmov r2, s15");
0x0000f198 adds r2, 0x30 | r2 += 0x30;
0x0000f19a uxtb r2, r2 | r2 = (int8_t) r2;
0x0000f19c strb r2, [sl, -0x1]! | *((sl -= 0x1)) = r2;
0x0000f1a0 cmp r5, sl |
0x0000f1a2 rsb.w r1, sl, 0x50 | r1 = 0x50 - sl;
0x0000f1a6 add r1, r5 | r1 += r5;
| if (r5 == sl) {
0x0000f1a8 beq 0xf1b8 | goto label_4;
| }
0x0000f1aa vldr d0, [sp] | __asm ("vldr d0, [sp]");
0x0000f1ae vcmp.f64 d0, 0 | __asm ("vcmp.f64 d0, 0");
0x0000f1b2 vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
0x0000f1b6 bne 0xf178 |
| } while (r5 != sl);
| label_4:
0x0000f1b8 cmp r4, sl |
| if (r4 < sl) {
0x0000f1ba bls.w 0xf2f0 | goto label_5;
| }
0x0000f1be mov r0, r5 | r0 = r5;
0x0000f1c0 b 0xf1c6 |
| while (r3 != r4) {
0x0000f1c2 ldrb r2, [r3], 1 | r2 = *(r3);
| r3++;
0x0000f1c6 cmp r3, r4 |
0x0000f1c8 strb r2, [r0], 1 | *(r0) = r2;
| r0++;
0x0000f1cc bne 0xf1c2 |
| }
0x0000f1ce sub.w r4, r3, sl | r4 = r3 - sl;
0x0000f1d2 add r4, r5 | r4 += r5;
| label_1:
0x0000f1d4 add.w sb, r5, r8 | sb = r5 + r8;
| if (r7 == 0) {
0x0000f1d8 cbnz r7, 0xf1dc |
0x0000f1da add sb, r1 | sb += r1;
| }
0x0000f1dc cmp sb, r5 |
| if (sb <= r5) {
0x0000f1de blo 0xf2dc | goto label_6;
| }
0x0000f1e0 cmp r4, sb |
0x0000f1e2 add.w r8, r5, 0x50 | r8 = r5 + 0x50;
0x0000f1e6 str r1, [r6] | *(r6) = r1;
| if (r4 > sb) {
0x0000f1e8 bhi 0xf220 | goto label_7;
| }
0x0000f1ea cmp r4, r8 |
| if (r4 >= r8) {
0x0000f1ec bhs 0xf220 | goto label_7;
| }
0x0000f1ee vmov.f64 d8, 1.000000e+01 | __asm ("vmov.f64 d8, 1");
0x0000f1f2 add.w sl, sp, 8 | sl += var_8h;
0x0000f1f6 b 0xf1fc |
| while (sb >= r4) {
0x0000f1f8 cmp r4, r8 |
| if (r4 == r8) {
0x0000f1fa beq 0xf220 | goto label_7;
| }
0x0000f1fc vmul.f64 d0, d9, d8 | __asm ("vmul.f64 d0, d9, d8");
0x0000f200 mov r0, sl | r0 = sl;
0x0000f202 blx 0xa33c | fcn_0000a33c ();
0x0000f206 vldr d16, [sp, 8] | __asm ("vldr d16, [sp, 8]");
0x0000f20a vmov.f64 d9, d0 | __asm ("vmov.f64 d9, d0");
0x0000f20e vcvt.s32.f64 s15, d16 | __asm ("vcvt.s32.f64 s15, d16");
0x0000f212 vmov r3, s15 | __asm ("vmov r3, s15");
0x0000f216 adds r3, 0x30 | r3 += 0x30;
0x0000f218 strb r3, [r4], 1 | *(r4) = r3;
| r4++;
0x0000f21c cmp sb, r4 |
0x0000f21e bhs 0xf1f8 |
| }
| label_7:
0x0000f220 cmp sb, r8 |
| if (sb >= r8) {
0x0000f222 bhs 0xf2e8 | goto label_8;
| }
0x0000f224 ldrb.w r3, [sb] | r3 = *(sb);
0x0000f228 adds r3, 5 | r3 += 5;
0x0000f22a uxtb r3, r3 | r3 = (int8_t) r3;
0x0000f22c cmp r3, 0x39 |
0x0000f22e strb.w r3, [sb] | *(sb) = r3;
| if (r3 < 0x39) {
0x0000f232 bls 0xf26e | goto label_9;
| }
0x0000f234 mov r3, sb | r3 = sb;
0x0000f236 movs r1, 0x30 | r1 = 0x30;
0x0000f238 movs r0, 0x31 | r0 = 0x31;
0x0000f23a b 0xf24c |
| while (r5 <= r3) {
0x0000f23c ldrb r2, [r3, -0x1] | r2 = *((r3 - 0x1));
0x0000f240 subs r3, 1 | r3--;
0x0000f242 adds r2, 1 | r2++;
0x0000f244 uxtb r2, r2 | r2 = (int8_t) r2;
0x0000f246 cmp r2, 0x39 |
0x0000f248 strb r2, [r3] | *(r3) = r2;
| if (r2 < 0x39) {
0x0000f24a bls 0xf26e | goto label_9;
| }
| label_0:
0x0000f24c cmp r5, r3 |
0x0000f24e strb r1, [r3] | *(r3) = r1;
0x0000f250 blo 0xf23c |
| }
0x0000f252 strb r0, [r3] | *(r3) = r0;
0x0000f254 ldr r2, [r6] | r2 = *(r6);
0x0000f256 adds r2, 1 | r2++;
0x0000f258 str r2, [r6] | *(r6) = r2;
| if (r7 == 0) {
0x0000f25a cbnz r7, 0xf268 |
0x0000f25c cmp r5, sb |
0x0000f25e add.w sb, sb, 1 | sb++;
0x0000f262 it lo |
| if (r5 < sb) {
0x0000f264 strblo r1, [sb, -0x1] | *((sb - 0x1)) = r1;
| goto label_10;
| }
| }
| label_10:
0x0000f268 ldrb r2, [r3] | r2 = *(r3);
0x0000f26a cmp r2, 0x39 |
| if (r2 > 0x39) {
0x0000f26c bhi 0xf24c | goto label_0;
| }
| label_9:
0x0000f26e movs r3, 0 | r3 = 0;
0x0000f270 strb.w r3, [sb] | *(sb) = r3;
| label_2:
0x0000f274 ldr r2, [pc, 0x90] |
0x0000f276 ldr r3, [pc, 0x8c] | r3 = *(0xf306);
0x0000f278 add r2, pc | r2 = 0x1e584;
0x0000f27a ldr r3, [r2, r3] | r3 = *(0x1e584);
0x0000f27c ldr r2, [r3] | r2 = *(0x1e584);
0x0000f27e ldr r3, [sp, 0x14] | r3 = var_14h;
0x0000f280 eors r2, r3 | r2 ^= r3;
0x0000f282 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0000f286 bne 0xf2f4 | goto label_11;
| }
0x0000f288 mov r0, r5 | r0 = r5;
0x0000f28a add sp, 0x18 |
0x0000f28c vpop {d8, d9, d10} | __asm ("vpop {d8, d9, d10}");
0x0000f290 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_3:
0x0000f294 vcmpe.f64 d9, 0 | __asm ("vcmpe.f64 d9, 0");
0x0000f298 vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
| if (r2 <= r3) {
0x0000f29c ble 0xf2d6 | goto label_12;
| }
0x0000f29e vmov.f64 d17, 1.000000e+01 | __asm ("vmov.f64 d17, 1");
0x0000f2a2 vmov.f64 d18, 1.000000e+00 | __asm ("vmov.f64 d18, 1");
0x0000f2a6 vmul.f64 d16, d9, d17 | __asm ("vmul.f64 d16, d9, d17");
0x0000f2aa vcmpe.f64 d16, d18 | __asm ("vcmpe.f64 d16, d18");
0x0000f2ae vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
0x0000f2b2 vstr d16, [sp, 8] | __asm ("vstr d16, [sp, 8]");
| if (r2 >= r3) {
0x0000f2b6 bpl 0xf2d6 | goto label_12;
| }
0x0000f2b8 movs r1, 0 | r1 = 0;
| do {
0x0000f2ba vmov.f64 d9, d16 | __asm ("vmov.f64 d9, d16");
0x0000f2be subs r1, 1 | r1--;
0x0000f2c0 vmul.f64 d16, d16, d17 | __asm ("vmul.f64 d16, d16, d17");
0x0000f2c4 vcmpe.f64 d16, d18 | __asm ("vcmpe.f64 d16, d18");
0x0000f2c8 vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
0x0000f2cc bmi 0xf2ba |
| } while (r1 < 1);
0x0000f2ce mov r4, r5 | r4 = r5;
0x0000f2d0 vstr d16, [sp, 8] | __asm ("vstr d16, [sp, 8]");
0x0000f2d4 b 0xf1d4 | goto label_1;
| label_12:
0x0000f2d6 mov r4, r5 | r4 = r5;
0x0000f2d8 movs r1, 0 | r1 = 0;
0x0000f2da b 0xf1d4 | goto label_1;
| label_6:
0x0000f2dc rsb.w r3, r8, 0 | r3 = r8 - ;
0x0000f2e0 movs r2, 0 | r2 = 0;
0x0000f2e2 str r3, [r6] | *(r6) = r3;
0x0000f2e4 strb r2, [r5] | *(r5) = r2;
0x0000f2e6 b 0xf274 | goto label_2;
| label_8:
0x0000f2e8 movs r3, 0 | r3 = 0;
0x0000f2ea strb.w r3, [r5, 0x4f] | *((r5 + 0x4f)) = r3;
0x0000f2ee b 0xf274 | goto label_2;
| label_5:
0x0000f2f0 mov r4, r5 | r4 = r5;
0x0000f2f2 b 0xf1d4 | goto label_1;
| label_11:
0x0000f2f4 blx 0x9e90 | fcn_00009e90 ();
0x0000f2f8 subs r0, r7, 2 | r0 = r7 - 2;
0x0000f2fa invalid |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x11df4 */
| #include <stdint.h>
|
; (fcn) fcn.00011df4 () | void fcn_00011df4 (int16_t arg_48h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_1h;
| int16_t var_0h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00011df4 svcmi 0xf0e92d | __asm ("svcmi aav.0x000000ff");
0x00011df8 mov fp, r2 |
0x00011dfa sub sp, 0x24 |
0x00011dfc ldr r2, [pc, 0x268] |
0x00011dfe mov r4, r0 | r4 = r0;
0x00011e00 mov sl, r3 | sl = r3;
0x00011e02 ldr r0, [sp, 0x48] | r0 = *(arg_48h);
0x00011e04 mov sb, r1 | sb = r1;
0x00011e06 ldr r3, [pc, 0x264] | r3 = *(0x1206e);
0x00011e08 add r2, pc | r2 = 0x23e74;
0x00011e0a str r0, [sp, 0x10] | var_10h = r0;
0x00011e0c ldr r3, [r2, r3] |
0x00011e0e ldr r3, [r3] | r3 = *(0x23e74);
0x00011e10 str r3, [sp, 0x1c] | var_1ch = r3;
0x00011e12 mov.w r3, 0 | r3 = 0;
0x00011e16 ldrd r8, r3, [r4, 8] | __asm ("ldrd r8, r3, [r4, 8]");
0x00011e1a cmp.w r8, 0 |
| if (r8 != 0) {
0x00011e1e bne 0x11ea4 | goto label_13;
| }
0x00011e20 mov.w r8, 1 | r8 = 1;
| if (r3 != 0) {
0x00011e24 cbnz r3, 0x11e62 | goto label_2;
| }
| label_3:
0x00011e26 ldr r3, [pc, 0x248] |
0x00011e28 movs r6, 1 | r6 = 1;
0x00011e2a ldr r5, [pc, 0x248] |
0x00011e2c mov r7, r6 | r7 = r6;
0x00011e2e add r3, pc |
0x00011e30 ldr r3, [r3] | r3 = *(0x23ea4);
0x00011e32 add r5, pc | r5 = 0x23eac;
0x00011e34 b 0x11e52 |
| while (r3 <= 0x1f) {
0x00011e36 ldr r2, [pc, 0x240] |
0x00011e38 lsl.w r1, r7, r3 | r1 = r7 << r3;
0x00011e3c adds r3, 1 | r3++;
0x00011e3e add r2, pc | r2 = 0x23ebc;
0x00011e40 ldr r0, [r2] | r0 = *(0x23ebc);
| label_0:
0x00011e42 ldr r2, [pc, 0x238] |
0x00011e44 tst r1, r0 |
0x00011e46 add r2, pc | r2 = 0x23ec8;
0x00011e48 str r3, [r2] | *(r2) = r3;
| if ((r1 & r0) == 0) {
0x00011e4a beq 0x11eb0 | goto label_14;
| }
0x00011e4c adds r6, 1 | r6++;
0x00011e4e cmp r6, r8 |
| if (r6 > r8) {
0x00011e50 bgt 0x11eb0 | goto label_14;
| }
0x00011e52 cmp r3, 0x1f |
0x00011e54 ble 0x11e36 |
| }
0x00011e56 blx 0xa720 | fcn_0000a720 ();
0x00011e5a movs r3, 1 | r3 = 1;
0x00011e5c str r0, [r5] | *(r5) = r0;
0x00011e5e mov r1, r3 | r1 = r3;
0x00011e60 b 0x11e42 | goto label_0;
| label_2:
0x00011e62 cmp r3, 1 |
| if (r3 <= 1) {
0x00011e64 ble 0x11eae | goto label_15;
| }
0x00011e66 ldr r3, [pc, 0x218] |
0x00011e68 movs r6, 1 | r6 = 1;
0x00011e6a ldr r5, [pc, 0x218] |
0x00011e6c mov r7, r6 | r7 = r6;
0x00011e6e add r3, pc |
0x00011e70 ldr r3, [r3] | r3 = *(0x23ef4);
0x00011e72 add r5, pc | r5 = 0x23efc;
0x00011e74 b 0x11e94 |
| while (r3 <= 0x1f) {
0x00011e76 ldr r2, [pc, 0x210] |
0x00011e78 lsl.w r1, r7, r3 | r1 = r7 << r3;
0x00011e7c adds r3, 1 | r3++;
0x00011e7e add r2, pc | r2 = 0x23f0c;
0x00011e80 ldr r0, [r2] | r0 = *(0x23f0c);
| label_1:
0x00011e82 ldr r2, [pc, 0x208] |
0x00011e84 tst r1, r0 |
0x00011e86 add r2, pc | r2 = 0x23f18;
0x00011e88 str r3, [r2] | *(r2) = r3;
| if ((r1 & r0) == 0) {
0x00011e8a beq 0x11eb0 | goto label_14;
| }
0x00011e8c ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
0x00011e8e adds r6, 1 | r6++;
0x00011e90 cmp r2, r6 |
| if (r2 <= r6) {
0x00011e92 ble 0x11eb0 | goto label_14;
| }
0x00011e94 cmp r3, 0x1f |
0x00011e96 ble 0x11e76 |
| }
0x00011e98 blx 0xa720 | fcn_0000a720 ();
0x00011e9c movs r3, 1 | r3 = 1;
0x00011e9e str r0, [r5] | *(r5) = r0;
0x00011ea0 mov r1, r3 | r1 = r3;
0x00011ea2 b 0x11e82 | goto label_1;
| label_13:
0x00011ea4 cmp r3, 0 |
| if (r3 != 0) {
0x00011ea6 bne 0x11e62 | goto label_2;
| }
0x00011ea8 cmp.w r8, 0 |
| if (r8 > 0) {
0x00011eac bgt 0x11e26 | goto label_3;
| }
| label_15:
0x00011eae movs r6, 1 | r6 = 1;
| label_14:
0x00011eb0 ldr r5, [r4, 0x14] | r5 = *((r4 + 0x14));
| if (r5 == 0) {
0x00011eb2 cbz r5, 0x11ee0 | goto label_7;
| }
0x00011eb4 add.w r3, r4, 0x3c | r3 = r4 + 0x3c;
0x00011eb8 str r3, [sp, 0xc] | var_ch = r3;
| do {
| label_6:
0x00011eba ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00011ebc cmp r3, 0 |
| if (r3 == 0) {
0x00011ebe beq 0x11fa4 | goto label_16;
| }
0x00011ec0 ldr r1, [r3] | r1 = *(r3);
0x00011ec2 mov r0, sb | r0 = sb;
0x00011ec4 blx fp | r0 = fp (r0, r1);
0x00011ec6 subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 != r0) {
0x00011ec8 bne 0x11fa2 | goto label_17;
| }
0x00011eca cmp.w sl, 0 |
| if (sl == 0) {
0x00011ece beq.w 0x1205c | goto label_18;
| }
0x00011ed2 cmp.w sl, -1 |
| if (sl == -1) {
0x00011ed6 beq.w 0x12024 | goto label_19;
| }
| label_5:
0x00011eda ldr r5, [r5, 4] | r5 = *((r5 + 4));
| label_10:
0x00011edc cmp r5, 0 |
0x00011ede bne 0x11eba |
| } while (r5 != 0);
| label_7:
0x00011ee0 ldr r3, [r4, 0x44] | r3 = *((r4 + 0x44));
0x00011ee2 movs r7, 0 | r7 = 0;
0x00011ee4 str r7, [sp, 0x18] | var_18h = r7;
0x00011ee6 mov fp, r3 |
| if (r3 == 0) {
0x00011ee8 cbz r3, 0x11f30 | goto label_20;
| }
0x00011eea mov fp, r7 |
0x00011eec mov r8, r7 | r8 = r7;
0x00011eee mov r5, sb | r5 = sb;
| do {
0x00011ef0 ldr r2, [r4, 0x3c] | r2 = *((r4 + 0x3c));
0x00011ef2 subs r3, 1 | r3--;
0x00011ef4 str r3, [r4, 0x44] | *((r4 + 0x44)) = r3;
0x00011ef6 ldr.w r7, [r2, r3, lsl 2] | offset_0 = r3 << 2;
| r7 = *((r2 + offset_0));
| if (r7 == 0) {
0x00011efa cbz r7, 0x11f2e | goto label_21;
| }
0x00011efc mov r0, r4 | r0 = r4;
0x00011efe bl 0x11924 | fcn_00011924 (r0);
0x00011f02 ldr r3, [r7, 4] | r3 = *((r7 + 4));
0x00011f04 str r3, [r0, 4] | *((r0 + 4)) = r3;
| if (r3 != 0) {
0x00011f06 cbz r3, 0x11f0a |
0x00011f08 str r0, [r3, 8] | *((r3 + 8)) = r0;
| }
0x00011f0a ldr r3, [sp, 0x18] | r3 = var_18h;
0x00011f0c str r0, [r7, 4] | *((r7 + 4)) = r0;
0x00011f0e str r7, [r0, 8] | *((r0 + 8)) = r7;
0x00011f10 strd r8, r8, [r0, 0x10] | __asm ("strd r8, r8, [r0, 0x10]");
0x00011f14 str.w r8, [r0, 0x18] | __asm ("str.w r8, [r0, 0x18]");
0x00011f18 str r3, [r0, 0xc] | *((r0 + 0xc)) = r3;
0x00011f1a cmp r3, 0 |
| if (r3 == 0) {
0x00011f1c beq.w 0x12058 | goto label_22;
| }
0x00011f20 str r0, [r3, 0x10] | *((r3 + 0x10)) = r0;
| label_11:
0x00011f22 ldr r3, [r4, 0x44] | r3 = *((r4 + 0x44));
0x00011f24 str r5, [r0] | *(r0) = r5;
0x00011f26 str r4, [r0, 0x1c] | *((r0 + 0x1c)) = r4;
0x00011f28 str r0, [sp, 0x18] | var_18h = r0;
0x00011f2a cmp r3, 0 |
0x00011f2c bne 0x11ef0 |
| } while (r3 != 0);
| label_21:
0x00011f2e mov sb, r5 | sb = r5;
| label_20:
0x00011f30 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011f32 cmp r6, r3 |
| if (r6 <= r3) {
0x00011f34 ble 0x11fc4 | goto label_23;
| }
0x00011f36 mov r8, r4 | r8 = r4;
0x00011f38 movs r7, 0 | r7 = 0;
0x00011f3a mov r4, sb | r4 = sb;
0x00011f3c b 0x11f70 |
| while (r3 != 0) {
0x00011f3e str r5, [r3, 0x10] | *((r3 + 0x10)) = r5;
| label_4:
0x00011f40 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00011f42 str r5, [r0, 8] | *((r0 + 8)) = r5;
0x00011f44 str.w r5, [r8, 0x1c] | __asm ("str.w r5, [r8, 0x1c]");
0x00011f48 str.w r5, [r8, 0x14] | __asm ("str.w r5, [r8, 0x14]");
0x00011f4c strd r7, r7, [r0, 0x14] | __asm ("strd r7, r7, [r0, 0x14]");
0x00011f50 str r7, [r0, 4] | *((r0 + 4)) = r7;
0x00011f52 strd r3, r7, [r0, 0xc] | __asm ("strd r3, r7, [r0, 0xc]");
0x00011f56 str r4, [r0] | *(r0) = r4;
0x00011f58 str.w r8, [r0, 0x1c] | __asm ("str.w r8, [r0, 0x1c]");
| if (r3 == 0) {
0x00011f5c cbz r3, 0x11fbe | goto label_24;
| }
0x00011f5e str r0, [r3, 0x10] | *((r3 + 0x10)) = r0;
| label_9:
0x00011f60 ldr.w r3, [r8, 8] | r3 = *((r8 + 8));
0x00011f64 str r0, [sp, 0x18] | var_18h = r0;
0x00011f66 adds r3, 1 | r3++;
0x00011f68 cmp r3, r6 |
0x00011f6a str.w r3, [r8, 8] | __asm ("str.w r3, [r8, 8]");
| if (r3 >= r6) {
0x00011f6e bge 0x11fc2 | goto label_25;
| }
0x00011f70 mov r0, r8 | r0 = r8;
0x00011f72 bl 0x11924 | r0 = fcn_00011924 (r0);
0x00011f76 mov r5, r0 | r5 = r0;
0x00011f78 mov r0, r8 | r0 = r8;
0x00011f7a bl 0x11924 | fcn_00011924 (r0);
0x00011f7e ldr.w r3, [r8, 0x14] | r3 = *((r8 + 0x14));
0x00011f82 strd r7, r7, [r5, 0x14] | __asm ("strd r7, r7, [r5, 0x14]");
0x00011f86 str r7, [r5, 8] | *((r5 + 8)) = r7;
0x00011f88 str r7, [r5, 0x10] | *((r5 + 0x10)) = r7;
0x00011f8a str r0, [r5, 4] | *((r5 + 4)) = r0;
0x00011f8c str r3, [r5, 0xc] | *((r5 + 0xc)) = r3;
0x00011f8e str r7, [r5] | *(r5) = r7;
0x00011f90 str.w r8, [r5, 0x1c] | __asm ("str.w r8, [r5, 0x1c]");
0x00011f94 cmp r3, 0 |
0x00011f96 bne 0x11f3e |
| }
0x00011f98 str.w r5, [r8, 0x20] | __asm ("str.w r5, [r8, 0x20]");
0x00011f9c str.w r5, [r8, 0x18] | __asm ("str.w r5, [r8, 0x18]");
0x00011fa0 b 0x11f40 | goto label_4;
| if (r3 >= 0) {
| label_17:
0x00011fa2 bge 0x11eda | goto label_5;
| }
| label_16:
0x00011fa4 cmp r6, r8 |
| if (r6 >= r8) {
0x00011fa6 bge 0x11fb4 | goto label_26;
| }
| label_8:
0x00011fa8 ldr r5, [r5, 0xc] | r5 = *((r5 + 0xc));
0x00011faa add.w r8, r8, -1 | r8 += -1;
0x00011fae cmp r5, 0 |
| if (r5 != 0) {
0x00011fb0 bne 0x11eba | goto label_6;
| }
0x00011fb2 b 0x11ee0 | goto label_7;
| label_26:
0x00011fb4 ldr r0, [sp, 0xc] | r0 = var_ch;
0x00011fb6 mov r1, r5 | r1 = r5;
0x00011fb8 bl 0x119e8 | fcn_000119e8 (r0, r1);
0x00011fbc b 0x11fa8 | goto label_8;
| label_24:
0x00011fbe mov fp, r0 |
0x00011fc0 b 0x11f60 | goto label_9;
| label_25:
0x00011fc2 mov r4, r8 | r4 = r8;
| label_23:
0x00011fc4 ldr r0, [r4, 0x24] | r0 = *((r4 + 0x24));
| if (r0 == 0) {
0x00011fc6 cbz r0, 0x12002 | goto label_27;
| }
0x00011fc8 blx 0xa798 | fcn_0000a798 ();
0x00011fcc str r0, [sp, 0x18] | var_18h = r0;
| if (r0 == 0) {
0x00011fce cbz r0, 0x12002 | goto label_27;
| }
0x00011fd0 mov r5, fp | r5 = fp;
0x00011fd2 add.w sb, sp, 0x18 | sb += var_18h;
0x00011fd6 mov.w r8, 0 | r8 = 0;
| do {
0x00011fda ldr r0, [r0] | r0 = *(r0);
0x00011fdc movs r3, 1 | r3 = 1;
0x00011fde ldr.w r1, [fp] | r1 = *(fp);
0x00011fe2 mov r6, r5 | r6 = r5;
0x00011fe4 ldr r2, [r0] | r2 = *(r0);
0x00011fe6 str.w r8, [sp] | __asm ("str.w r8, [sp]");
0x00011fea bl 0x11df4 | r0 = fcn_00011df4 (r0, r1, r2, r3, r4);
0x00011fee mov r5, r0 | r5 = r0;
0x00011ff0 mov r1, sb | r1 = sb;
0x00011ff2 ldr r0, [r4, 0x24] | r0 = *((r4 + 0x24));
0x00011ff4 str r5, [r6, 0x18] | *((r6 + 0x18)) = r5;
0x00011ff6 str r6, [r5, 0x14] | *((r5 + 0x14)) = r6;
0x00011ff8 blx 0xa58c | fcn_0000a58c ();
0x00011ffc ldr r0, [sp, 0x18] | r0 = var_18h;
0x00011ffe cmp r0, 0 |
0x00012000 bne 0x11fda |
| } while (r0 != 0);
| label_27:
0x00012002 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00012004 adds r3, 1 | r3++;
0x00012006 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| label_12:
0x00012008 ldr r2, [pc, 0x84] |
0x0001200a ldr r3, [pc, 0x60] | r3 = *(0x1206e);
0x0001200c add r2, pc | r2 = 0x240a0;
0x0001200e ldr r3, [r2, r3] | r3 = *(0x240a0);
0x00012010 ldr r2, [r3] | r2 = *(0x240a0);
0x00012012 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00012014 eors r2, r3 | r2 ^= r3;
0x00012016 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001201a bne 0x12064 | goto label_28;
| }
0x0001201c mov r0, fp | r0 = fp;
0x0001201e add sp, 0x24 |
0x00012020 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_19:
0x00012024 ldr r3, [r4, 0x14] | r3 = *((r4 + 0x14));
0x00012026 mov r0, r4 | r0 = r4;
0x00012028 ldr r2, [sp, 0x10] | r2 = var_10h;
0x0001202a ldr r1, [r5, 4] | r1 = *((r5 + 4));
0x0001202c str r3, [sp, 0x14] | var_14h = r3;
0x0001202e bl 0x11a40 | fcn_00011a40 (r0, r1, r2);
0x00012032 ldr r2, [r4, 0x14] | r2 = *((r4 + 0x14));
0x00012034 ldr r3, [sp, 0x14] | r3 = var_14h;
0x00012036 cmp r2, r3 |
| if (r2 == r3) {
0x00012038 beq.w 0x11eba | goto label_6;
| }
0x0001203c ldr.w r8, [r4, 8] | r8 = *((r4 + 8));
0x00012040 mov r5, r2 | r5 = r2;
0x00012042 str r7, [r4, 0x44] | *((r4 + 0x44)) = r7;
0x00012044 cmp.w r8, 0 |
| if (r8 != 0) {
0x00012048 bne.w 0x11edc | goto label_10;
| }
0x0001204c mov.w r8, 1 | r8 = 1;
0x00012050 cmp r5, 0 |
| if (r5 != 0) {
0x00012052 bne.w 0x11eba | goto label_6;
| }
0x00012056 b 0x11ee0 | goto label_7;
| label_22:
0x00012058 mov fp, r0 |
0x0001205a b 0x11f22 | goto label_11;
| label_18:
0x0001205c mov fp, sl |
0x0001205e str.w sl, [r4, 0x44] | __asm ("str.w sl, [r4, 0x44]");
0x00012062 b 0x12008 | goto label_12;
| label_28:
0x00012064 blx 0x9e90 | fcn_00009e90 ();
0x00012068 smmla r0, ip, r1, r0 | __asm ("smmla r0, ip, r1, r0");
0x0001206c lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x0001206e movs r0, r0 |
0x00012070 lsls r2, r2, 7 | r2 <<= 7;
0x00012072 movs r2, r0 | r2 = r0;
0x00012074 lsls r6, r1, 9 | r6 = r1 << 9;
0x00012076 movs r2, r0 | r2 = r0;
0x00012078 lsls r2, r0, 9 | r2 = r0 << 9;
0x0001207a movs r2, r0 | r2 = r0;
0x0001207c lsls r2, r7, 6 | r2 = r7 << 6;
0x0001207e movs r2, r0 | r2 = r0;
0x00012080 lsls r2, r2, 6 | r2 <<= 6;
0x00012082 movs r2, r0 | r2 = r0;
0x00012084 lsls r6, r1, 8 | r6 = r1 << 8;
0x00012086 movs r2, r0 | r2 = r0;
0x00012088 lsls r2, r0, 8 | r2 = r0 << 8;
0x0001208a movs r2, r0 | r2 = r0;
0x0001208c lsls r2, r7, 5 | r2 = r7 << 5;
0x0001208e movs r2, r0 | r2 = r0;
0x00012090 invalid |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x124ec */
| #include <stdint.h>
|
; (fcn) fcn.000124ec () | void fcn_000124ec (int16_t arg1, uint32_t arg3) {
| r0 = arg1;
| r2 = arg3;
| if (? >= ?) {
0x000124ec andlo lr, r2, 208, 18 | lr = r2 & (208 18);
| }
0x000124f0 push {r4, r5, r6, lr} |
0x000124f2 mov r4, r0 | r4 = r0;
0x000124f4 cmp r3, r2 |
| if (r3 == r2) {
0x000124f6 beq 0x12506 | goto label_0;
| }
0x000124f8 ldr r5, [r0, 0x10] | r5 = *((r0 + 0x10));
| do {
0x000124fa ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000124fc adds r2, r3, 1 | r2 = r3 + 1;
0x000124fe str r2, [r4, 8] | *((r4 + 8)) = r2;
0x00012500 mla r0, r0, r3, r5 | __asm ("mla r0, r0, r3, r5");
0x00012504 pop {r4, r5, r6, pc} |
| label_0:
0x00012506 ldrd r0, r1, [r0] | __asm ("ldrd r0, r1, [r0]");
0x0001250a cmp r3, 0 |
0x0001250c ite gt |
| if (r3 <= 0) {
0x0001250e lslgt r6, r3, 1 | r6 = r3 << 1;
| }
| if (r3 > 0) {
0x00012510 movle r6, 1 | r6 = 1;
| }
0x00012512 mul r1, r6, r1 | r1 = r6 * r1;
0x00012516 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001251a ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x0001251c mov r5, r0 | r5 = r0;
0x0001251e ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x00012520 ldr r1, [r4, 0x10] | r1 = *((r4 + 0x10));
0x00012522 mul r2, r3, r2 | r2 = r3 * r2;
0x00012526 blx 0x9cf8 | fcn_00009cf8 ();
0x0001252a ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x0001252c strd r6, r5, [r4, 0xc] | __asm ("strd r6, r5, [r4, 0xc]");
0x00012530 b 0x124fa |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x17584 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00017584 () | void fcn_00017584 (uint32_t arg1, uint32_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x00017584 add.w r3, r1, 0x1000 | r3 = r1 + 0x1000;
0x00017588 push.w {r4, r5, r6, r7, r8, lr} |
0x0001758c adds r3, 0x17 | r3 += 0x17;
0x0001758e bic r3, r3, 0xff0 | r3 = BIT_MASK (r3, 0xff0);
0x00017592 bic r3, r3, 0xf | r3 = BIT_MASK (r3, 0xf);
0x00017596 cmp r1, r3 |
| if (r1 > r3) {
0x00017598 bhi 0x17666 | goto label_6;
| }
0x0001759a cmp.w r3, 0x2000 |
0x0001759e ldr r7, [r0] | r7 = *(r0);
0x000175a0 it lo |
| if (r3 >= 0x2000) {
0x000175a2 movlo r3, 0x2000 | r3 = 0x2000;
| }
0x000175a6 mov r6, r0 | r6 = r0;
0x000175a8 lsrs r4, r3, 0xc | r4 = r3 >> 0xc;
0x000175aa mov r5, r3 | r5 = r3;
0x000175ac add.w r8, r4, -1 | r8 = r4 + -1;
0x000175b0 cmp r7, r8 |
| if (r7 >= r8) {
0x000175b2 bhs 0x1760a | goto label_7;
| }
0x000175b4 ldr r3, [r0, 0x14] | r3 = *((r0 + 0x14));
| if (r3 == 0) {
0x000175b6 cbz r3, 0x175d0 | goto label_8;
| }
0x000175b8 ldr r0, [r0, 0xc] | r0 = *((r0 + 0xc));
0x000175ba add.w r7, r6, 0x14 | r7 = r6 + 0x14;
| if (r0 == 0) {
0x000175be cbz r0, 0x175fa | goto label_9;
| }
0x000175c0 blx 0xa268 | fcn_0000a268 ();
0x000175c4 ldr r3, [r6, 0x14] | r3 = *((r6 + 0x14));
0x000175c6 ldr r0, [r6, 0xc] | r0 = *((r6 + 0xc));
| if (r3 != 0) {
0x000175c8 cbnz r3, 0x175fa | goto label_9;
| }
| do {
| if (r0 != 0) {
| label_1:
0x000175ca cbz r0, 0x175d0 |
0x000175cc blx 0xacfc | fcn_0000acfc ();
| }
| label_8:
0x000175d0 mov r0, r5 | r0 = r5;
0x000175d2 blx 0xa2b4 | r0 = fcn_0000a2b4 ();
0x000175d6 mov r4, r0 | r4 = r0;
0x000175d8 cmp r0, 0 |
| if (r0 == 0) {
0x000175da beq 0x17666 | goto label_6;
| }
0x000175dc add r5, r0 | r5 += r0;
0x000175de str.w r8, [r0, 8] | __asm ("str.w r8, [r0, 8]");
0x000175e2 str r5, [r0, 0x14] | *((r0 + 0x14)) = r5;
| label_3:
0x000175e4 mov r3, r4 | r3 = r4;
0x000175e6 movs r2, 0 | r2 = 0;
0x000175e8 str r2, [r3], 0x18 | *(r3) = r2;
| r3 += 0x18;
0x000175ec mov r0, r4 | r0 = r4;
0x000175ee str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x000175f0 pop.w {r4, r5, r6, r7, r8, pc} |
| label_0:
0x000175f4 mov r7, r4 | r7 = r4;
0x000175f6 cmp r3, 0 |
0x000175f8 beq 0x175ca |
| } while (r3 == 0);
| label_9:
0x000175fa ldr r2, [r3, 8] | r2 = *((r3 + 8));
0x000175fc mov r4, r3 | r4 = r3;
0x000175fe ldr r3, [r3] | r3 = *(r3);
0x00017600 cmp r2, r8 |
| if (r2 <= r8) {
0x00017602 blo 0x175f4 | goto label_0;
| }
0x00017604 str r3, [r7] | *(r7) = r3;
0x00017606 ldr r3, [r6, 8] | r3 = *((r6 + 8));
0x00017608 b 0x1764e | goto label_10;
| label_7:
0x0001760a ldr r0, [r0, 0xc] | r0 = *((r0 + 0xc));
| if (r0 != 0) {
0x0001760c cbz r0, 0x17616 |
0x0001760e blx 0xa268 | fcn_0000a268 ();
0x00017612 ldr r0, [r6, 0xc] | r0 = *((r6 + 0xc));
0x00017614 ldr r7, [r6] | r7 = *(r6);
| }
0x00017616 add.w r3, r6, r8, lsl 2 | r3 = r6 + (r8 << 2);
0x0001761a adds r1, r4, 4 | r1 = r4 + 4;
0x0001761c add.w r1, r6, r1, lsl 2 | r1 = r6 + (r1 << 2);
0x00017620 ldr r4, [r3, 0x14] | r4 = *((r3 + 0x14));
| if (r4 != 0) {
0x00017622 cbnz r4, 0x1767e | goto label_11;
| }
0x00017624 cmp r8, r7 |
| if (r8 >= r7) {
0x00017626 bhs 0x175ca | goto label_1;
| }
0x00017628 adds r2, r1, 4 | r2 = r1 + 4;
0x0001762a mov r3, r8 | r3 = r8;
0x0001762c b 0x17632 | goto label_12;
| label_2:
0x0001762e cmp r3, r7 |
| if (r3 == r7) {
0x00017630 beq 0x175ca | goto label_1;
| }
| label_12:
0x00017632 mov r1, r2 | r1 = r2;
0x00017634 ldr r4, [r2], 4 | r4 = *(r2);
| r2 += 4;
0x00017638 adds r3, 1 | r3++;
0x0001763a cmp r4, 0 |
| if (r4 == 0) {
0x0001763c beq 0x1762e | goto label_2;
| }
| label_5:
0x0001763e ldr r2, [r4] | r2 = *(r4);
0x00017640 cmp r3, r7 |
0x00017642 it hs |
| if (r3 >= r7) {
0x00017644 cmphs r2, 0 | __asm ("cmphs r2, 0");
| }
0x00017646 str r2, [r1] | *(r1) = r2;
| if (r3 == r7) {
0x00017648 beq 0x17670 | goto label_13;
| }
| label_4:
0x0001764a ldr r3, [r6, 8] | r3 = *((r6 + 8));
0x0001764c ldr r2, [r4, 8] | r2 = *((r4 + 8));
| label_10:
0x0001764e adds r3, 1 | r3++;
0x00017650 add r3, r2 | r3 += r2;
0x00017652 ldr r2, [r6, 4] | r2 = *((r6 + 4));
0x00017654 cmp r3, r2 |
0x00017656 it hs |
| if (r3 < r2) {
0x00017658 movhs r3, r2 | r3 = r2;
| }
0x0001765a str r3, [r6, 8] | *((r6 + 8)) = r3;
0x0001765c cmp r0, 0 |
| if (r0 == 0) {
0x0001765e beq 0x175e4 | goto label_3;
| }
0x00017660 blx 0xacfc | fcn_0000acfc ();
0x00017664 b 0x175e4 | goto label_3;
| label_6:
0x00017666 movs r4, 0 | r4 = 0;
0x00017668 mov r0, r4 | r0 = r4;
0x0001766a pop.w {r4, r5, r6, r7, r8, pc} |
| do {
| if (r7 == 0) {
0x0001766e cbz r7, 0x1767a | goto label_14;
| }
| label_13:
0x00017670 ldr r3, [r1, -0x4]! | r3 = *((r1 -= 0x4));
0x00017674 subs r7, 1 | r7--;
0x00017676 cmp r3, 0 |
0x00017678 beq 0x1766e |
| } while (r3 == 0);
| label_14:
0x0001767a str r7, [r6] | *(r6) = r7;
0x0001767c b 0x1764a | goto label_4;
| label_11:
0x0001767e mov r3, r8 | r3 = r8;
0x00017680 b 0x1763e | goto label_5;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x17760 */
| #include <stdint.h>
|
; (fcn) fcn.00017760 () | void fcn_00017760 (uint32_t arg1) {
| r0 = arg1;
0x00017760 cmp r0, 0 |
| if (r0 == 0) {
0x00017762 beq.w 0x17874 | goto label_7;
| }
0x00017766 push.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001776a movw r4, 0x1176 |
0x0001776e mov r7, r0 | r7 = r0;
0x00017770 mov r6, r0 | r6 = r0;
0x00017772 movs r5, 0 | r5 = 0;
0x00017774 movt r4, 1 | r4 = 0x11176;
| do {
0x00017778 movs r2, 0 | r2 = 0;
0x0001777a ldr r0, [r6] | r0 = *(r6);
0x0001777c movs r3, 1 | r3 = 1;
0x0001777e mov r1, r2 | r1 = r2;
0x00017780 blx 0xad18 | r0 = fcn_0000ad18 ();
0x00017784 cmp r0, r4 |
0x00017786 it ne |
| if (r0 == r4) {
0x00017788 strne r5, [r6, 4] | *((r6 + 4)) = r5;
| }
0x0001778a ldr r6, [r6, 8] | r6 = *((r6 + 8));
0x0001778c cmp r6, 0 |
0x0001778e bne 0x17778 |
| } while (r6 != 0);
0x00017790 mov r5, r7 | r5 = r7;
0x00017792 b 0x1779c |
| while (r2 != r3) {
0x00017794 cmp r3, 1 |
| if (r3 == 1) {
0x00017796 beq 0x177d4 | goto label_8;
| }
| label_2:
0x00017798 ldr r5, [r5, 8] | r5 = *((r5 + 8));
| if (r5 == 0) {
0x0001779a cbz r5, 0x177ba | goto label_9;
| }
| label_0:
0x0001779c ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x0001779e subs r2, r3, 2 | r2 = r3 - 2;
0x000177a0 bics r2, r2, 2 | __asm ("bics r2, r2, 2");
0x000177a4 bne 0x17794 |
| }
0x000177a6 ldr r0, [r5] | r0 = *(r5);
0x000177a8 movs r1, 0xf | r1 = 0xf;
0x000177aa blx 0xa878 | ftok ();
0x000177ae ldr r5, [r5, 8] | r5 = *((r5 + 8));
0x000177b0 cmp r0, 0 |
0x000177b2 it eq |
| if (r0 != 0) {
0x000177b4 moveq r6, 1 | r6 = 1;
| }
0x000177b6 cmp r5, 0 |
| if (r5 != 0) {
0x000177b8 bne 0x1779c | goto label_0;
| }
| if (r6 != 0) {
| label_9:
0x000177ba cbnz r6, 0x177fe | goto label_10;
| }
| label_5:
0x000177bc mov r4, r7 | r4 = r7;
0x000177be b 0x177c4 |
| while (r3 != 2) {
| label_1:
0x000177c0 ldr r4, [r4, 8] | r4 = *((r4 + 8));
| if (r4 == 0) {
0x000177c2 cbz r4, 0x177ee | goto label_3;
| }
0x000177c4 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x000177c6 cmp r3, 2 |
0x000177c8 bne 0x177c0 |
| }
0x000177ca ldr r0, [r4] | r0 = *(r4);
0x000177cc movs r1, 9 | r1 = 9;
0x000177ce blx 0xa878 | ftok ();
0x000177d2 b 0x177c0 | goto label_1;
| label_8:
0x000177d4 ldr r0, [r5] | r0 = *(r5);
0x000177d6 movs r1, 9 | r1 = 9;
0x000177d8 blx 0xa878 | ftok ();
0x000177dc b 0x17798 | goto label_2;
| do {
0x000177de movs r3, 0 | r3 = 0;
0x000177e0 ldr r0, [r7] | r0 = *(r7);
0x000177e2 mov r2, r3 | r2 = r3;
0x000177e4 mov r1, r3 | r1 = r3;
0x000177e6 blx 0xad18 | fcn_0000ad18 ();
0x000177ea ldr r7, [r7, 8] | r7 = *((r7 + 8));
| if (r7 == 0) {
0x000177ec cbz r7, 0x177fa | goto label_11;
| }
| label_3:
0x000177ee ldr r3, [r7, 4] | r3 = *((r7 + 4));
0x000177f0 cmp r3, 0 |
0x000177f2 bne 0x177de |
| } while (r3 != 0);
0x000177f4 ldr r7, [r7, 8] | r7 = *((r7 + 8));
0x000177f6 cmp r7, 0 |
| if (r7 != 0) {
0x000177f8 bne 0x177ee | goto label_3;
| }
| label_11:
0x000177fa pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x000177fe movw sl, 0x1176 |
0x00017802 movw sb, 0xb71b | sb = 0xb71b;
0x00017806 mov fp, r5 |
0x00017808 movt sl, 1 | sl = 0x11176;
0x0001780c movw r0, 0xb71b | r0 = 0xb71b;
0x00017810 movs r1, 0 | r1 = 0;
0x00017812 blx 0xa680 | fcn_0000a680 ();
| label_6:
0x00017816 mov r4, r7 | r4 = r7;
0x00017818 mov.w r8, 0 | r8 = 0;
0x0001781c b 0x17822 |
| while (r3 != 2) {
0x0001781e ldr r4, [r4, 8] | r4 = *((r4 + 8));
| if (r4 == 0) {
0x00017820 cbz r4, 0x17844 | goto label_12;
| }
| label_4:
0x00017822 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00017824 cmp r3, 2 |
0x00017826 bne 0x1781e |
| }
0x00017828 movs r2, 0 | r2 = 0;
0x0001782a ldr r0, [r4] | r0 = *(r4);
0x0001782c movs r3, 1 | r3 = 1;
0x0001782e mov r1, r2 | r1 = r2;
0x00017830 blx 0xad18 | r0 = fcn_0000ad18 ();
0x00017834 cmp r0, sl |
0x00017836 ite ne |
| if (r0 == sl) {
0x00017838 strne fp, [r4, 4] | *((r4 + 4)) = fp;
| }
| if (r0 == sl) {
0x0001783c mov r8, r6 | r8 = r6;
| }
0x0001783e ldr r4, [r4, 8] | r4 = *((r4 + 8));
0x00017840 cmp r4, 0 |
| if (r4 != 0) {
0x00017842 bne 0x17822 | goto label_4;
| }
| label_12:
0x00017844 movw r2, 0xc6c0 |
0x00017848 eor r3, r8, 1 | r3 = r8 ^ 1;
0x0001784c movt r2, 0x2d | r2 = 0x2dc6c0;
0x00017850 and r3, r3, 1 | r3 &= 1;
0x00017854 cmp sb, r2 |
0x00017856 sbcs r2, r5, 0 | __asm ("sbcs r2, r5, 0");
0x0001785a it ge |
| if (sb < r2) {
0x0001785c orrge r3, r3, 1 | r3 |= 1;
| }
0x00017860 cmp r3, 0 |
| if (r3 != 0) {
0x00017862 bne 0x177bc | goto label_5;
| }
0x00017864 mov r0, sb | r0 = sb;
0x00017866 mov r1, r5 | r1 = r5;
0x00017868 blx 0xa680 | fcn_0000a680 ();
0x0001786c adds.w sb, sb, sb | sb += sb;
0x00017870 adcs r5, r5 | __asm ("adcs r5, r5");
0x00017872 b 0x17816 | goto label_6;
| label_7:
0x00017874 bx lr | return;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1ca58 */
| #include <stdint.h>
|
; (fcn) fcn.0001ca58 () | void fcn_0001ca58 (int16_t arg1, int16_t arg2, uint32_t arg3) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0001ca58 cmp r2, 0 |
| if (r2 == 0) {
0x0001ca5a beq 0x1cae6 | goto label_1;
| }
0x0001ca5c push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0001ca60 mov r4, r0 | r4 = r0;
0x0001ca62 ldr r5, [r0, 0x34] | r5 = *((r0 + 0x34));
0x0001ca64 mov sb, r1 | sb = r1;
0x0001ca66 mov r8, r2 | r8 = r2;
0x0001ca68 movs r6, 0 | r6 = 0;
0x0001ca6a b 0x1ca96 |
| while (r5 != 0) {
0x0001ca6c ldr r1, [r0, 0xc] | r1 = *((r0 + 0xc));
0x0001ca6e subs r1, r1, r5 | r1 -= r5;
| label_0:
0x0001ca70 sub.w r7, r8, r6 | r7 = r8 - r6;
0x0001ca74 ldr r3, [r4, 0x30] | r3 = *((r4 + 0x30));
0x0001ca76 cmp r7, r5 |
0x0001ca78 add.w r0, sb, r6 | r0 = sb + r6;
0x0001ca7c it hs |
| if (r7 < r5) {
0x0001ca7e movhs r7, r5 | r7 = r5;
| }
0x0001ca80 mov r2, r7 | r2 = r7;
0x0001ca82 add r1, r3 | r1 += r3;
0x0001ca84 blx 0x9cf8 | fcn_00009cf8 ();
0x0001ca88 ldr r5, [r4, 0x34] | r5 = *((r4 + 0x34));
0x0001ca8a add r6, r7 | r6 += r7;
0x0001ca8c cmp r8, r6 |
0x0001ca8e sub.w r5, r5, r7 | r5 -= r7;
0x0001ca92 str r5, [r4, 0x34] | *((r4 + 0x34)) = r5;
| if (r8 < r6) {
0x0001ca94 bls 0x1cae2 | goto label_2;
| }
0x0001ca96 ldr r0, [r4, 0x24] | r0 = *((r4 + 0x24));
0x0001ca98 cmp r5, 0 |
0x0001ca9a bne 0x1ca6c |
| }
0x0001ca9c ldr r3, [r0] | r3 = *(r0);
0x0001ca9e ldr r7, [r4, 0x30] | r7 = *((r4 + 0x30));
0x0001caa0 blx r3 | uint32_t (*r3)(uint32_t) (r3);
0x0001caa2 ldrd r0, r1, [r4, 0x24] | __asm ("ldrd r0, r1, [r4, 0x24]");
0x0001caa6 ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x0001caa8 ldr r2, [r0, 0xc] | r2 = *((r0 + 0xc));
0x0001caaa ldr.w ip, [r3, 0xc] | ip = *((r3 + 0xc));
0x0001caae ldr.w sl, [r0, 4] | sl = *((r0 + 4));
0x0001cab2 add r2, ip | r2 += ip;
0x0001cab4 blx sl | sl (r0, r2, r3);
0x0001cab6 ldrd r0, r1, [r4, 0x24] | __asm ("ldrd r0, r1, [r4, 0x24]");
0x0001caba ldr r3, [r0, 8] | r3 = *((r0 + 8));
0x0001cabc blx r3 | uint32_t (*r3)(uint32_t, uint32_t) (r0, r3);
0x0001cabe ldr r0, [r4, 0x24] | r0 = *((r4 + 0x24));
0x0001cac0 ldr r3, [r0] | r3 = *(r0);
0x0001cac2 blx r3 | uint32_t (*r3)(uint32_t, uint32_t) (r0, r3);
0x0001cac4 ldrd r0, r1, [r4, 0x24] | __asm ("ldrd r0, r1, [r4, 0x24]");
0x0001cac8 ldr r2, [r0, 0xc] | r2 = *((r0 + 0xc));
0x0001caca ldr r3, [r0, 4] | r3 = *((r0 + 4));
0x0001cacc blx r3 | uint32_t (*r3)(uint32_t, uint32_t, uint32_t) (r0, r2, r3);
0x0001cace ldr r0, [r4, 0x24] | r0 = *((r4 + 0x24));
0x0001cad0 mov r1, r7 | r1 = r7;
0x0001cad2 ldr r3, [r0, 8] | r3 = *((r0 + 8));
0x0001cad4 blx r3 | uint32_t (*r3)(uint32_t, uint32_t, uint32_t) (r0, r1, r3);
0x0001cad6 ldr r3, [r4, 0x24] | r3 = *((r4 + 0x24));
0x0001cad8 mov r1, r5 | r1 = r5;
0x0001cada ldr r3, [r3, 0xc] | r3 = *((r3 + 0xc));
0x0001cadc mov r5, r3 | r5 = r3;
0x0001cade str r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
0x0001cae0 b 0x1ca70 | goto label_0;
| label_2:
0x0001cae2 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_1:
0x0001cae6 bx lr | return;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1cee0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
| uint32_t rotate_right32 (uint32_t value, uint32_t count) {
| const uint32_t mask = (CHAR_BIT * sizeof (value)) - 1;
| count &= mask;
| return (value >> count) | (value << (-count & mask));
| }
| #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \
| ((n & 0x0000ff00) << 8) | \
| ((n & 0x00ff0000) >> 8) | \
| ((n & 0xff000000) >> 24)))
|
; (fcn) sym.apr__SHA256_Transform () | void apr_SHA256_Transform (int16_t arg1, int16_t arg2) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| r0 = arg1;
| r1 = arg2;
0x0001cee0 mov r3, r0 | r3 = r0;
0x0001cee2 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001cee6 mov fp, r1 |
0x0001cee8 ldrd r6, r1, [r3, 0x10] | __asm ("ldrd r6, r1, [r3, 0x10]");
0x0001ceec sub sp, 0x24 |
0x0001ceee mov r7, r0 | r7 = r0;
0x0001cef0 ldr r2, [pc, 0x1d8] |
0x0001cef2 str r1, [sp, 8] | var_8h = r1;
0x0001cef4 ldr r1, [r3, 0x18] | r1 = *((r3 + 0x18));
0x0001cef6 ldr.w sl, [r3, 0x1c] | sl = *((r3 + 0x1c));
0x0001cefa add r2, pc | r2 = 0x39fca;
0x0001cefc ldr r5, [r0, 4] | r5 = *((r0 + 4));
0x0001cefe add.w ip, r2, 0x20 |
0x0001cf02 ldr r4, [r7], 0x28 | r4 = *(r7);
| r7 += 0x28;
0x0001cf06 adds r2, 0x5c | r2 += 0x5c;
0x0001cf08 str r0, [sp, 0x1c] | var_1ch = r0;
0x0001cf0a ldrd r0, sb, [r0, 8] | __asm ("ldrd r0, sb, [r0, 8]");
0x0001cf0e str r1, [sp, 4] | var_4h = r1;
0x0001cf10 mov r1, r3 | r1 = r3;
0x0001cf12 movw r3, 0x2f98 |
0x0001cf16 add.w r8, r1, 0x24 | r8 = r1 + 0x24;
0x0001cf1a movt r3, 0x428a | r3 = 0x428a2f98;
0x0001cf1e str.w r8, [sp] | __asm ("str.w r8, [sp]");
0x0001cf22 mov lr, r0 | lr = r0;
0x0001cf24 ldr.w r8, [sp, 4] | r8 = var_4h;
0x0001cf28 str r2, [sp, 0x10] | var_10h = r2;
0x0001cf2a str.w fp, [sp, 4] | __asm ("str.w fp, [var_4h]");
0x0001cf2e mov fp, sl |
0x0001cf30 str r7, [sp, 0x14] | var_14h = r7;
0x0001cf32 ldr.w sl, [sp, 8] | sl = var_8h;
0x0001cf36 str r3, [sp, 0xc] | var_ch = r3;
0x0001cf38 b 0x1cf4c |
| while (r3 != ip) {
0x0001cf3a ldr r3, [ip, 4]! | r3 = *((ip += 4));
0x0001cf3e mov r8, sl | r8 = sl;
0x0001cf40 mov lr, r5 | lr = r5;
0x0001cf42 mov sl, r6 | sl = r6;
0x0001cf44 mov r5, r4 | r5 = r4;
0x0001cf46 mov r6, r0 | r6 = r0;
0x0001cf48 mov r4, r2 | r4 = r2;
0x0001cf4a str r3, [sp, 0xc] | var_ch = r3;
0x0001cf4c ldr r2, [sp, 4] | r2 = var_4h;
0x0001cf4e and.w r3, r6, sl | r3 = r6 & sl;
0x0001cf52 ldr r1, [sp] | r1 = *(sp);
0x0001cf54 bic.w r0, r8, r6 | r0 = BIT_MASK (r8, r6);
0x0001cf58 eors r0, r3 | r0 ^= r3;
0x0001cf5a ldr r3, [sp, 0xc] | r3 = var_ch;
0x0001cf5c ldr r7, [r2], 4 | r7 = *(r2);
| r2 += 4;
0x0001cf60 str r2, [sp, 4] | var_4h = r2;
0x0001cf62 ror.w r2, r6, 0xb | r2 = rotate_right32 (r6, 11);
0x0001cf66 rev r7, r7 | r7 = SWAP32 (r7);
0x0001cf68 eor.w r2, r2, r6, ror 6 | r2 ^= (r6 >>> 6);
0x0001cf6c str r7, [r1, 4]! | *((r1 += 4)) = r7;
0x0001cf70 str r1, [sp] | *(sp) = r1;
0x0001cf72 ror.w r1, r4, 0xd | r1 = rotate_right32 (r4, 13);
0x0001cf76 eor.w r2, r2, r6, ror 25 | r2 ^= (r6 >>> 25);
0x0001cf7a eor.w r1, r1, r4, ror 2 | r1 ^= (r4 >>> 2);
0x0001cf7e add r2, r0 | r2 += r0;
0x0001cf80 add r2, r7 | r2 += r7;
0x0001cf82 eor.w r1, r1, r4, ror 22 | r1 ^= (r4 >>> 22);
0x0001cf86 add r2, fp | r2 += fp;
0x0001cf88 add r2, r3 | r2 += r3;
0x0001cf8a eor.w r3, r5, lr | r3 = r5 ^ lr;
0x0001cf8e ands r3, r4 | r3 &= r4;
0x0001cf90 and.w r7, r5, lr | r7 = r5 & lr;
0x0001cf94 eors r3, r7 | r3 ^= r7;
0x0001cf96 add.w r0, sb, r2 | r0 = sb + r2;
0x0001cf9a add r3, r1 | r3 += r1;
0x0001cf9c mov fp, r8 |
0x0001cf9e add r2, r3 | r2 += r3;
0x0001cfa0 ldr r3, [sp, 0x10] | r3 = var_10h;
0x0001cfa2 mov sb, lr | sb = lr;
0x0001cfa4 cmp r3, ip |
0x0001cfa6 bne 0x1cf3a |
| }
0x0001cfa8 ldr r3, [pc, 0x124] |
0x0001cfaa ldr r7, [sp, 0x14] | r7 = var_14h;
0x0001cfac str.w r8, [sp, 4] | __asm ("str.w r8, [var_4h]");
0x0001cfb0 mov.w r8, 0x10 | r8 = 0x10;
0x0001cfb4 add r3, pc | r3 = 0x3a088;
0x0001cfb6 strd sl, lr, [sp, 8] | __asm ("strd sl, lr, [var_8h]");
0x0001cfba adds r3, 0x60 | r3 += 0x60;
0x0001cfbc str r4, [sp] | *(sp) = r4;
0x0001cfbe str r3, [sp, 0x18] | var_18h = r3;
0x0001cfc0 movw r3, 0x69c1 |
0x0001cfc4 movt r3, 0xe49b | r3 = 0xe49b69c1;
0x0001cfc8 str r6, [sp, 0x10] | var_10h = r6;
0x0001cfca str r3, [sp, 0x14] | var_14h = r3;
0x0001cfcc b 0x1cfe4 |
| while (r5 != r0) {
0x0001cfce ldr r3, [sp, 0x18] | r3 = var_18h;
0x0001cfd0 mov r5, r6 | r5 = r6;
0x0001cfd2 str r2, [sp] | *(sp) = r2;
0x0001cfd4 str r0, [sp, 0x10] | var_10h = r0;
0x0001cfd6 mov r0, r1 | r0 = r1;
0x0001cfd8 ldr r2, [r3, 4]! | r2 = *((r3 += 4));
0x0001cfdc str r4, [sp, 8] | var_8h = r4;
0x0001cfde strd r2, r3, [sp, 0x14] | __asm ("strd r2, r3, [var_14h]");
0x0001cfe2 mov r2, lr | r2 = lr;
0x0001cfe4 add.w sb, r8, 1 | sb = r8 + 1;
0x0001cfe8 add.w r1, r8, 0xe | r1 = r8 + 0xe;
0x0001cfec and r3, sb, 0xf | r3 = sb & 0xf;
0x0001cff0 and r1, r1, 0xf | r1 &= 0xf;
0x0001cff4 ldr.w r3, [r7, r3, lsl 2] | offset_0 = r3 << 2;
| r3 = *((r7 + offset_0));
0x0001cff8 and sl, r8, 0xf | sl = r8 & 0xf;
0x0001cffc ldr.w fp, [r7, r1, lsl 2] | offset_1 = r1 << 2;
| fp = *((r7 + offset_1));
0x0001d000 cmp.w sb, 0x40 |
0x0001d004 ldr.w r6, [r7, sl, lsl 2] | offset_2 = sl << 2;
| r6 = *((r7 + offset_2));
0x0001d008 ldr r4, [sp, 0x10] | r4 = var_10h;
0x0001d00a ror.w lr, r3, 0x12 | lr = rotate_right32 (r3, 18);
0x0001d00e ror.w ip, fp, 0x13 | ip = rotate_right32 (fp, 19);
0x0001d012 eor.w lr, lr, r3, ror 7 | lr ^= (r3 >>> 7);
0x0001d016 eor.w ip, ip, fp, ror 17 |
0x0001d01a eor.w lr, lr, r3, lsr 3 | lr ^= (r3 >> 3);
0x0001d01e add.w r3, r8, 9 | r3 = r8 + 9;
0x0001d022 and r3, r3, 0xf | r3 &= 0xf;
0x0001d026 eor.w ip, ip, fp, lsr 10 |
0x0001d02a ldr.w r1, [r7, r3, lsl 2] | offset_3 = r3 << 2;
| r1 = *((r7 + offset_3));
0x0001d02e ror.w r3, r0, 0xb | r3 = rotate_right32 (r0, 11);
0x0001d032 mov r8, sb | r8 = sb;
0x0001d034 eor.w r3, r3, r0, ror 6 | r3 ^= (r0 >>> 6);
0x0001d038 add r1, r6 | r1 += r6;
0x0001d03a ldr r6, [sp, 8] | r6 = var_8h;
0x0001d03c add r1, lr | r1 += lr;
0x0001d03e eor.w r3, r3, r0, ror 25 | r3 ^= (r0 >>> 25);
0x0001d042 add r1, ip | r1 += ip;
0x0001d044 ror.w ip, r2, 0xd | ip = rotate_right32 (r2, 13);
0x0001d048 bic.w lr, r6, r0 | lr = BIT_MASK (r6, r0);
0x0001d04c str.w r1, [r7, sl, lsl 2] | __asm ("str.w r1, [r7, sl, lsl 2]");
0x0001d050 and.w sl, r0, r4 | sl = r0 & r4;
0x0001d054 eor.w ip, ip, r2, ror 2 |
0x0001d058 eor.w lr, lr, sl | lr ^= sl;
0x0001d05c add r3, lr | r3 += lr;
0x0001d05e eor.w ip, ip, r2, ror 22 |
0x0001d062 add r3, r1 | r3 += r1;
0x0001d064 ldr r1, [sp, 4] | r1 = var_4h;
0x0001d066 str r6, [sp, 4] | var_4h = r6;
0x0001d068 ldr r6, [sp] | r6 = *(sp);
0x0001d06a add r3, r1 | r3 += r1;
0x0001d06c ldr r1, [sp, 0x14] | r1 = var_14h;
0x0001d06e eor.w lr, r6, r5 | lr = r6 ^ r5;
0x0001d070 lsrs r5, r0, 0x18 | r5 = r0 >> 0x18;
0x0001d072 and.w sl, r6, r5 | sl = r6 & r5;
0x0001d076 add r3, r1 | r3 += r1;
0x0001d078 and.w lr, lr, r2 | lr &= r2;
0x0001d07c ldr r1, [sp, 0xc] | r1 = var_ch;
0x0001d07e eor.w lr, lr, sl | lr ^= sl;
0x0001d082 add lr, ip | lr += ip;
0x0001d084 str r5, [sp, 0xc] | var_ch = r5;
0x0001d086 add lr, r3 | lr += r3;
0x0001d088 add r1, r3 | r1 += r3;
0x0001d08a bne 0x1cfce |
| }
0x0001d08c ldr r7, [sp, 0x1c] | r7 = var_1ch;
0x0001d08e ldr r4, [sp] | r4 = *(sp);
0x0001d090 ldr r6, [sp, 0x10] | r6 = var_10h;
0x0001d092 ldr r3, [r7] | r3 = *(r7);
0x0001d094 add r3, lr | r3 += lr;
0x0001d096 str r3, [r7] | *(r7) = r3;
0x0001d098 ldr r3, [r7, 4] | r3 = *((r7 + 4));
0x0001d09a add r3, r2 | r3 += r2;
0x0001d09c ldr r2, [r7, 0x18] | r2 = *((r7 + 0x18));
0x0001d09e str r3, [r7, 4] | *((r7 + 4)) = r3;
0x0001d0a0 ldr r3, [r7, 8] | r3 = *((r7 + 8));
0x0001d0a2 add r6, r2 | r6 += r2;
0x0001d0a4 str r6, [r7, 0x18] | *((r7 + 0x18)) = r6;
0x0001d0a6 add r3, r4 | r3 += r4;
0x0001d0a8 str r3, [r7, 8] | *((r7 + 8)) = r3;
0x0001d0aa ldr r3, [r7, 0xc] | r3 = *((r7 + 0xc));
0x0001d0ac add r3, r5 | r3 += r5;
0x0001d0ae str r3, [r7, 0xc] | *((r7 + 0xc)) = r3;
0x0001d0b0 ldr r3, [r7, 0x10] | r3 = *((r7 + 0x10));
0x0001d0b2 add r3, r1 | r3 += r1;
0x0001d0b4 ldr r1, [sp, 8] | r1 = var_8h;
0x0001d0b6 str r3, [r7, 0x10] | *((r7 + 0x10)) = r3;
0x0001d0b8 ldr r3, [r7, 0x14] | r3 = *((r7 + 0x14));
0x0001d0ba add r3, r0 | r3 += r0;
0x0001d0bc str r3, [r7, 0x14] | *((r7 + 0x14)) = r3;
0x0001d0be ldr r3, [r7, 0x1c] | r3 = *((r7 + 0x1c));
0x0001d0c0 add r3, r1 | r3 += r1;
0x0001d0c2 str r3, [r7, 0x1c] | *((r7 + 0x1c)) = r3;
0x0001d0c4 add sp, 0x24 |
0x0001d0c6 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1d0d4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) sym.apr__SHA256_Update () | void apr_SHA256_Update (uint32_t arg1, uint32_t arg2, uint32_t arg3) {
| int16_t var_24h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0001d0d4 cmp r2, 0 |
| if (r2 == 0) {
0x0001d0d6 beq 0x1d194 | goto label_2;
| }
0x0001d0d8 cmp r0, 0 |
0x0001d0da it ne |
| if (r0 != 0) {
0x0001d0dc cmpne r1, 0 | __asm ("cmpne r1, 0");
| }
0x0001d0de push.w {r4, r5, r6, r7, r8, lr} |
0x0001d0e2 mov r4, r0 | r4 = r0;
0x0001d0e4 mov r7, r1 | r7 = r1;
| if (r0 == 0) {
0x0001d0e6 beq 0x1d1ae | goto label_3;
| }
0x0001d0e8 ldr r5, [r0, 0x20] | r5 = *((r0 + 0x20));
0x0001d0ea mov r6, r2 | r6 = r2;
0x0001d0ec ubfx r5, r5, 3, 6 | r5 = (r5 >> 3) & ((1 << 6) - 1);
| if (r5 != 0) {
0x0001d0f0 cbnz r5, 0x1d134 | goto label_4;
| }
0x0001d0f2 cmp r2, 0x3f |
| if (r2 < 0x3f) {
0x0001d0f4 bls 0x1d174 | goto label_5;
| }
| label_0:
0x0001d0f6 mov r5, r7 | r5 = r7;
0x0001d0f8 add.w r8, r7, r6 | r8 = r7 + r6;
| do {
0x0001d0fc mov r1, r5 | r1 = r5;
0x0001d0fe mov r0, r4 | r0 = r4;
0x0001d100 blx 0xa964 | r0 = fcn_0000a964 ();
0x0001d104 ldrd r3, r0, [r4, 0x20] | __asm ("ldrd r3, r0, [r4, 0x20]");
0x0001d108 adds r5, 0x40 | r5 += 0x40;
0x0001d10a sub.w r2, r8, r5 | r2 = r8 - r5;
0x0001d10e adds.w r3, r3, 0x200 | r3 += 0x200;
0x0001d112 adc r0, r0, 0 | __asm ("adc r0, r0, 0");
0x0001d116 cmp r2, 0x3f |
0x0001d118 strd r3, r0, [r4, 0x20] | __asm ("strd r3, r0, [r4, 0x20]");
0x0001d11c bhi 0x1d0fc |
| } while (r2 > 0x3f);
0x0001d11e sub.w r3, r6, 0x40 | r3 = r6 - 0x40;
0x0001d122 and r6, r6, 0x3f | r6 &= 0x3f;
0x0001d126 bic r3, r3, 0x3f | r3 = BIT_MASK (r3, 0x3f);
0x0001d12a adds r3, 0x40 | r3 += 0x40;
0x0001d12c add r7, r3 | r7 += r3;
| if (r6 != 0) {
0x0001d12e cbnz r6, 0x1d174 | goto label_5;
| }
| label_1:
0x0001d130 pop.w {r4, r5, r6, r7, r8, pc} |
| label_4:
0x0001d134 rsb.w r8, r5, 0x40 | r8 = 0x40 - r5;
0x0001d138 add.w r0, r5, 0x28 | r0 = r5 + 0x28;
0x0001d13c cmp r2, r8 |
0x0001d13e add r0, r4 | r0 += r4;
| if (r2 <= r8) {
0x0001d140 blo 0x1d196 | goto label_6;
| }
0x0001d142 mov r2, r8 | r2 = r8;
0x0001d144 add r7, r8 | r7 += r8;
0x0001d146 blx 0x9cf8 | fcn_00009cf8 ();
0x0001d14a ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x0001d14c lsl.w r8, r8, 3 | r8 <<= 3;
0x0001d150 subs r6, 0x40 | r6 -= 0x40;
0x0001d152 add r6, r5 | r6 += r5;
0x0001d154 add.w r1, r4, 0x28 | r1 = r4 + 0x28;
0x0001d158 adds.w r3, r3, r8 | r3 += r8;
0x0001d15c mov r0, r4 | r0 = r4;
0x0001d15e str r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
0x0001d160 ldr r3, [r4, 0x24] | r3 = *((r4 + 0x24));
0x0001d162 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x0001d166 str r3, [r4, 0x24] | *((r4 + 0x24)) = r3;
0x0001d168 blx 0xa964 | fcn_0000a964 ();
0x0001d16c cmp r6, 0x3f |
| if (r6 > 0x3f) {
0x0001d16e bhi 0x1d0f6 | goto label_0;
| }
0x0001d170 cmp r6, 0 |
| if (r6 == 0) {
0x0001d172 beq 0x1d130 | goto label_1;
| }
| label_5:
0x0001d174 mov r2, r6 | r2 = r6;
0x0001d176 mov r1, r7 | r1 = r7;
0x0001d178 add.w r0, r4, 0x28 | r0 = r4 + 0x28;
0x0001d17c lsls r6, r6, 3 | r6 <<= 3;
0x0001d17e blx 0x9cf8 | fcn_00009cf8 ();
0x0001d182 ldrd r3, r2, [r4, 0x20] | __asm ("ldrd r3, r2, [r4, 0x20]");
0x0001d186 adds r3, r3, r6 | r3 += r6;
0x0001d188 adc r2, r2, 0 | __asm ("adc r2, r2, 0");
0x0001d18c strd r3, r2, [r4, 0x20] | __asm ("strd r3, r2, [r4, 0x20]");
0x0001d190 pop.w {r4, r5, r6, r7, r8, pc} |
| label_2:
0x0001d194 bx lr | return;
| label_6:
0x0001d196 blx 0x9cf8 | fcn_00009cf8 ();
0x0001d19a ldrd r3, r1, [r4, 0x20] | __asm ("ldrd r3, r1, [r4, 0x20]");
0x0001d19e lsls r6, r6, 3 | r6 <<= 3;
0x0001d1a0 adds r3, r3, r6 | r3 += r6;
0x0001d1a2 adc r1, r1, 0 | __asm ("adc r1, r1, 0");
0x0001d1a6 strd r3, r1, [r4, 0x20] | __asm ("strd r3, r1, [r4, 0x20]");
0x0001d1aa pop.w {r4, r5, r6, r7, r8, pc} |
| label_3:
0x0001d1ae ldr r3, [pc, 0x18] |
0x0001d1b0 mov.w r2, 0x184 | r2 = 0x184;
0x0001d1b4 ldr r1, [pc, 0x14] |
0x0001d1b6 ldr r0, [pc, 0x18] |
0x0001d1b8 add r3, pc |
0x0001d1ba add r1, pc | r1 = 0x3a38a;
0x0001d1bc add.w r3, r3, 0x120 | r3 = 0x3a4a6;
0x0001d1c0 add r0, pc | r0 = 0x3a396;
0x0001d1c2 blx 0xacec | fcn_0000acec ();
0x0001d1c6 nop |
0x0001d1c8 subs r5, 0xc | r5 -= 0xc;
0x0001d1ca movs r0, r0 |
0x0001d1cc subs r4, 0x92 | r4 -= 0x92;
0x0001d1ce movs r0, r0 |
0x0001d1d0 subs r4, 0xa0 | r4 -= 0xa0;
0x0001d1d2 movs r0, r0 |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x138a8 */
| #include <stdint.h>
|
; (fcn) sym.apr__atomic_generic64_init () | void apr_atomic_generic64_init (int16_t arg1) {
| r0 = arg1;
0x000138a8 svcmi 0x11b5f8 | __asm ("svcmi aav.0x000000ff");
0x000138ac ldr r5, [pc, 0x44] |
0x000138ae add r7, pc | r7 += pc;
0x000138b0 ldr r4, [r7] | r4 = *(r7);
0x000138b2 add r5, pc | r5 = 0x271aa;
0x000138b4 cbz r4, 0x138ba |
| while (r4 == 0x1c) {
0x000138b6 movs r0, 0 | r0 = 0;
0x000138b8 pop {r3, r4, r5, r6, r7, pc} |
0x000138ba movs r1, 0x1c | r1 = 0x1c;
0x000138bc mov r6, r0 | r6 = r0;
0x000138be blx 0xa0d0 | fcn_0000a0d0 ();
0x000138c2 ldr r3, [pc, 0x34] | r3 = *(0x138fa);
0x000138c4 mov r1, r0 | r1 = r0;
0x000138c6 ldr r2, [pc, 0x34] |
0x000138c8 str r0, [r7] | *(r7) = r0;
0x000138ca mov r0, r6 | r0 = r6;
0x000138cc ldr r3, [r5, r3] | r3 = *((r5 + r3));
0x000138ce add r2, pc | r2 = 0x271d0;
0x000138d0 blx 0x9fb0 | fcn_00009fb0 ();
0x000138d4 b 0x138da | goto label_1;
| label_0:
0x000138d6 cmp r4, 0x1c |
0x000138d8 beq 0x138b6 |
| }
| label_1:
0x000138da ldr r0, [r7] | r0 = *(r7);
0x000138dc mov r2, r6 | r2 = r6;
0x000138de movs r1, 0 | r1 = 0;
0x000138e0 add r0, r4 | r0 += r4;
0x000138e2 adds r4, 4 | r4 += 4;
0x000138e4 blx 0xab8c | r0 = fcn_0000ab8c ();
0x000138e8 cmp r0, 0 |
| if (r0 == 0) {
0x000138ea beq 0x138d6 | goto label_0;
| }
0x000138ec pop {r3, r4, r5, r6, r7, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x17a2c */
| #include <stdint.h>
|
; (fcn) sym.apr_allocator_max_free_set () | void apr_allocator_max_free_set (int16_t arg1, int16_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x00017a2c push {r4, r5, r6, lr} |
0x00017a2e mov r4, r1 | r4 = r1;
0x00017a30 addw r4, r4, 0xfff | __asm ("addw r4, r4, aav.0x000000ff");
0x00017a34 mov r5, r0 | r5 = r0;
0x00017a36 lsrs r4, r4, 0xc | r4 >>= 0xc;
0x00017a38 blx 0x9a00 | r0 = fcn_00009a00 ();
| if (r0 != 0) {
0x00017a3c cbz r0, 0x17a60 |
0x00017a3e mov r6, r0 | r6 = r0;
0x00017a40 blx 0xa268 | fcn_0000a268 ();
0x00017a44 ldrd r2, r3, [r5, 4] | __asm ("ldrd r2, r3, [r5, 4]");
0x00017a48 mov r0, r6 | r0 = r6;
0x00017a4a str r4, [r5, 4] | *((r5 + 4)) = r4;
0x00017a4c subs r3, r3, r2 | r3 -= r2;
0x00017a4e add r3, r4 | r3 += r4;
0x00017a50 cmp r4, r3 |
0x00017a52 it hs |
| if (r4 < r3) {
0x00017a54 movhs r4, r3 | r4 = r3;
| }
0x00017a56 str r4, [r5, 8] | *((r5 + 8)) = r4;
0x00017a58 pop.w {r4, r5, r6, lr} |
0x00017a5c b.w 0xacf8 | void (*0xacf8)() ();
| }
0x00017a60 ldrd r2, r3, [r5, 4] | __asm ("ldrd r2, r3, [r5, 4]");
0x00017a64 str r4, [r5, 4] | *((r5 + 4)) = r4;
0x00017a66 subs r3, r3, r2 | r3 -= r2;
0x00017a68 add r3, r4 | r3 += r4;
0x00017a6a cmp r4, r3 |
0x00017a6c it hs |
| if (r4 < r3) {
0x00017a6e movhs r4, r3 | r4 = r3;
| }
0x00017a70 str r4, [r5, 8] | *((r5 + 8)) = r4;
0x00017a72 pop {r4, r5, r6, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x12748 */
| #include <stdint.h>
|
; (fcn) sym.apr_array_pstrcat () | void apr_array_pstrcat (int16_t arg1, int16_t arg2, int16_t arg3) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00012748 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0001274c mov sl, r0 | sl = r0;
0x0001274e ldr r7, [r1, 8] | r7 = *((r1 + 8));
0x00012750 cmp r7, 0 |
| if (r7 <= 0) {
0x00012752 ble 0x127ec | goto label_4;
| }
0x00012754 ldr r6, [r1, 0x10] | r6 = *((r1 + 0x10));
0x00012756 mov sb, r1 | sb = r1;
0x00012758 cmp r6, 0 |
| if (r6 == 0) {
0x0001275a beq 0x127ec | goto label_4;
| }
0x0001275c movs r4, 0 | r4 = 0;
0x0001275e mov r8, r2 | r8 = r2;
0x00012760 subs r6, 4 | r6 -= 4;
0x00012762 mov r5, r4 | r5 = r4;
| do {
0x00012764 ldr r0, [r6, 4]! | r0 = *((r6 += 4));
0x00012768 adds r4, 1 | r4++;
| if (r0 != 0) {
0x0001276a cbz r0, 0x12772 |
| label_0:
0x0001276c blx 0xa40c | r0 = fcn_0000a40c ();
0x00012770 add r5, r0 | r5 += r0;
| }
0x00012772 cmp r7, r4 |
| if (r7 == r4) {
0x00012774 beq 0x1278c | goto label_5;
| }
| label_1:
0x00012776 cmp.w r8, 0 |
0x0001277a beq 0x12764 |
| } while (r8 == 0);
0x0001277c ldr r0, [r6, 4]! | r0 = *((r6 += 4));
0x00012780 adds r5, 1 | r5++;
0x00012782 adds r4, 1 | r4++;
0x00012784 cmp r0, 0 |
| if (r0 != 0) {
0x00012786 bne 0x1276c | goto label_0;
| }
0x00012788 cmp r7, r4 |
| if (r7 != r4) {
0x0001278a bne 0x12776 | goto label_1;
| }
| label_5:
0x0001278c adds r1, r5, 1 | r1 = r5 + 1;
0x0001278e mov r0, sl | r0 = sl;
0x00012790 blx 0xa0d0 | fcn_0000a0d0 ();
0x00012794 ldr.w r4, [sb, 0x10] | r4 = *((sb + 0x10));
0x00012798 mov sl, r0 | sl = r0;
0x0001279a mov r6, r0 | r6 = r0;
0x0001279c movs r5, 0 | r5 = 0;
| do {
0x0001279e adds r5, 1 | r5++;
| if (r4 != 0) {
0x000127a0 cbz r4, 0x127b8 |
| label_2:
0x000127a2 ldr r7, [r4] | r7 = *(r4);
0x000127a4 mov r0, r7 | r0 = r7;
| if (r7 == 0) {
0x000127a6 cbz r7, 0x127b8 | goto label_6;
| }
0x000127a8 blx 0xa40c | fcn_0000a40c ();
0x000127ac mov r1, r7 | r1 = r7;
0x000127ae mov r2, r0 | r2 = r0;
0x000127b0 mov r0, r6 | r0 = r6;
0x000127b2 add r6, r2 | r6 += r2;
0x000127b4 blx 0x9cf8 | fcn_00009cf8 ();
| }
| label_6:
0x000127b8 ldr.w r2, [sb, 8] | r2 = *((sb + 8));
0x000127bc mov r3, r6 | r3 = r6;
0x000127be adds r4, 4 | r4 += 4;
0x000127c0 cmp r2, r5 |
| if (r2 <= r5) {
0x000127c2 ble 0x127e2 | goto label_7;
| }
| label_3:
0x000127c4 cmp.w r8, 0 |
0x000127c8 beq 0x1279e |
| } while (r8 == 0);
0x000127ca strb r8, [r3], 1 | *(r3) = r8;
| r3++;
0x000127ce adds r5, 1 | r5++;
0x000127d0 mov r6, r3 | r6 = r3;
0x000127d2 cmp r4, 0 |
| if (r4 != 0) {
0x000127d4 bne 0x127a2 | goto label_2;
| }
0x000127d6 ldr.w r2, [sb, 8] | r2 = *((sb + 8));
0x000127da mov r3, r6 | r3 = r6;
0x000127dc adds r4, 4 | r4 += 4;
0x000127de cmp r2, r5 |
| if (r2 > r5) {
0x000127e0 bgt 0x127c4 | goto label_3;
| }
| label_7:
0x000127e2 movs r3, 0 | r3 = 0;
0x000127e4 mov r0, sl | r0 = sl;
0x000127e6 strb r3, [r6] | *(r6) = r3;
0x000127e8 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_4:
0x000127ec movs r1, 1 | r1 = 1;
0x000127ee mov r0, sl | r0 = sl;
0x000127f0 blx 0xa0d0 | fcn_0000a0d0 ();
0x000127f4 movs r3, 0 | r3 = 0;
0x000127f6 mov sl, r0 | sl = r0;
0x000127f8 strb r3, [r0] | *(r0) = r3;
0x000127fa mov r0, sl | r0 = sl;
0x000127fc pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x13734).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x13a74).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x136e4).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x13598 */
| #include <stdint.h>
|
; (fcn) sym.apr_atomic_init () | void apr_atomic_init (int16_t arg1) {
| r0 = arg1;
| label_1:
0x0000aa2c invalid | void (*0xaa30)() ();
0x00013598 push {r3, r4, r5, r6, r7, lr} |
0x0001359a ldr r7, [pc, 0x48] |
0x0001359c ldr r5, [pc, 0x48] |
0x0001359e add r7, pc | r7 = 0x26b88;
0x000135a0 ldr r4, [r7] | r4 = *(0x26b88);
0x000135a2 add r5, pc | r5 = 0x26b8e;
| if (r4 == 0) {
0x000135a4 cbz r4, 0x135aa | goto label_2;
| }
0x000135a6 movs r0, 0 | r0 = 0;
| do {
0x000135a8 pop {r3, r4, r5, r6, r7, pc} |
| label_2:
0x000135aa movs r1, 0x1c | r1 = 0x1c;
0x000135ac mov r6, r0 | r6 = r0;
0x000135ae blx 0xa0d0 | fcn_0000a0d0 ();
0x000135b2 ldr r3, [pc, 0x38] | r3 = *(0x135ee);
0x000135b4 mov r1, r0 | r1 = r0;
0x000135b6 ldr r2, [pc, 0x38] |
0x000135b8 str r0, [r7] | *(r7) = r0;
0x000135ba mov r0, r6 | r0 = r6;
0x000135bc ldr r3, [r5, r3] | r3 = *((r5 + r3));
0x000135be add r2, pc | r2 = 0x26bb4;
0x000135c0 blx 0x9fb0 | fcn_00009fb0 ();
| label_0:
0x000135c4 ldr r0, [r7] | r0 = *(r7);
0x000135c6 mov r2, r6 | r2 = r6;
0x000135c8 movs r1, 0 | r1 = 0;
0x000135ca add r0, r4 | r0 += r4;
0x000135cc adds r4, 4 | r4 += 4;
0x000135ce blx 0xab8c | r0 = fcn_0000ab8c ();
0x000135d2 cmp r0, 0 |
0x000135d4 bne 0x135a8 |
| } while (r0 != 0);
0x000135d6 cmp r4, 0x1c |
| if (r4 != 0x1c) {
0x000135d8 bne 0x135c4 | goto label_0;
| }
0x000135da mov r0, r6 | r0 = r6;
0x000135dc pop.w {r3, r4, r5, r6, r7, lr} |
0x000135e0 b.w 0xaa2c | goto label_1;
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x13908).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x139b8).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1eff8).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xc62c */
| #include <stdint.h>
|
; (fcn) sym.apr_decode_base16 () | void apr_decode_base16 (int16_t arg_18h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000c62c mvnsmi lr, sp, lsr 18 | __asm ("mvnsmi lr, sp, lsr 18");
0x0000c630 ldr r4, [sp, 0x18] | r4 = *(arg_18h);
0x0000c632 cmp r1, 0 |
| if (r1 == 0) {
0x0000c634 beq.w 0xc77a | goto label_7;
| }
0x0000c638 mov r7, r3 | r7 = r3;
0x0000c63a adds r3, r2, 1 | r3 = r2 + 1;
0x0000c63c mov r6, r0 | r6 = r0;
0x0000c63e mov r5, r1 | r5 = r1;
| if (r3 == r2) {
0x0000c640 bne 0xc64a |
0x0000c642 mov r0, r1 | r0 = r1;
0x0000c644 blx 0xa40c | r0 = fcn_0000a40c ();
0x0000c648 mov r2, r0 | r2 = r0;
| }
0x0000c64a ldr r0, [pc, 0x150] |
0x0000c64c mov ip, r5 |
0x0000c64e ldrb r3, [ip], 1 | r3 = *(ip);
| ip++;
0x0000c652 add r0, pc | r0 = 0x18df4;
0x0000c654 add r3, r0 | r3 += r0;
0x0000c656 ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
0x0000c65a cmp r3, 0x10 |
| if (r3 == 0x10) {
0x0000c65c beq.w 0xc786 | goto label_8;
| }
| if (r2 != 0) {
0x0000c660 cbnz r2, 0xc66a | goto label_9;
| }
0x0000c662 b 0xc78a | goto label_10;
| do {
0x0000c664 cmp r2, 0 |
| if (r2 == 0) {
0x0000c666 beq.w 0xc76e | goto label_11;
| }
| label_9:
0x0000c66a ldrb lr, [ip], 1 |
0x0000c66e subs r2, 1 | r2--;
0x0000c670 add lr, r0 | lr += r0;
0x0000c672 ldrb.w r1, [lr, 0x3f8] | r1 = *((lr + 0x3f8));
0x0000c676 cmp r1, 0x10 |
0x0000c678 bne 0xc664 |
| } while (r1 != 0x10);
0x0000c67a sub.w r1, ip, r5 | r1 = ip - r5;
0x0000c67e subs r1, 1 | r1--;
| label_3:
0x0000c680 ldr.w r8, [pc, 0x11c] |
0x0000c684 ldrb r0, [ip], 1 | r0 = *(ip);
| ip++;
0x0000c688 add r8, pc | r8 = 0x18e2c;
0x0000c68a add r0, r8 | r0 += r8;
0x0000c68c ldrb.w r0, [r0, 0x3f8] | r0 = *((r0 + 0x3f8));
0x0000c690 cmp r0, 0x10 |
| if (r0 < 0x10) {
0x0000c692 bls 0xc6a8 | goto label_12;
| }
| do {
0x0000c694 cmp r2, 0 |
| if (r2 == 0) {
0x0000c696 beq 0xc724 | goto label_13;
| }
0x0000c698 ldrb lr, [ip], 1 |
0x0000c69c subs r2, 1 | r2--;
0x0000c69e add lr, r8 | lr += r8;
0x0000c6a0 ldrb.w r0, [lr, 0x3f8] | r0 = *((lr + 0x3f8));
0x0000c6a4 cmp r0, 0x10 |
0x0000c6a6 bhi 0xc694 |
| } while (r0 > 0x10);
| label_12:
0x0000c6a8 mvns r7, r7 | r7 = ~r7;
0x0000c6aa movw r0, 0x117c |
0x0000c6ae cmp r2, 0 |
0x0000c6b0 ite eq |
| if (r2 != 0) {
0x0000c6b2 moveq r7, 0 | r7 = 0;
| }
| if (r2 == 0) {
0x0000c6b4 andne r7, r7, 1 | r7 &= 1;
| }
0x0000c6b8 movt r0, 1 | r0 = 0x1117c;
0x0000c6bc cmp r7, 0 |
0x0000c6be it eq |
| if (r7 != 0) {
0x0000c6c0 moveq r0, 0 | r0 = 0;
| }
| if (r6 == 0) {
| label_2:
0x0000c6c2 cbz r6, 0xc72a | goto label_14;
| }
| label_0:
0x0000c6c4 cmp r1, 1 |
| if (r1 < 1) {
0x0000c6c6 bls 0xc796 | goto label_15;
| }
0x0000c6c8 ldr.w lr, [pc, 0xd8] |
0x0000c6cc mov r7, r6 | r7 = r6;
0x0000c6ce ldr.w ip, [pc, 0xd8] |
0x0000c6d2 add lr, pc | lr += pc;
0x0000c6d4 add ip, pc | ip = 0x18e82;
0x0000c6d6 b 0xc6e0 |
| while (r1 > 1) {
0x0000c6d8 ldrb r3, [r5] | r3 = *(r5);
0x0000c6da add r3, ip | r3 += ip;
0x0000c6dc ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
0x0000c6e0 cmp r3, 0x10 |
0x0000c6e2 mov r2, r7 | r2 = r7;
0x0000c6e4 itt hi |
| if (r3 <= 0x10) {
0x0000c6e6 addhi r5, 1 | r5++;
| }
| if (r3 <= 0x10) {
0x0000c6e8 addhi r1, r1, -1 | r1 += -1;
| }
| if (r3 <= 0x10) {
0x0000c6ec bhi 0xc704 |
0x0000c6ee ldrb r7, [r5, 1] | r7 = *((r5 + 1));
0x0000c6f0 subs r1, 2 | r1 -= 2;
0x0000c6f2 adds r5, 2 | r5 += 2;
0x0000c6f4 add r7, lr | r7 += lr;
0x0000c6f6 ldrb.w r7, [r7, 0x3f8] | r7 = *((r7 + 0x3f8));
0x0000c6fa orr.w r3, r7, r3, lsl 4 | r3 = r7 | (r3 << 4);
0x0000c6fe strb r3, [r2], 1 | *(r2) = r3;
| r2++;
0x0000c702 mov r7, r2 | r7 = r2;
| }
0x0000c704 cmp r1, 1 |
0x0000c706 bhi 0xc6d8 |
| }
| label_6:
0x0000c708 movw r3, 0x117c |
0x0000c70c movt r3, 1 | r3 = 0x1117c;
0x0000c710 cmp r1, 1 |
0x0000c712 it eq |
| if (r1 != 1) {
0x0000c714 moveq r0, r3 | r0 = r3;
| }
| if (r4 != 0) {
| label_5:
0x0000c716 cbz r4, 0xc71c |
0x0000c718 subs r6, r7, r6 | r6 = r7 - r6;
0x0000c71a str r6, [r4] | *(r4) = r6;
| }
0x0000c71c movs r3, 0 | r3 = 0;
0x0000c71e strb r3, [r7] | *(r7) = r3;
| label_1:
0x0000c720 pop.w {r4, r5, r6, r7, r8, pc} |
| label_13:
0x0000c724 mov r0, r2 | r0 = r2;
0x0000c726 cmp r6, 0 |
| if (r6 != 0) {
0x0000c728 bne 0xc6c4 | goto label_0;
| }
| label_14:
0x0000c72a mov r2, r6 | r2 = r6;
0x0000c72c ldr r6, [pc, 0x7c] |
0x0000c72e cmp r1, 1 |
0x0000c730 add r6, pc | r6 = 0x18ee0;
| if (r1 > 1) {
0x0000c732 bhi 0xc73e | goto label_16;
| }
0x0000c734 b 0xc754 | goto label_17;
| do {
0x0000c736 ldrb r3, [r5] | r3 = *(r5);
0x0000c738 add r3, r6 | r3 += r6;
0x0000c73a ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
| label_16:
0x0000c73e cmp r3, 0x10 |
0x0000c740 itete hi |
| if (r3 <= 0x10) {
0x0000c742 addhi r1, r1, -1 | r1 += -1;
| }
| if (r3 <= 0x10) {
0x0000c746 subhi r1, 2 | r1 -= 2;
| }
| if (r3 > 0x10) {
0x0000c748 addls r5, 1 | r5++;
| }
| if (r3 <= 0x10) {
0x0000c74a adds r5, 2 | r5 += 2;
| }
0x0000c74c it ls |
| if (r5 > 2) {
0x0000c74e addls r2, 1 | r2++;
| }
0x0000c750 cmp r1, 1 |
0x0000c752 bhi 0xc736 |
| } while (r1 > 1);
| label_17:
0x0000c754 movw r3, 0x117c |
0x0000c758 movt r3, 1 | r3 = 0x1117c;
0x0000c75c cmp r1, 1 |
0x0000c75e it eq |
| if (r1 != 1) {
0x0000c760 moveq r0, r3 | r0 = r3;
| }
| label_4:
0x0000c762 cmp r4, 0 |
| if (r4 == 0) {
0x0000c764 beq 0xc720 | goto label_1;
| }
0x0000c766 adds r2, 1 | r2++;
0x0000c768 str r2, [r4] | *(r4) = r2;
0x0000c76a pop.w {r4, r5, r6, r7, r8, pc} |
| label_11:
0x0000c76e sub.w ip, ip, r5 |
0x0000c772 mov r0, r2 | r0 = r2;
0x0000c774 add.w r1, ip, -1 | r1 = ip + -1;
0x0000c778 b 0xc6c2 | goto label_2;
| label_7:
0x0000c77a movw r0, 0x117f |
0x0000c77e movt r0, 1 | r0 = 0x1117f;
0x0000c782 pop.w {r4, r5, r6, r7, r8, pc} |
| label_8:
0x0000c786 movs r1, 0 | r1 = 0;
0x0000c788 b 0xc680 | goto label_3;
| label_10:
0x0000c78a mov r0, r2 | r0 = r2;
0x0000c78c cmp r6, 0 |
| if (r6 == 0) {
0x0000c78e beq 0xc762 | goto label_4;
| }
0x0000c790 mov r7, r6 | r7 = r6;
0x0000c792 mov r0, r2 | r0 = r2;
0x0000c794 b 0xc716 | goto label_5;
| label_15:
0x0000c796 mov r7, r6 | r7 = r6;
0x0000c798 b 0xc708 | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xc7b0 */
| #include <stdint.h>
|
; (fcn) sym.apr_decode_base16_binary () | void apr_decode_base16_binary (int16_t arg_18h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000c7b0 push.w {r4, r5, r6, r7, r8, lr} |
0x0000c7b4 ldr r4, [sp, 0x18] | r4 = *(arg_18h);
0x0000c7b6 cmp r1, 0 |
| if (r1 == 0) {
0x0000c7b8 beq.w 0xc8f6 | goto label_7;
| }
0x0000c7bc mov r7, r3 | r7 = r3;
0x0000c7be adds r3, r2, 1 | r3 = r2 + 1;
0x0000c7c0 mov r6, r0 | r6 = r0;
0x0000c7c2 mov r5, r1 | r5 = r1;
| if (r3 == r2) {
0x0000c7c4 bne 0xc7ce |
0x0000c7c6 mov r0, r1 | r0 = r1;
0x0000c7c8 blx 0xa40c | r0 = fcn_0000a40c ();
0x0000c7cc mov r2, r0 | r2 = r0;
| }
0x0000c7ce ldr r0, [pc, 0x148] |
0x0000c7d0 mov ip, r5 |
0x0000c7d2 ldrb r3, [ip], 1 | r3 = *(ip);
| ip++;
0x0000c7d6 add r0, pc | r0 = 0x190f4;
0x0000c7d8 add r3, r0 | r3 += r0;
0x0000c7da ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
0x0000c7de cmp r3, 0x10 |
| if (r3 == 0x10) {
0x0000c7e0 beq.w 0xc902 | goto label_8;
| }
| if (r2 != 0) {
0x0000c7e4 cbnz r2, 0xc7ec | goto label_9;
| }
0x0000c7e6 b 0xc906 | goto label_10;
| do {
0x0000c7e8 cmp r2, 0 |
| if (r2 == 0) {
0x0000c7ea beq 0xc8ea | goto label_11;
| }
| label_9:
0x0000c7ec ldrb lr, [ip], 1 |
0x0000c7f0 subs r2, 1 | r2--;
0x0000c7f2 add lr, r0 | lr += r0;
0x0000c7f4 ldrb.w r1, [lr, 0x3f8] | r1 = *((lr + 0x3f8));
0x0000c7f8 cmp r1, 0x10 |
0x0000c7fa bne 0xc7e8 |
| } while (r1 != 0x10);
0x0000c7fc sub.w r1, ip, r5 | r1 = ip - r5;
0x0000c800 subs r1, 1 | r1--;
| label_3:
0x0000c802 ldr.w r8, [pc, 0x118] | r8 = *(0x0000c91c);
0x0000c806 ldrb r0, [ip], 1 | r0 = *(ip);
| ip++;
0x0000c80a add r8, pc | r8 += pc;
0x0000c80c add r0, r8 | r0 += r8;
0x0000c80e ldrb.w r0, [r0, 0x3f8] | r0 = *((r0 + 0x3f8));
0x0000c812 cmp r0, 0x10 |
| if (r0 < 0x10) {
0x0000c814 bls 0xc82a | goto label_12;
| }
| do {
0x0000c816 cmp r2, 0 |
| if (r2 == 0) {
0x0000c818 beq 0xc8a2 | goto label_13;
| }
0x0000c81a ldrb lr, [ip], 1 |
0x0000c81e subs r2, 1 | r2--;
0x0000c820 add lr, r8 | lr += r8;
0x0000c822 ldrb.w r0, [lr, 0x3f8] | r0 = *((lr + 0x3f8));
0x0000c826 cmp r0, 0x10 |
0x0000c828 bhi 0xc816 |
| } while (r0 > 0x10);
| label_12:
0x0000c82a mvns r7, r7 | r7 = ~r7;
0x0000c82c movw r0, 0x117c |
0x0000c830 cmp r2, 0 |
0x0000c832 ite eq |
| if (r2 != 0) {
0x0000c834 moveq r7, 0 | r7 = 0;
| }
| if (r2 == 0) {
0x0000c836 andne r7, r7, 1 | r7 &= 1;
| }
0x0000c83a movt r0, 1 | r0 = 0x1117c;
0x0000c83e cmp r7, 0 |
0x0000c840 it eq |
| if (r7 != 0) {
0x0000c842 moveq r0, 0 | r0 = 0;
| }
| if (r6 == 0) {
| label_2:
0x0000c844 cbz r6, 0xc8a8 | goto label_14;
| }
| label_0:
0x0000c846 cmp r1, 1 |
| if (r1 < 1) {
0x0000c848 bls 0xc912 | goto label_15;
| }
0x0000c84a ldr.w lr, [pc, 0xd4] |
0x0000c84e mov r7, r6 | r7 = r6;
0x0000c850 ldr.w ip, [pc, 0xd0] | ip = *(0x0000c924);
0x0000c854 add lr, pc | lr = 0x1917a;
0x0000c856 add ip, pc |
0x0000c858 b 0xc862 |
| while (r1 > 1) {
0x0000c85a ldrb r3, [r5] | r3 = *(r5);
0x0000c85c add r3, ip | r3 += ip;
0x0000c85e ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
0x0000c862 cmp r3, 0x10 |
0x0000c864 mov r2, r7 | r2 = r7;
0x0000c866 itt hi |
| if (r3 <= 0x10) {
0x0000c868 addhi r5, 1 | r5++;
| }
| if (r3 <= 0x10) {
0x0000c86a addhi r1, r1, -1 | r1 += -1;
| }
| if (r3 <= 0x10) {
0x0000c86e bhi 0xc886 |
0x0000c870 ldrb r7, [r5, 1] | r7 = *((r5 + 1));
0x0000c872 subs r1, 2 | r1 -= 2;
0x0000c874 adds r5, 2 | r5 += 2;
0x0000c876 add r7, lr | r7 += lr;
0x0000c878 ldrb.w r7, [r7, 0x3f8] | r7 = *((r7 + 0x3f8));
0x0000c87c orr.w r3, r7, r3, lsl 4 | r3 = r7 | (r3 << 4);
0x0000c880 strb r3, [r2], 1 | *(r2) = r3;
| r2++;
0x0000c884 mov r7, r2 | r7 = r2;
| }
0x0000c886 cmp r1, 1 |
0x0000c888 bhi 0xc85a |
| }
| label_6:
0x0000c88a movw r3, 0x117c |
0x0000c88e movt r3, 1 | r3 = 0x1117c;
0x0000c892 cmp r1, 1 |
0x0000c894 it eq |
| if (r1 != 1) {
0x0000c896 moveq r0, r3 | r0 = r3;
| }
| if (r4 != 0) {
| label_5:
0x0000c898 cbz r4, 0xc89e |
0x0000c89a subs r7, r7, r6 | r7 -= r6;
0x0000c89c str r7, [r4] | *(r4) = r7;
| }
| label_1:
0x0000c89e pop.w {r4, r5, r6, r7, r8, pc} |
| label_13:
0x0000c8a2 mov r0, r2 | r0 = r2;
0x0000c8a4 cmp r6, 0 |
| if (r6 != 0) {
0x0000c8a6 bne 0xc846 | goto label_0;
| }
| label_14:
0x0000c8a8 mov r2, r6 | r2 = r6;
0x0000c8aa ldr r6, [pc, 0x7c] |
0x0000c8ac cmp r1, 1 |
0x0000c8ae add r6, pc | r6 = 0x191dc;
| if (r1 > 1) {
0x0000c8b0 bhi 0xc8bc | goto label_16;
| }
0x0000c8b2 b 0xc8d2 | goto label_17;
| do {
0x0000c8b4 ldrb r3, [r5] | r3 = *(r5);
0x0000c8b6 add r3, r6 | r3 += r6;
0x0000c8b8 ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
| label_16:
0x0000c8bc cmp r3, 0x10 |
0x0000c8be itete hi |
| if (r3 <= 0x10) {
0x0000c8c0 addhi r1, r1, -1 | r1 += -1;
| }
| if (r3 <= 0x10) {
0x0000c8c4 subhi r1, 2 | r1 -= 2;
| }
| if (r3 > 0x10) {
0x0000c8c6 addls r5, 1 | r5++;
| }
| if (r3 <= 0x10) {
0x0000c8c8 adds r5, 2 | r5 += 2;
| }
0x0000c8ca it ls |
| if (r5 > 2) {
0x0000c8cc addls r2, 1 | r2++;
| }
0x0000c8ce cmp r1, 1 |
0x0000c8d0 bhi 0xc8b4 |
| } while (r1 > 1);
| label_17:
0x0000c8d2 movw r3, 0x117c |
0x0000c8d6 movt r3, 1 | r3 = 0x1117c;
0x0000c8da cmp r1, 1 |
0x0000c8dc it eq |
| if (r1 != 1) {
0x0000c8de moveq r0, r3 | r0 = r3;
| }
| label_4:
0x0000c8e0 cmp r4, 0 |
| if (r4 == 0) {
0x0000c8e2 beq 0xc89e | goto label_1;
| }
0x0000c8e4 str r2, [r4] | *(r4) = r2;
0x0000c8e6 pop.w {r4, r5, r6, r7, r8, pc} |
| label_11:
0x0000c8ea sub.w ip, ip, r5 |
0x0000c8ee mov r0, r2 | r0 = r2;
0x0000c8f0 add.w r1, ip, -1 | r1 = ip + -1;
0x0000c8f4 b 0xc844 | goto label_2;
| label_7:
0x0000c8f6 movw r0, 0x117f |
0x0000c8fa movt r0, 1 | r0 = 0x1117f;
0x0000c8fe pop.w {r4, r5, r6, r7, r8, pc} |
| label_8:
0x0000c902 movs r1, 0 | r1 = 0;
0x0000c904 b 0xc802 | goto label_3;
| label_10:
0x0000c906 mov r0, r2 | r0 = r2;
0x0000c908 cmp r6, 0 |
| if (r6 == 0) {
0x0000c90a beq 0xc8e0 | goto label_4;
| }
0x0000c90c mov r7, r6 | r7 = r6;
0x0000c90e mov r0, r2 | r0 = r2;
0x0000c910 b 0xc898 | goto label_5;
| label_15:
0x0000c912 mov r7, r6 | r7 = r6;
0x0000c914 b 0xc88a | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xc7b0 */
| #include <stdint.h>
|
; (fcn) sym.apr_decode_base16_binary () | void apr_decode_base16_binary (int16_t arg_18h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000c7b0 push.w {r4, r5, r6, r7, r8, lr} |
0x0000c7b4 ldr r4, [sp, 0x18] | r4 = *(arg_18h);
0x0000c7b6 cmp r1, 0 |
| if (r1 == 0) {
0x0000c7b8 beq.w 0xc8f6 | goto label_7;
| }
0x0000c7bc mov r7, r3 | r7 = r3;
0x0000c7be adds r3, r2, 1 | r3 = r2 + 1;
0x0000c7c0 mov r6, r0 | r6 = r0;
0x0000c7c2 mov r5, r1 | r5 = r1;
| if (r3 == r2) {
0x0000c7c4 bne 0xc7ce |
0x0000c7c6 mov r0, r1 | r0 = r1;
0x0000c7c8 blx 0xa40c | r0 = fcn_0000a40c ();
0x0000c7cc mov r2, r0 | r2 = r0;
| }
0x0000c7ce ldr r0, [pc, 0x148] |
0x0000c7d0 mov ip, r5 |
0x0000c7d2 ldrb r3, [ip], 1 | r3 = *(ip);
| ip++;
0x0000c7d6 add r0, pc | r0 = 0x190f4;
0x0000c7d8 add r3, r0 | r3 += r0;
0x0000c7da ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
0x0000c7de cmp r3, 0x10 |
| if (r3 == 0x10) {
0x0000c7e0 beq.w 0xc902 | goto label_8;
| }
| if (r2 != 0) {
0x0000c7e4 cbnz r2, 0xc7ec | goto label_9;
| }
0x0000c7e6 b 0xc906 | goto label_10;
| do {
0x0000c7e8 cmp r2, 0 |
| if (r2 == 0) {
0x0000c7ea beq 0xc8ea | goto label_11;
| }
| label_9:
0x0000c7ec ldrb lr, [ip], 1 |
0x0000c7f0 subs r2, 1 | r2--;
0x0000c7f2 add lr, r0 | lr += r0;
0x0000c7f4 ldrb.w r1, [lr, 0x3f8] | r1 = *((lr + 0x3f8));
0x0000c7f8 cmp r1, 0x10 |
0x0000c7fa bne 0xc7e8 |
| } while (r1 != 0x10);
0x0000c7fc sub.w r1, ip, r5 | r1 = ip - r5;
0x0000c800 subs r1, 1 | r1--;
| label_3:
0x0000c802 ldr.w r8, [pc, 0x118] | r8 = *(0x0000c91c);
0x0000c806 ldrb r0, [ip], 1 | r0 = *(ip);
| ip++;
0x0000c80a add r8, pc | r8 += pc;
0x0000c80c add r0, r8 | r0 += r8;
0x0000c80e ldrb.w r0, [r0, 0x3f8] | r0 = *((r0 + 0x3f8));
0x0000c812 cmp r0, 0x10 |
| if (r0 < 0x10) {
0x0000c814 bls 0xc82a | goto label_12;
| }
| do {
0x0000c816 cmp r2, 0 |
| if (r2 == 0) {
0x0000c818 beq 0xc8a2 | goto label_13;
| }
0x0000c81a ldrb lr, [ip], 1 |
0x0000c81e subs r2, 1 | r2--;
0x0000c820 add lr, r8 | lr += r8;
0x0000c822 ldrb.w r0, [lr, 0x3f8] | r0 = *((lr + 0x3f8));
0x0000c826 cmp r0, 0x10 |
0x0000c828 bhi 0xc816 |
| } while (r0 > 0x10);
| label_12:
0x0000c82a mvns r7, r7 | r7 = ~r7;
0x0000c82c movw r0, 0x117c |
0x0000c830 cmp r2, 0 |
0x0000c832 ite eq |
| if (r2 != 0) {
0x0000c834 moveq r7, 0 | r7 = 0;
| }
| if (r2 == 0) {
0x0000c836 andne r7, r7, 1 | r7 &= 1;
| }
0x0000c83a movt r0, 1 | r0 = 0x1117c;
0x0000c83e cmp r7, 0 |
0x0000c840 it eq |
| if (r7 != 0) {
0x0000c842 moveq r0, 0 | r0 = 0;
| }
| if (r6 == 0) {
| label_2:
0x0000c844 cbz r6, 0xc8a8 | goto label_14;
| }
| label_0:
0x0000c846 cmp r1, 1 |
| if (r1 < 1) {
0x0000c848 bls 0xc912 | goto label_15;
| }
0x0000c84a ldr.w lr, [pc, 0xd4] |
0x0000c84e mov r7, r6 | r7 = r6;
0x0000c850 ldr.w ip, [pc, 0xd0] | ip = *(0x0000c924);
0x0000c854 add lr, pc | lr = 0x1917a;
0x0000c856 add ip, pc |
0x0000c858 b 0xc862 |
| while (r1 > 1) {
0x0000c85a ldrb r3, [r5] | r3 = *(r5);
0x0000c85c add r3, ip | r3 += ip;
0x0000c85e ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
0x0000c862 cmp r3, 0x10 |
0x0000c864 mov r2, r7 | r2 = r7;
0x0000c866 itt hi |
| if (r3 <= 0x10) {
0x0000c868 addhi r5, 1 | r5++;
| }
| if (r3 <= 0x10) {
0x0000c86a addhi r1, r1, -1 | r1 += -1;
| }
| if (r3 <= 0x10) {
0x0000c86e bhi 0xc886 |
0x0000c870 ldrb r7, [r5, 1] | r7 = *((r5 + 1));
0x0000c872 subs r1, 2 | r1 -= 2;
0x0000c874 adds r5, 2 | r5 += 2;
0x0000c876 add r7, lr | r7 += lr;
0x0000c878 ldrb.w r7, [r7, 0x3f8] | r7 = *((r7 + 0x3f8));
0x0000c87c orr.w r3, r7, r3, lsl 4 | r3 = r7 | (r3 << 4);
0x0000c880 strb r3, [r2], 1 | *(r2) = r3;
| r2++;
0x0000c884 mov r7, r2 | r7 = r2;
| }
0x0000c886 cmp r1, 1 |
0x0000c888 bhi 0xc85a |
| }
| label_6:
0x0000c88a movw r3, 0x117c |
0x0000c88e movt r3, 1 | r3 = 0x1117c;
0x0000c892 cmp r1, 1 |
0x0000c894 it eq |
| if (r1 != 1) {
0x0000c896 moveq r0, r3 | r0 = r3;
| }
| if (r4 != 0) {
| label_5:
0x0000c898 cbz r4, 0xc89e |
0x0000c89a subs r7, r7, r6 | r7 -= r6;
0x0000c89c str r7, [r4] | *(r4) = r7;
| }
| label_1:
0x0000c89e pop.w {r4, r5, r6, r7, r8, pc} |
| label_13:
0x0000c8a2 mov r0, r2 | r0 = r2;
0x0000c8a4 cmp r6, 0 |
| if (r6 != 0) {
0x0000c8a6 bne 0xc846 | goto label_0;
| }
| label_14:
0x0000c8a8 mov r2, r6 | r2 = r6;
0x0000c8aa ldr r6, [pc, 0x7c] |
0x0000c8ac cmp r1, 1 |
0x0000c8ae add r6, pc | r6 = 0x191dc;
| if (r1 > 1) {
0x0000c8b0 bhi 0xc8bc | goto label_16;
| }
0x0000c8b2 b 0xc8d2 | goto label_17;
| do {
0x0000c8b4 ldrb r3, [r5] | r3 = *(r5);
0x0000c8b6 add r3, r6 | r3 += r6;
0x0000c8b8 ldrb.w r3, [r3, 0x3f8] | r3 = *((r3 + 0x3f8));
| label_16:
0x0000c8bc cmp r3, 0x10 |
0x0000c8be itete hi |
| if (r3 <= 0x10) {
0x0000c8c0 addhi r1, r1, -1 | r1 += -1;
| }
| if (r3 <= 0x10) {
0x0000c8c4 subhi r1, 2 | r1 -= 2;
| }
| if (r3 > 0x10) {
0x0000c8c6 addls r5, 1 | r5++;
| }
| if (r3 <= 0x10) {
0x0000c8c8 adds r5, 2 | r5 += 2;
| }
0x0000c8ca it ls |
| if (r5 > 2) {
0x0000c8cc addls r2, 1 | r2++;
| }
0x0000c8ce cmp r1, 1 |
0x0000c8d0 bhi 0xc8b4 |
| } while (r1 > 1);
| label_17:
0x0000c8d2 movw r3, 0x117c |
0x0000c8d6 movt r3, 1 | r3 = 0x1117c;
0x0000c8da cmp r1, 1 |
0x0000c8dc it eq |
| if (r1 != 1) {
0x0000c8de moveq r0, r3 | r0 = r3;
| }
| label_4:
0x0000c8e0 cmp r4, 0 |
| if (r4 == 0) {
0x0000c8e2 beq 0xc89e | goto label_1;
| }
0x0000c8e4 str r2, [r4] | *(r4) = r2;
0x0000c8e6 pop.w {r4, r5, r6, r7, r8, pc} |
| label_11:
0x0000c8ea sub.w ip, ip, r5 |
0x0000c8ee mov r0, r2 | r0 = r2;
0x0000c8f0 add.w r1, ip, -1 | r1 = ip + -1;
0x0000c8f4 b 0xc844 | goto label_2;
| label_7:
0x0000c8f6 movw r0, 0x117f |
0x0000c8fa movt r0, 1 | r0 = 0x1117f;
0x0000c8fe pop.w {r4, r5, r6, r7, r8, pc} |
| label_8:
0x0000c902 movs r1, 0 | r1 = 0;
0x0000c904 b 0xc802 | goto label_3;
| label_10:
0x0000c906 mov r0, r2 | r0 = r2;
0x0000c908 cmp r6, 0 |
| if (r6 == 0) {
0x0000c90a beq 0xc8e0 | goto label_4;
| }
0x0000c90c mov r7, r6 | r7 = r6;
0x0000c90e mov r0, r2 | r0 = r2;
0x0000c910 b 0xc898 | goto label_5;
| label_15:
0x0000c912 mov r7, r6 | r7 = r6;
0x0000c914 b 0xc88a | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xbd48 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) sym.apr_decode_base32 () | void apr_decode_base32 (int16_t arg_28h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000bd48 push.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000bd4c ldr r7, [sp, 0x28] | r7 = *(arg_28h);
0x0000bd4e cmp r1, 0 |
| if (r1 == 0) {
0x0000bd50 beq.w 0xbfc8 | goto label_8;
| }
0x0000bd54 mov r8, r3 | r8 = r3;
0x0000bd56 adds r3, r2, 1 | r3 = r2 + 1;
0x0000bd58 mov r6, r0 | r6 = r0;
0x0000bd5a mov r5, r1 | r5 = r1;
| if (r3 == r2) {
0x0000bd5c beq.w 0xbf0c | goto label_9;
| }
0x0000bd60 cmp r6, 0 |
| if (r6 == 0) {
0x0000bd62 beq.w 0xbeee | goto label_1;
| }
| label_0:
0x0000bd66 tst.w r8, 8 |
0x0000bd6a mov r0, r2 | r0 = r2;
| if ((r8 & 8) != 0) {
0x0000bd6c bne.w 0xbfa4 | goto label_10;
| }
0x0000bd70 ldr.w ip, [pc, 0x274] |
0x0000bd74 add ip, pc |
0x0000bd76 add.w ip, ip, 0x2d0 | ip = 0x18030;
| label_4:
0x0000bd7a mov r1, r5 | r1 = r5;
0x0000bd7c ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000bd80 ldrb.w lr, [ip, r3] |
0x0000bd84 cmp.w lr, 0x1f |
| if (lr > 0x1f) {
0x0000bd88 bhi.w 0xbfe4 | goto label_11;
| }
| if (r2 != 0) {
0x0000bd8c cbnz r2, 0xbd96 | goto label_12;
| }
0x0000bd8e b 0xbfd4 | goto label_13;
| do {
0x0000bd90 cmp r0, 0 |
| if (r0 == 0) {
0x0000bd92 beq.w 0xbfb0 | goto label_14;
| }
| label_12:
0x0000bd96 ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000bd9a subs r0, 1 | r0--;
0x0000bd9c ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bda0 cmp r3, 0x1f |
0x0000bda2 bls 0xbd90 |
| } while (r3 < 0x1f);
0x0000bda4 subs r2, r1, r5 | r2 = r1 - r5;
0x0000bda6 subs r2, 1 | r2--;
| label_7:
0x0000bda8 ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000bdac ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bdb0 cmp r3, 0x20 |
| if (r3 < 0x20) {
0x0000bdb2 bls 0xbdc4 | goto label_15;
| }
| if (r0 == 0) {
| do {
0x0000bdb4 cbz r0, 0xbde4 | goto label_5;
| }
0x0000bdb6 ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000bdba subs r0, 1 | r0--;
0x0000bdbc ldrb.w r4, [ip, r3] | r4 = *((ip + r3));
0x0000bdc0 cmp r4, 0x20 |
0x0000bdc2 bhi 0xbdb4 |
| } while (r4 > 0x20);
| label_15:
0x0000bdc4 mvn.w r8, r8 | r8 = ~r8;
0x0000bdc8 cmp r0, 0 |
0x0000bdca ite eq |
| if (r0 != 0) {
0x0000bdcc moveq r8, 0 | r8 = 0;
| }
| if (r0 != 0) {
0x0000bdd0 and r8, r8, 1 | r8 &= 1;
| }
0x0000bdd4 movw r0, 0x117c |
0x0000bdd8 cmp.w r8, 0 |
0x0000bddc movt r0, 1 | r0 = 0x1117c;
0x0000bde0 it eq |
| if (r8 != 0) {
0x0000bde2 moveq r0, 0 | r0 = 0;
| }
| label_5:
0x0000bde4 cmp r2, 8 |
| if (r2 < 8) {
0x0000bde6 bls.w 0xbfe0 | goto label_16;
| }
0x0000bdea sub.w r1, r2, 9 | r1 = r2 - 9;
0x0000bdee adds r4, r6, 5 | r4 = r6 + 5;
0x0000bdf0 bic sb, r1, 7 | sb = BIT_MASK (r1, 7);
0x0000bdf4 mov r3, r5 | r3 = r5;
0x0000bdf6 lsrs r1, r1, 3 | r1 >>= 3;
0x0000bdf8 add.w r8, sb, r5 | r8 = sb + r5;
0x0000bdfc b 0xbe06 |
| while (r8 != r3) {
0x0000bdfe ldrb lr, [r3, 8]! |
0x0000be02 ldrb.w lr, [ip, lr] |
0x0000be06 ldrb.w sl, [r3, 1] | sl = *((r3 + 1));
0x0000be0a lsl.w lr, lr, 3 | lr <<= 3;
0x0000be0e adds r4, 5 | r4 += 5;
0x0000be10 cmp r8, r3 |
0x0000be12 ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000be16 orr.w lr, lr, sl, lsr 2 | lr |= (sl >> 2);
0x0000be1a strb lr, [r4, -0xa] |
0x0000be1e ldrb.w lr, [r3, 2] |
0x0000be22 ldrb.w fp, [r3, 1] | fp = *((r3 + 1));
0x0000be26 ldrb.w sl, [r3, 3] | sl = *((r3 + 3));
0x0000be2a ldrb.w lr, [ip, lr] |
0x0000be2e ldrb.w fp, [ip, fp] | fp = *((ip + fp));
0x0000be32 ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000be36 lsl.w lr, lr, 1 | lr <<= 1;
0x0000be3a orr.w lr, lr, fp, lsl 6 | lr |= (fp << 6);
0x0000be3e orr.w lr, lr, sl, lsr 4 | lr |= (sl >> 4);
0x0000be42 strb lr, [r4, -0x9] |
0x0000be46 ldrb.w lr, [r3, 3] |
0x0000be4a ldrb.w sl, [r3, 4] | sl = *((r3 + 4));
0x0000be4e ldrb.w lr, [ip, lr] |
0x0000be52 ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000be56 lsl.w lr, lr, 4 | lr <<= 4;
0x0000be5a orr.w lr, lr, sl, lsr 1 | lr |= (sl >> 1);
0x0000be5e strb lr, [r4, -0x8] |
0x0000be62 ldrb.w lr, [r3, 5] |
0x0000be66 ldrb.w fp, [r3, 4] | fp = *((r3 + 4));
0x0000be6a ldrb.w sl, [r3, 6] | sl = *((r3 + 6));
0x0000be6e ldrb.w lr, [ip, lr] |
0x0000be72 ldrb.w fp, [ip, fp] | fp = *((ip + fp));
0x0000be76 ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000be7a lsl.w lr, lr, 2 | lr <<= 2;
0x0000be7e orr.w lr, lr, fp, lsl 7 | lr |= (fp << 7);
0x0000be82 orr.w lr, lr, sl, lsr 3 | lr |= (sl >> 3);
0x0000be86 strb lr, [r4, -0x7] |
0x0000be8a ldrb.w sl, [r3, 6] | sl = *((r3 + 6));
0x0000be8e ldrb.w lr, [r3, 7] |
0x0000be92 ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000be96 ldrb.w lr, [ip, lr] |
0x0000be9a orr.w lr, lr, sl, lsl 5 | lr |= (sl << 5);
0x0000be9e strb lr, [r4, -0x6] |
0x0000bea2 bne 0xbdfe |
| }
0x0000bea4 adds r1, 1 | r1++;
0x0000bea6 subs r2, 8 | r2 -= 8;
0x0000bea8 add.w r5, r5, r1, lsl 3 | r5 += (r1 << 3);
0x0000beac add.w r1, r1, r1, lsl 2 | r1 += (r1 << 2);
0x0000beb0 sub.w r2, r2, sb | r2 -= sb;
0x0000beb4 add r1, r6 | r1 += r6;
| label_6:
0x0000beb6 cmp r2, 1 |
| if (r2 != 1) {
0x0000beb8 beq 0xbed8 |
| if (r2 < 1) {
0x0000beba bls 0xbf1c | goto label_17;
| }
0x0000bebc ldrb r3, [r5] | r3 = *(r5);
0x0000bebe cmp r2, 3 |
0x0000bec0 ldrb r4, [r5, 1] | r4 = *((r5 + 1));
0x0000bec2 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bec6 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000beca lsl.w r3, r3, 3 | r3 <<= 3;
0x0000bece orr.w r3, r3, r4, lsr 2 | r3 |= (r4 >> 2);
0x0000bed2 strb r3, [r1], 1 | *(r1) = r3;
| r1++;
| if (r2 != 3) {
0x0000bed6 bne 0xbf1c | goto label_17;
| }
| }
| label_2:
0x0000bed8 movw r0, 0x117c |
0x0000bedc movt r0, 1 | r0 = 0x1117c;
| if (r7 != 0) {
| label_3:
0x0000bee0 cbz r7, 0xbee6 |
0x0000bee2 subs r6, r1, r6 | r6 = r1 - r6;
0x0000bee4 str r6, [r7] | *(r7) = r6;
| }
0x0000bee6 movs r3, 0 | r3 = 0;
0x0000bee8 strb r3, [r1] | *(r1) = r3;
0x0000beea pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_1:
0x0000beee mov r0, r7 | r0 = r7;
| if (r7 != 0) {
0x0000bef0 cbz r7, 0xbf08 |
0x0000bef2 add.w r3, r2, 0xe | r3 = r2 + 0xe;
0x0000bef6 adds r2, 7 | r2 += 7;
0x0000bef8 it pl |
| if (r2 < 7) {
0x0000befa movpl r3, r2 | r3 = r2;
| }
0x0000befc mov r0, r6 | r0 = r6;
0x0000befe asrs r3, r3, 3 | r3 >>= 3;
0x0000bf00 add.w r3, r3, r3, lsl 2 | r3 += (r3 << 2);
0x0000bf04 adds r3, 1 | r3++;
0x0000bf06 str r3, [r7] | *(r7) = r3;
| }
0x0000bf08 pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_9:
0x0000bf0c mov r0, r1 | r0 = r1;
0x0000bf0e blx 0xa40c | r0 = fcn_0000a40c ();
0x0000bf12 mov r2, r0 | r2 = r0;
0x0000bf14 cmp r6, 0 |
| if (r6 != 0) {
0x0000bf16 bne.w 0xbd66 | goto label_0;
| }
0x0000bf1a b 0xbeee | goto label_1;
| label_17:
0x0000bf1c cmp r2, 3 |
| if (r2 < 3) {
0x0000bf1e bls 0xbf64 | goto label_18;
| }
0x0000bf20 ldrb r3, [r5, 2] | r3 = *((r5 + 2));
0x0000bf22 cmp r2, 4 |
0x0000bf24 ldrb r4, [r5, 1] | r4 = *((r5 + 1));
0x0000bf26 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bf2a ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000bf2e lsl.w r3, r3, 1 | r3 <<= 1;
0x0000bf32 orr.w r3, r3, r4, lsl 6 | r3 |= (r4 << 6);
0x0000bf36 ldrb r4, [r5, 3] | r4 = *((r5 + 3));
0x0000bf38 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000bf3c orr.w r3, r3, r4, lsr 4 | r3 |= (r4 >> 4);
0x0000bf40 strb r3, [r1] | *(r1) = r3;
| if (r2 == 4) {
0x0000bf42 beq 0xbfc4 | goto label_19;
| }
0x0000bf44 ldrb r3, [r5, 3] | r3 = *((r5 + 3));
0x0000bf46 cmp r2, 6 |
0x0000bf48 ldrb r4, [r5, 4] | r4 = *((r5 + 4));
0x0000bf4a add.w r1, r1, 2 | r1 += 2;
0x0000bf4e ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bf52 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000bf56 lsl.w r3, r3, 4 | r3 <<= 4;
0x0000bf5a orr.w r3, r3, r4, lsr 1 | r3 |= (r4 >> 1);
0x0000bf5e strb r3, [r1, -0x1] | *((r1 - 0x1)) = r3;
| if (r2 == 6) {
0x0000bf62 beq 0xbed8 | goto label_2;
| }
| label_18:
0x0000bf64 cmp r2, 6 |
| if (r2 < 6) {
0x0000bf66 bls 0xbee0 | goto label_3;
| }
0x0000bf68 ldrb r3, [r5, 5] | r3 = *((r5 + 5));
0x0000bf6a cmp r2, 8 |
0x0000bf6c ldrb r4, [r5, 4] | r4 = *((r5 + 4));
0x0000bf6e ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bf72 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000bf76 lsl.w r3, r3, 2 | r3 <<= 2;
0x0000bf7a orr.w r3, r3, r4, lsl 7 | r3 |= (r4 << 7);
0x0000bf7e ldrb r4, [r5, 6] | r4 = *((r5 + 6));
0x0000bf80 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000bf84 orr.w r3, r3, r4, lsr 3 | r3 |= (r4 >> 3);
0x0000bf88 strb r3, [r1] | *(r1) = r3;
| if (r2 != 8) {
0x0000bf8a bne 0xbfc4 | goto label_19;
| }
0x0000bf8c ldrb r2, [r5, 6] | r2 = *((r5 + 6));
0x0000bf8e adds r1, 2 | r1 += 2;
0x0000bf90 ldrb r3, [r5, 7] | r3 = *((r5 + 7));
0x0000bf92 ldrb.w r2, [ip, r2] | r2 = *((ip + r2));
0x0000bf96 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bf9a orr.w r3, r3, r2, lsl 5 | r3 |= (r2 << 5);
0x0000bf9e strb r3, [r1, -0x1] | *((r1 - 0x1)) = r3;
0x0000bfa2 b 0xbee0 | goto label_3;
| label_10:
0x0000bfa4 ldr.w ip, [pc, 0x44] |
0x0000bfa8 add ip, pc |
0x0000bfaa add.w ip, ip, 0x1d0 | ip = 0x18168;
0x0000bfae b 0xbd7a | goto label_4;
| label_14:
0x0000bfb0 ldrb r3, [r1] | r3 = *(r1);
0x0000bfb2 subs r1, r1, r5 | r1 -= r5;
0x0000bfb4 subs r2, r1, 1 | r2 = r1 - 1;
0x0000bfb6 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bfba cmp r3, 0x20 |
| if (r3 > 0x20) {
0x0000bfbc bhi.w 0xbde4 | goto label_5;
| }
| do {
0x0000bfc0 movs r0, 0 | r0 = 0;
0x0000bfc2 b 0xbde4 | goto label_5;
| label_19:
0x0000bfc4 adds r1, 1 | r1++;
0x0000bfc6 b 0xbee0 | goto label_3;
| label_8:
0x0000bfc8 movw r0, 0x117f |
0x0000bfcc movt r0, 1 | r0 = 0x1117f;
0x0000bfd0 pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_13:
0x0000bfd4 ldrb r3, [r5, 1] | r3 = *((r5 + 1));
0x0000bfd6 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000bfda cmp r3, 0x20 |
0x0000bfdc bls 0xbfc0 |
| } while (r3 < 0x20);
0x0000bfde mov r0, r2 | r0 = r2;
| label_16:
0x0000bfe0 mov r1, r6 | r1 = r6;
0x0000bfe2 b 0xbeb6 | goto label_6;
| label_11:
0x0000bfe4 movs r2, 0 | r2 = 0;
0x0000bfe6 b 0xbda8 | goto label_7;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xbff0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) sym.apr_decode_base32_binary () | void apr_decode_base32_binary (int16_t arg_28h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000bff0 push.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000bff4 ldr r7, [sp, 0x28] | r7 = *(arg_28h);
0x0000bff6 cmp r1, 0 |
| if (r1 == 0) {
0x0000bff8 beq.w 0xc26a | goto label_8;
| }
0x0000bffc mov r8, r3 | r8 = r3;
0x0000bffe adds r3, r2, 1 | r3 = r2 + 1;
0x0000c000 mov r6, r0 | r6 = r0;
0x0000c002 mov r5, r1 | r5 = r1;
| if (r3 == r2) {
0x0000c004 beq.w 0xc1ae | goto label_9;
| }
0x0000c008 cmp r6, 0 |
| if (r6 == 0) {
0x0000c00a beq.w 0xc192 | goto label_1;
| }
| label_0:
0x0000c00e tst.w r8, 8 |
0x0000c012 mov r0, r2 | r0 = r2;
| if ((r8 & 8) != 0) {
0x0000c014 bne.w 0xc246 | goto label_10;
| }
0x0000c018 ldr.w ip, [pc, 0x270] |
0x0000c01c add ip, pc |
0x0000c01e add.w ip, ip, 0x2d0 | ip = 0x1857c;
| label_4:
0x0000c022 mov r1, r5 | r1 = r5;
0x0000c024 ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000c028 ldrb.w lr, [ip, r3] |
0x0000c02c cmp.w lr, 0x1f |
| if (lr > 0x1f) {
0x0000c030 bhi.w 0xc286 | goto label_11;
| }
| if (r2 != 0) {
0x0000c034 cbnz r2, 0xc03e | goto label_12;
| }
0x0000c036 b 0xc276 | goto label_13;
| do {
0x0000c038 cmp r0, 0 |
| if (r0 == 0) {
0x0000c03a beq.w 0xc252 | goto label_14;
| }
| label_12:
0x0000c03e ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000c042 subs r0, 1 | r0--;
0x0000c044 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c048 cmp r3, 0x1f |
0x0000c04a bls 0xc038 |
| } while (r3 < 0x1f);
0x0000c04c subs r2, r1, r5 | r2 = r1 - r5;
0x0000c04e subs r2, 1 | r2--;
| label_7:
0x0000c050 ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000c054 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c058 cmp r3, 0x20 |
| if (r3 < 0x20) {
0x0000c05a bls 0xc06c | goto label_15;
| }
| do {
| if (r0 == 0) {
0x0000c05c cbz r0, 0xc08c | goto label_5;
| }
0x0000c05e ldrb r3, [r1], 1 | r3 = *(r1);
| r1++;
0x0000c062 subs r0, 1 | r0--;
0x0000c064 ldrb.w r4, [ip, r3] | r4 = *((ip + r3));
0x0000c068 cmp r4, 0x20 |
0x0000c06a bhi 0xc05c |
| } while (r4 > 0x20);
| label_15:
0x0000c06c mvn.w r8, r8 | r8 = ~r8;
0x0000c070 cmp r0, 0 |
0x0000c072 ite eq |
| if (r0 != 0) {
0x0000c074 moveq r8, 0 | r8 = 0;
| }
| if (r0 != 0) {
0x0000c078 and r8, r8, 1 | r8 &= 1;
| }
0x0000c07c movw r0, 0x117c |
0x0000c080 cmp.w r8, 0 |
0x0000c084 movt r0, 1 | r0 = 0x1117c;
0x0000c088 it eq |
| if (r8 != 0) {
0x0000c08a moveq r0, 0 | r0 = 0;
| }
| label_5:
0x0000c08c cmp r2, 8 |
| if (r2 < 8) {
0x0000c08e bls.w 0xc282 | goto label_16;
| }
0x0000c092 sub.w r1, r2, 9 | r1 = r2 - 9;
0x0000c096 adds r4, r6, 5 | r4 = r6 + 5;
0x0000c098 bic sb, r1, 7 | sb = BIT_MASK (r1, 7);
0x0000c09c mov r3, r5 | r3 = r5;
0x0000c09e lsrs r1, r1, 3 | r1 >>= 3;
0x0000c0a0 add.w r8, sb, r5 | r8 = sb + r5;
0x0000c0a4 b 0xc0ae |
| while (r8 != r3) {
0x0000c0a6 ldrb lr, [r3, 8]! |
0x0000c0aa ldrb.w lr, [ip, lr] |
0x0000c0ae ldrb.w sl, [r3, 1] | sl = *((r3 + 1));
0x0000c0b2 lsl.w lr, lr, 3 | lr <<= 3;
0x0000c0b6 adds r4, 5 | r4 += 5;
0x0000c0b8 cmp r8, r3 |
0x0000c0ba ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000c0be orr.w lr, lr, sl, lsr 2 | lr |= (sl >> 2);
0x0000c0c2 strb lr, [r4, -0xa] |
0x0000c0c6 ldrb.w lr, [r3, 2] |
0x0000c0ca ldrb.w fp, [r3, 1] | fp = *((r3 + 1));
0x0000c0ce ldrb.w sl, [r3, 3] | sl = *((r3 + 3));
0x0000c0d2 ldrb.w lr, [ip, lr] |
0x0000c0d6 ldrb.w fp, [ip, fp] | fp = *((ip + fp));
0x0000c0da ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000c0de lsl.w lr, lr, 1 | lr <<= 1;
0x0000c0e2 orr.w lr, lr, fp, lsl 6 | lr |= (fp << 6);
0x0000c0e6 orr.w lr, lr, sl, lsr 4 | lr |= (sl >> 4);
0x0000c0ea strb lr, [r4, -0x9] |
0x0000c0ee ldrb.w lr, [r3, 3] |
0x0000c0f2 ldrb.w sl, [r3, 4] | sl = *((r3 + 4));
0x0000c0f6 ldrb.w lr, [ip, lr] |
0x0000c0fa ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000c0fe lsl.w lr, lr, 4 | lr <<= 4;
0x0000c102 orr.w lr, lr, sl, lsr 1 | lr |= (sl >> 1);
0x0000c106 strb lr, [r4, -0x8] |
0x0000c10a ldrb.w lr, [r3, 5] |
0x0000c10e ldrb.w fp, [r3, 4] | fp = *((r3 + 4));
0x0000c112 ldrb.w sl, [r3, 6] | sl = *((r3 + 6));
0x0000c116 ldrb.w lr, [ip, lr] |
0x0000c11a ldrb.w fp, [ip, fp] | fp = *((ip + fp));
0x0000c11e ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000c122 lsl.w lr, lr, 2 | lr <<= 2;
0x0000c126 orr.w lr, lr, fp, lsl 7 | lr |= (fp << 7);
0x0000c12a orr.w lr, lr, sl, lsr 3 | lr |= (sl >> 3);
0x0000c12e strb lr, [r4, -0x7] |
0x0000c132 ldrb.w sl, [r3, 6] | sl = *((r3 + 6));
0x0000c136 ldrb.w lr, [r3, 7] |
0x0000c13a ldrb.w sl, [ip, sl] | sl = *((ip + sl));
0x0000c13e ldrb.w lr, [ip, lr] |
0x0000c142 orr.w lr, lr, sl, lsl 5 | lr |= (sl << 5);
0x0000c146 strb lr, [r4, -0x6] |
0x0000c14a bne 0xc0a6 |
| }
0x0000c14c adds r1, 1 | r1++;
0x0000c14e subs r2, 8 | r2 -= 8;
0x0000c150 add.w r5, r5, r1, lsl 3 | r5 += (r1 << 3);
0x0000c154 add.w r1, r1, r1, lsl 2 | r1 += (r1 << 2);
0x0000c158 sub.w r2, r2, sb | r2 -= sb;
0x0000c15c add r1, r6 | r1 += r6;
| label_6:
0x0000c15e cmp r2, 1 |
| if (r2 != 1) {
0x0000c160 beq 0xc180 |
| if (r2 < 1) {
0x0000c162 bls 0xc1be | goto label_17;
| }
0x0000c164 ldrb r3, [r5] | r3 = *(r5);
0x0000c166 cmp r2, 3 |
0x0000c168 ldrb r4, [r5, 1] | r4 = *((r5 + 1));
0x0000c16a ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c16e ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000c172 lsl.w r3, r3, 3 | r3 <<= 3;
0x0000c176 orr.w r3, r3, r4, lsr 2 | r3 |= (r4 >> 2);
0x0000c17a strb r3, [r1], 1 | *(r1) = r3;
| r1++;
| if (r2 != 3) {
0x0000c17e bne 0xc1be | goto label_17;
| }
| }
| label_2:
0x0000c180 movw r0, 0x117c |
0x0000c184 movt r0, 1 | r0 = 0x1117c;
| if (r7 != 0) {
| label_3:
0x0000c188 cbz r7, 0xc1aa |
0x0000c18a subs r1, r1, r6 | r1 -= r6;
0x0000c18c str r1, [r7] | *(r7) = r1;
0x0000c18e pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_1:
0x0000c192 mov r0, r7 | r0 = r7;
| if (r7 == 0) {
0x0000c194 cbz r7, 0xc1aa | goto label_18;
| }
0x0000c196 add.w r3, r2, 0xe | r3 = r2 + 0xe;
0x0000c19a adds r2, 7 | r2 += 7;
0x0000c19c it pl |
| if (r2 < 7) {
0x0000c19e movpl r3, r2 | r3 = r2;
| }
0x0000c1a0 mov r0, r6 | r0 = r6;
0x0000c1a2 asrs r3, r3, 3 | r3 >>= 3;
0x0000c1a4 add.w r3, r3, r3, lsl 2 | r3 += (r3 << 2);
0x0000c1a8 str r3, [r7] | *(r7) = r3;
| }
| label_18:
0x0000c1aa pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_9:
0x0000c1ae mov r0, r1 | r0 = r1;
0x0000c1b0 blx 0xa40c | r0 = fcn_0000a40c ();
0x0000c1b4 mov r2, r0 | r2 = r0;
0x0000c1b6 cmp r6, 0 |
| if (r6 != 0) {
0x0000c1b8 bne.w 0xc00e | goto label_0;
| }
0x0000c1bc b 0xc192 | goto label_1;
| label_17:
0x0000c1be cmp r2, 3 |
| if (r2 < 3) {
0x0000c1c0 bls 0xc206 | goto label_19;
| }
0x0000c1c2 ldrb r3, [r5, 2] | r3 = *((r5 + 2));
0x0000c1c4 cmp r2, 4 |
0x0000c1c6 ldrb r4, [r5, 1] | r4 = *((r5 + 1));
0x0000c1c8 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c1cc ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000c1d0 lsl.w r3, r3, 1 | r3 <<= 1;
0x0000c1d4 orr.w r3, r3, r4, lsl 6 | r3 |= (r4 << 6);
0x0000c1d8 ldrb r4, [r5, 3] | r4 = *((r5 + 3));
0x0000c1da ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000c1de orr.w r3, r3, r4, lsr 4 | r3 |= (r4 >> 4);
0x0000c1e2 strb r3, [r1] | *(r1) = r3;
| if (r2 == 4) {
0x0000c1e4 beq 0xc266 | goto label_20;
| }
0x0000c1e6 ldrb r3, [r5, 3] | r3 = *((r5 + 3));
0x0000c1e8 cmp r2, 6 |
0x0000c1ea ldrb r4, [r5, 4] | r4 = *((r5 + 4));
0x0000c1ec add.w r1, r1, 2 | r1 += 2;
0x0000c1f0 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c1f4 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000c1f8 lsl.w r3, r3, 4 | r3 <<= 4;
0x0000c1fc orr.w r3, r3, r4, lsr 1 | r3 |= (r4 >> 1);
0x0000c200 strb r3, [r1, -0x1] | *((r1 - 0x1)) = r3;
| if (r2 == 6) {
0x0000c204 beq 0xc180 | goto label_2;
| }
| label_19:
0x0000c206 cmp r2, 6 |
| if (r2 < 6) {
0x0000c208 bls 0xc188 | goto label_3;
| }
0x0000c20a ldrb r3, [r5, 5] | r3 = *((r5 + 5));
0x0000c20c cmp r2, 8 |
0x0000c20e ldrb r4, [r5, 4] | r4 = *((r5 + 4));
0x0000c210 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c214 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000c218 lsl.w r3, r3, 2 | r3 <<= 2;
0x0000c21c orr.w r3, r3, r4, lsl 7 | r3 |= (r4 << 7);
0x0000c220 ldrb r4, [r5, 6] | r4 = *((r5 + 6));
0x0000c222 ldrb.w r4, [ip, r4] | r4 = *((ip + r4));
0x0000c226 orr.w r3, r3, r4, lsr 3 | r3 |= (r4 >> 3);
0x0000c22a strb r3, [r1] | *(r1) = r3;
| if (r2 != 8) {
0x0000c22c bne 0xc266 | goto label_20;
| }
0x0000c22e ldrb r2, [r5, 6] | r2 = *((r5 + 6));
0x0000c230 adds r1, 2 | r1 += 2;
0x0000c232 ldrb r3, [r5, 7] | r3 = *((r5 + 7));
0x0000c234 ldrb.w r2, [ip, r2] | r2 = *((ip + r2));
0x0000c238 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c23c orr.w r3, r3, r2, lsl 5 | r3 |= (r2 << 5);
0x0000c240 strb r3, [r1, -0x1] | *((r1 - 0x1)) = r3;
0x0000c244 b 0xc188 | goto label_3;
| label_10:
0x0000c246 ldr.w ip, [pc, 0x48] | ip = *(0x0000c290);
0x0000c24a add ip, pc |
0x0000c24c add.w ip, ip, 0x1d0 |
0x0000c250 b 0xc022 | goto label_4;
| label_14:
0x0000c252 ldrb r3, [r1] | r3 = *(r1);
0x0000c254 subs r1, r1, r5 | r1 -= r5;
0x0000c256 subs r2, r1, 1 | r2 = r1 - 1;
0x0000c258 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c25c cmp r3, 0x20 |
| if (r3 > 0x20) {
0x0000c25e bhi.w 0xc08c | goto label_5;
| }
| do {
0x0000c262 movs r0, 0 | r0 = 0;
0x0000c264 b 0xc08c | goto label_5;
| label_20:
0x0000c266 adds r1, 1 | r1++;
0x0000c268 b 0xc188 | goto label_3;
| label_8:
0x0000c26a movw r0, 0x117f |
0x0000c26e movt r0, 1 | r0 = 0x1117f;
0x0000c272 pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_13:
0x0000c276 ldrb r3, [r5, 1] | r3 = *((r5 + 1));
0x0000c278 ldrb.w r3, [ip, r3] | r3 = *((ip + r3));
0x0000c27c cmp r3, 0x20 |
0x0000c27e bls 0xc262 |
| } while (r3 < 0x20);
0x0000c280 mov r0, r2 | r0 = r2;
| label_16:
0x0000c282 mov r1, r6 | r1 = r6;
0x0000c284 b 0xc15e | goto label_6;
| label_11:
0x0000c286 movs r2, 0 | r2 = 0;
0x0000c288 b 0xc050 | goto label_7;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xc460 */
| #include <stdint.h>
|
; (fcn) sym.apr_encode_base16_binary () | void apr_encode_base16_binary (int16_t arg_20h, uint32_t arg2, uint32_t arg3, int16_t arg4) {
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000c460 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0000c464 ldr.w sb, [sp, 0x20] | sb = *(arg_20h);
0x0000c468 cmp r1, 0 |
| if (r1 == 0) {
0x0000c46a beq 0xc528 | goto label_2;
| }
| if (r0 == 0) {
0x0000c46c cbz r0, 0xc4cc | goto label_3;
| }
0x0000c46e lsls r4, r3, 0x1a | r4 = r3 << 0x1a;
| if (r4 < r3) {
0x0000c470 bmi 0xc518 | goto label_4;
| }
0x0000c472 ldr r6, [pc, 0xc0] |
0x0000c474 add r6, pc |
0x0000c476 add.w r6, r6, 0x3e4 | r6 = 0x18d92;
| label_1:
0x0000c47a cmp r2, 0 |
| if (r2 == 0) {
0x0000c47c beq 0xc4fc | goto label_5;
| }
0x0000c47e subs r2, 1 | r2--;
0x0000c480 ubfx r7, r3, 4, 1 | r7 = (r3 >> 4) & ((1 << 1) - 1);
0x0000c484 adds r5, r1, r2 | r5 = r1 + r2;
0x0000c486 mov r3, r0 | r3 = r0;
0x0000c488 subs r2, r1, 1 | r2 = r1 - 1;
0x0000c48a mov.w sl, 0x3a | sl = 0x3a;
| do {
| label_0:
0x0000c48e ldrb.w lr, [r2, 1] |
0x0000c492 mov ip, r3 |
0x0000c494 adds r4, r2, 1 | r4 = r2 + 1;
0x0000c496 add.w r8, r2, 2 | r8 = r2 + 2;
0x0000c49a cmp r5, r4 |
0x0000c49c lsr.w lr, lr, 4 | lr >>= 4;
0x0000c4a0 ldrb.w lr, [r6, lr] |
0x0000c4a4 strb lr, [ip], 2 |
0x0000c4a8 ldrb.w lr, [r2, 1] |
0x0000c4ac mov r2, r4 | r2 = r4;
0x0000c4ae and lr, lr, 0xf | lr &= 0xf;
0x0000c4b2 ldrb.w lr, [r6, lr] |
0x0000c4b6 strb.w lr, [r3, 1] |
| if (r5 == r4) {
0x0000c4ba beq 0xc4fe | goto label_6;
| }
0x0000c4bc cmp r1, r8 |
0x0000c4be ite eq |
| if (r1 != r8) {
0x0000c4c0 moveq r4, 0 | r4 = 0;
| }
| if (r1 == r8) {
0x0000c4c2 andne r4, r7, 1 | r4 = r7 & 1;
| }
| if (r4 != 0) {
0x0000c4c6 cbnz r4, 0xc4f0 | goto label_7;
| }
0x0000c4c8 mov r3, ip | r3 = ip;
0x0000c4ca b 0xc48e |
| } while (1);
| label_3:
0x0000c4cc cmp.w sb, 0 |
| if (sb != 0) {
0x0000c4d0 beq 0xc522 |
0x0000c4d2 subs r1, r2, 0 | r1 = r2 - 0;
0x0000c4d4 it ne |
| if (r1 == r2) {
0x0000c4d6 movne r1, 1 | r1 = 1;
| }
0x0000c4d8 ands.w r1, r1, r3, lsr 4 | r1 &= (r3 >> 4);
0x0000c4dc itett eq |
| if (r1 != r1) {
0x0000c4de lsleq r2, r2, 1 | r2 <<= 1;
| }
| if (r1 == r1) {
0x0000c4e0 addne r2, r2, r2, lsl 1 | r2 += (r2 << 1);
| }
| if (r1 != r1) {
0x0000c4e4 addeq r2, 1 | r2++;
| }
| if (r1 == r1) {
0x0000c4e6 mov r0, r1 | r0 = r1;
| }
0x0000c4e8 str.w r2, [sb] | __asm ("str.w r2, [sb]");
0x0000c4ec pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_7:
0x0000c4f0 add.w ip, r3, 3 |
0x0000c4f4 strb.w sl, [r3, 2] | *((r3 + 2)) = sl;
0x0000c4f8 mov r3, ip | r3 = ip;
0x0000c4fa b 0xc48e | goto label_0;
| label_5:
0x0000c4fc mov ip, r0 |
| label_6:
0x0000c4fe cmp.w sb, 0 |
| if (sb != 0) {
0x0000c502 beq 0xc50c |
0x0000c504 sub.w r0, ip, r0 | r0 = ip - r0;
0x0000c508 str.w r0, [sb] | __asm ("str.w r0, [sb]");
| }
0x0000c50c movs r3, 0 | r3 = 0;
0x0000c50e mov r0, r3 | r0 = r3;
0x0000c510 strb.w r3, [ip] | *(ip) = r3;
0x0000c514 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_4:
0x0000c518 ldr r6, [pc, 0x1c] |
0x0000c51a add r6, pc |
0x0000c51c add.w r6, r6, 0x3d0 | r6 = 0x18e26;
0x0000c520 b 0xc47a | goto label_1;
| }
0x0000c522 mov r0, sb | r0 = sb;
0x0000c524 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_2:
0x0000c528 movw r0, 0x117f |
0x0000c52c movt r0, 1 | r0 = 0x1117f;
0x0000c530 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xb714 */
| #include <stdint.h>
|
; (fcn) sym.apr_encode_base32 () | void apr_encode_base32 (int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000b714 push.w {r3, r4, r5, r6, r7, r8, sb, lr} |
0x0000b718 ldr.w sb, [sp, 0x20] | sb = var_0h;
0x0000b71c cmp r1, 0 |
| if (r1 == 0) {
0x0000b71e beq.w 0xb922 | goto label_5;
| }
0x0000b722 mov r8, r3 | r8 = r3;
0x0000b724 adds r3, r2, 1 | r3 = r2 + 1;
0x0000b726 mov r6, r0 | r6 = r0;
0x0000b728 mov r7, r1 | r7 = r1;
| if (r3 == r2) {
0x0000b72a beq.w 0xb8dc | goto label_6;
| }
0x0000b72e cmp r6, 0 |
| if (r6 == 0) {
0x0000b730 beq.w 0xb8b4 | goto label_1;
| }
| label_0:
0x0000b734 tst.w r8, 8 |
| if ((r8 & 8) == 0) {
0x0000b738 beq.w 0xb8ec | goto label_7;
| }
0x0000b73c ldr r4, [pc, 0x27c] |
0x0000b73e add r4, pc |
0x0000b740 add.w r4, r4, 0x1ac | r4 = 0x172aa;
| label_2:
0x0000b744 subs r1, r2, 4 | r1 = r2 - 4;
0x0000b746 cmp r1, 0 |
| if (r1 <= 0) {
0x0000b748 ble.w 0xb964 | goto label_8;
| }
0x0000b74c add.w lr, r6, 8 | lr = r6 + 8;
0x0000b750 mov ip, r7 |
0x0000b752 movs r3, 0 | r3 = 0;
| do {
0x0000b754 ldrb.w r0, [ip] | r0 = *(ip);
0x0000b758 adds r3, 5 | r3 += 5;
0x0000b75a cmp r3, r1 |
0x0000b75c add.w ip, ip, 5 |
0x0000b760 lsr.w r0, r0, 3 | r0 >>= 3;
0x0000b764 ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b766 strb r0, [lr, -0x8] | *((lr - 0x8)) = r0;
0x0000b76a ldrb r0, [ip, -0x5] | r0 = *((ip - 0x5));
0x0000b76e ldrb r5, [ip, -0x4] | r5 = *((ip - 0x4));
0x0000b772 lsl.w r0, r0, 2 | r0 <<= 2;
0x0000b776 and r0, r0, 0x1c | r0 &= 0x1c;
0x0000b77a orr.w r0, r0, r5, lsr 6 | r0 |= (r5 >> 6);
0x0000b77e ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b780 strb r0, [lr, -0x7] | *((lr - 0x7)) = r0;
0x0000b784 ldrb r0, [ip, -0x4] | r0 = *((ip - 0x4));
0x0000b788 ubfx r0, r0, 1, 5 | r0 = (r0 >> 1) & ((1 << 5) - 1);
0x0000b78c ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b78e strb r0, [lr, -0x6] | *((lr - 0x6)) = r0;
0x0000b792 ldrb r0, [ip, -0x4] | r0 = *((ip - 0x4));
0x0000b796 ldrb r5, [ip, -0x3] | r5 = *((ip - 0x3));
0x0000b79a lsl.w r0, r0, 4 | r0 <<= 4;
0x0000b79e and r0, r0, 0x10 | r0 &= 0x10;
0x0000b7a2 orr.w r0, r0, r5, lsr 4 | r0 |= (r5 >> 4);
0x0000b7a6 ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b7a8 strb r0, [lr, -0x5] | *((lr - 0x5)) = r0;
0x0000b7ac ldrb r0, [ip, -0x3] | r0 = *((ip - 0x3));
0x0000b7b0 ldrb r5, [ip, -0x2] | r5 = *((ip - 0x2));
0x0000b7b4 lsl.w r0, r0, 1 | r0 <<= 1;
0x0000b7b8 and r0, r0, 0x1e | r0 &= 0x1e;
0x0000b7bc orr.w r0, r0, r5, lsr 7 | r0 |= (r5 >> 7);
0x0000b7c0 ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b7c2 strb r0, [lr, -0x4] | *((lr - 0x4)) = r0;
0x0000b7c6 ldrb r0, [ip, -0x2] | r0 = *((ip - 0x2));
0x0000b7ca ubfx r0, r0, 2, 5 | r0 = (r0 >> 2) & ((1 << 5) - 1);
0x0000b7ce ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b7d0 strb r0, [lr, -0x3] | *((lr - 0x3)) = r0;
0x0000b7d4 ldrb r5, [ip, -0x2] | r5 = *((ip - 0x2));
0x0000b7d8 ldrb r0, [ip, -0x1] | r0 = *((ip - 0x1));
0x0000b7dc lsl.w r5, r5, 3 | r5 <<= 3;
0x0000b7e0 and r5, r5, 0x18 | r5 &= 0x18;
0x0000b7e4 orr.w r5, r5, r0, lsr 5 | r5 |= (r0 >> 5);
0x0000b7e8 ldrb r0, [r4, r5] | r0 = *((r4 + r5));
0x0000b7ea mov r5, lr | r5 = lr;
0x0000b7ec add.w lr, lr, 8 | lr += 8;
0x0000b7f0 strb r0, [lr, -0xa] | *((lr - 0xa)) = r0;
0x0000b7f4 ldrb r0, [ip, -0x1] | r0 = *((ip - 0x1));
0x0000b7f8 and r0, r0, 0x1f | r0 &= 0x1f;
0x0000b7fc ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0000b7fe strb r0, [lr, -0x9] | *((lr - 0x9)) = r0;
0x0000b802 blt 0xb754 |
| } while (r3 < r1);
| label_4:
0x0000b804 cmp r2, r3 |
| if (r2 > r3) {
0x0000b806 ble 0xb89e |
0x0000b808 ldrb r1, [r7, r3] | r1 = *((r7 + r3));
0x0000b80a and r0, r8, 2 | r0 = r8 & 2;
0x0000b80e lsrs r1, r1, 3 | r1 >>= 3;
0x0000b810 ldrb r1, [r4, r1] | r1 = *((r4 + r1));
0x0000b812 strb r1, [r5] | *(r5) = r1;
0x0000b814 subs r1, r2, 1 | r1 = r2 - 1;
0x0000b816 cmp r1, r3 |
| if (r1 == r3) {
0x0000b818 beq 0xb8f6 | goto label_9;
| }
0x0000b81a ldrb r1, [r7, r3] | r1 = *((r7 + r3));
0x0000b81c add.w ip, r3, 1 |
0x0000b820 ldrb.w lr, [r7, ip] |
0x0000b824 lsls r1, r1, 2 | r1 <<= 2;
0x0000b826 and r1, r1, 0x1c | r1 &= 0x1c;
0x0000b82a orr.w r1, r1, lr, lsr 6 | r1 |= (lr >> 6);
0x0000b82e ldrb.w lr, [r4, r1] |
0x0000b832 subs r1, r2, 2 | r1 = r2 - 2;
0x0000b834 cmp r1, r3 |
| if (r1 == r3) {
0x0000b836 beq 0xb92e | goto label_10;
| }
0x0000b838 subs r2, 3 | r2 -= 3;
0x0000b83a adds r1, r3, 2 | r1 = r3 + 2;
0x0000b83c cmp r2, r3 |
0x0000b83e strb.w lr, [r5, 1] |
| if (r2 == r3) {
0x0000b842 beq.w 0xb976 | goto label_11;
| }
0x0000b846 ldrb.w r2, [r7, ip] | r2 = *((r7 + ip));
0x0000b84a adds r3, 3 | r3 += 3;
0x0000b84c ubfx r2, r2, 1, 5 | r2 = (r2 >> 1) & ((1 << 5) - 1);
0x0000b850 ldrb r2, [r4, r2] | r2 = *((r4 + r2));
0x0000b852 strb r2, [r5, 2] | *((r5 + 2)) = r2;
0x0000b854 ldrb.w r2, [r7, ip] | r2 = *((r7 + ip));
0x0000b858 ldrb.w ip, [r7, r1] | ip = *((r7 + r1));
0x0000b85c lsls r2, r2, 4 | r2 <<= 4;
0x0000b85e and r2, r2, 0x10 | r2 &= 0x10;
0x0000b862 orr.w r2, r2, ip, lsr 4 | r2 |= (ip >> 4);
0x0000b866 ldrb r2, [r4, r2] | r2 = *((r4 + r2));
0x0000b868 strb r2, [r5, 3] | *((r5 + 3)) = r2;
0x0000b86a ldrb r2, [r7, r1] | r2 = *((r7 + r1));
0x0000b86c ldrb r1, [r7, r3] | r1 = *((r7 + r3));
0x0000b86e lsls r2, r2, 1 | r2 <<= 1;
0x0000b870 and r2, r2, 0x1e | r2 &= 0x1e;
0x0000b874 orr.w r2, r2, r1, lsr 7 | r2 |= (r1 >> 7);
0x0000b878 ldrb r2, [r4, r2] | r2 = *((r4 + r2));
0x0000b87a strb r2, [r5, 4] | *((r5 + 4)) = r2;
0x0000b87c ldrb r2, [r7, r3] | r2 = *((r7 + r3));
0x0000b87e ubfx r2, r2, 2, 5 | r2 = (r2 >> 2) & ((1 << 5) - 1);
0x0000b882 ldrb r2, [r4, r2] | r2 = *((r4 + r2));
0x0000b884 strb r2, [r5, 5] | *((r5 + 5)) = r2;
0x0000b886 ldrb r3, [r7, r3] | r3 = *((r7 + r3));
0x0000b888 lsls r3, r3, 3 | r3 <<= 3;
0x0000b88a and r3, r3, 0x18 | r3 &= 0x18;
0x0000b88e ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b890 strb r3, [r5, 6] | *((r5 + 6)) = r3;
0x0000b892 cmp r0, 0 |
| if (r0 != 0) {
0x0000b894 bne 0xb96e | goto label_12;
| }
0x0000b896 movs r3, 0x3d | r3 = 0x3d;
0x0000b898 adds r5, 8 | r5 += 8;
0x0000b89a strb r3, [r5, -0x1] | *((r5 - 0x1)) = r3;
| }
| label_3:
0x0000b89e cmp.w sb, 0 |
| if (sb != 0) {
0x0000b8a2 beq 0xb8aa |
0x0000b8a4 subs r6, r5, r6 | r6 = r5 - r6;
0x0000b8a6 str.w r6, [sb] | __asm ("str.w r6, [sb]");
| }
0x0000b8aa movs r3, 0 | r3 = 0;
0x0000b8ac mov r0, r3 | r0 = r3;
0x0000b8ae strb r3, [r5] | *(r5) = r3;
0x0000b8b0 pop.w {r3, r4, r5, r6, r7, r8, sb, pc} |
| label_1:
0x0000b8b4 mov r0, sb | r0 = sb;
0x0000b8b6 cmp.w sb, 0 |
| if (sb != 0) {
0x0000b8ba beq 0xb8d8 |
0x0000b8bc movw r3, 0x5556 |
0x0000b8c0 adds r2, 2 | r2 += 2;
| /* if there is a right shift of 0, then it's a division by 1/3 */
0x0000b8c2 movt r3, 0x5555 | r3 = 0x55555556;
0x0000b8c6 mov r0, r6 | r0 = r6;
0x0000b8c8 smull r1, r3, r3, r2 | r1:r3 = r3 * r2;
0x0000b8cc sub.w r3, r3, r2, asr 31 | r3 -= (r2 >> 31);
0x0000b8d0 lsls r3, r3, 2 | r3 <<= 2;
0x0000b8d2 adds r3, 1 | r3++;
0x0000b8d4 str.w r3, [sb] | __asm ("str.w r3, [sb]");
| }
0x0000b8d8 pop.w {r3, r4, r5, r6, r7, r8, sb, pc} |
| label_6:
0x0000b8dc mov r0, r1 | r0 = r1;
0x0000b8de blx 0xa40c | r0 = fcn_0000a40c ();
0x0000b8e2 mov r2, r0 | r2 = r0;
0x0000b8e4 cmp r6, 0 |
| if (r6 != 0) {
0x0000b8e6 bne.w 0xb734 | goto label_0;
| }
0x0000b8ea b 0xb8b4 | goto label_1;
| label_7:
0x0000b8ec ldr r4, [pc, 0xd0] |
0x0000b8ee add r4, pc |
0x0000b8f0 add.w r4, r4, 0x188 | r4 = 0x1743a;
0x0000b8f4 b 0xb744 | goto label_2;
| label_9:
0x0000b8f6 ldrb r3, [r7, r3] | r3 = *((r7 + r3));
0x0000b8f8 lsls r3, r3, 2 | r3 <<= 2;
0x0000b8fa and r3, r3, 0x1c | r3 &= 0x1c;
0x0000b8fe ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b900 strb r3, [r5, 1] | *((r5 + 1)) = r3;
| if (r0 == 0) {
0x0000b902 cbnz r0, 0xb96a |
0x0000b904 movs r3, 0x3d | r3 = 0x3d;
0x0000b906 adds r5, 8 | r5 += 8;
0x0000b908 strb r3, [r5, -0x6] | *((r5 - 0x6)) = r3;
0x0000b90c strb r3, [r5, -0x5] | *((r5 - 0x5)) = r3;
0x0000b910 strb r3, [r5, -0x4] | *((r5 - 0x4)) = r3;
0x0000b914 strb r3, [r5, -0x3] | *((r5 - 0x3)) = r3;
0x0000b918 strb r3, [r5, -0x2] | *((r5 - 0x2)) = r3;
0x0000b91c strb r3, [r5, -0x1] | *((r5 - 0x1)) = r3;
0x0000b920 b 0xb89e | goto label_3;
| label_5:
0x0000b922 movw r0, 0x117f |
0x0000b926 movt r0, 1 | r0 = 0x1117f;
0x0000b92a pop.w {r3, r4, r5, r6, r7, r8, sb, pc} |
| label_10:
0x0000b92e strb.w lr, [r5, 1] |
0x0000b932 ldrb.w r3, [r7, ip] | r3 = *((r7 + ip));
0x0000b936 ubfx r3, r3, 1, 5 | r3 = (r3 >> 1) & ((1 << 5) - 1);
0x0000b93a ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b93c strb r3, [r5, 2] | *((r5 + 2)) = r3;
0x0000b93e ldrb.w r3, [r7, ip] | r3 = *((r7 + ip));
0x0000b942 lsls r3, r3, 4 | r3 <<= 4;
0x0000b944 and r3, r3, 0x10 | r3 &= 0x10;
0x0000b948 ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b94a strb r3, [r5, 3] | *((r5 + 3)) = r3;
| if (r0 != 0) {
0x0000b94c cbnz r0, 0xb972 | goto label_13;
| }
0x0000b94e movs r3, 0x3d | r3 = 0x3d;
0x0000b950 adds r5, 8 | r5 += 8;
0x0000b952 strb r3, [r5, -0x4] | *((r5 - 0x4)) = r3;
0x0000b956 strb r3, [r5, -0x3] | *((r5 - 0x3)) = r3;
0x0000b95a strb r3, [r5, -0x2] | *((r5 - 0x2)) = r3;
0x0000b95e strb r3, [r5, -0x1] | *((r5 - 0x1)) = r3;
0x0000b962 b 0xb89e | goto label_3;
| label_8:
0x0000b964 mov r5, r6 | r5 = r6;
0x0000b966 movs r3, 0 | r3 = 0;
0x0000b968 b 0xb804 | goto label_4;
| }
0x0000b96a adds r5, 2 | r5 += 2;
0x0000b96c b 0xb89e | goto label_3;
| label_12:
0x0000b96e adds r5, 7 | r5 += 7;
0x0000b970 b 0xb89e | goto label_3;
| label_13:
0x0000b972 adds r5, 4 | r5 += 4;
0x0000b974 b 0xb89e | goto label_3;
| label_11:
0x0000b976 ldrb.w r3, [r7, ip] | r3 = *((r7 + ip));
0x0000b97a ubfx r3, r3, 1, 5 | r3 = (r3 >> 1) & ((1 << 5) - 1);
0x0000b97e ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b980 strb r3, [r5, 2] | *((r5 + 2)) = r3;
0x0000b982 ldrb.w r3, [r7, ip] | r3 = *((r7 + ip));
0x0000b986 ldrb r2, [r7, r1] | r2 = *((r7 + r1));
0x0000b988 lsls r3, r3, 4 | r3 <<= 4;
0x0000b98a and r3, r3, 0x10 | r3 &= 0x10;
0x0000b98e orr.w r3, r3, r2, lsr 4 | r3 |= (r2 >> 4);
0x0000b992 ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b994 strb r3, [r5, 3] | *((r5 + 3)) = r3;
0x0000b996 ldrb r3, [r7, r1] | r3 = *((r7 + r1));
0x0000b998 lsls r3, r3, 1 | r3 <<= 1;
0x0000b99a and r3, r3, 0x1e | r3 &= 0x1e;
0x0000b99e ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x0000b9a0 strb r3, [r5, 4] | *((r5 + 4)) = r3;
| if (r0 != 0) {
0x0000b9a2 cbz r0, 0xb9a8 |
0x0000b9a4 adds r5, 5 | r5 += 5;
0x0000b9a6 b 0xb89e | goto label_3;
| }
0x0000b9a8 movs r3, 0x3d | r3 = 0x3d;
0x0000b9aa adds r5, 8 | r5 += 8;
0x0000b9ac strb r3, [r5, -0x3] | *((r5 - 0x3)) = r3;
0x0000b9b0 strb r3, [r5, -0x2] | *((r5 - 0x2)) = r3;
0x0000b9b4 strb r3, [r5, -0x1] | *((r5 - 0x1)) = r3;
0x0000b9b8 b 0xb89e | goto label_3;
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xb9c4).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x15a60 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_flush_locked () | uint32_t apr_file_flush_locked (int16_t arg1) {
| r0 = arg1;
0x00015a60 ldr r3, [r0, 0x3c] | r3 = *((r0 + 0x3c));
0x00015a62 cmp r3, 1 |
| if (r3 != 1) {
0x00015a64 beq 0x15a6a |
0x00015a66 movs r0, 0 | r0 = 0;
0x00015a68 bx lr | return r0;
| }
0x00015a6a push {r4, r5, r6, lr} |
0x00015a6c mov r4, r0 | r4 = r0;
0x00015a6e ldr r6, [r0, 0x30] | r6 = *((r0 + 0x30));
0x00015a70 mov r0, r6 | r0 = r6;
| if (r6 == 0) {
0x00015a72 cbz r6, 0x15aa0 | goto label_2;
| }
0x00015a74 movs r5, 0 | r5 = 0;
| do {
| label_0:
0x00015a76 ldr r1, [r4, 0x2c] | r1 = *((r4 + 0x2c));
0x00015a78 subs r2, r6, r5 | r2 = r6 - r5;
0x00015a7a ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00015a7c add r1, r5 | r1 += r5;
0x00015a7e blx 0xa664 | r0 = fcn_0000a664 ();
0x00015a82 cmp r0, 0 |
0x00015a84 ldr r6, [r4, 0x30] | r6 = *((r4 + 0x30));
| if (r0 <= 0) {
0x00015a86 ble 0x15aa2 | goto label_3;
| }
0x00015a88 add r5, r0 | r5 += r0;
0x00015a8a cmp r6, r5 |
0x00015a8c bhi 0x15a76 |
| } while (r6 > r5);
| label_1:
0x00015a8e ldrd r3, r2, [r4, 0x40] | __asm ("ldrd r3, r2, [r4, 0x40]");
0x00015a92 movs r0, 0 | r0 = 0;
0x00015a94 str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
0x00015a96 adds r3, r3, r5 | r3 += r5;
0x00015a98 adc.w r2, r2, r5, asr 31 | __asm ("adc.w r2, r2, r5, asr 31");
0x00015a9c strd r3, r2, [r4, 0x40] | __asm ("strd r3, r2, [r4, 0x40]");
| label_2:
0x00015aa0 pop {r4, r5, r6, pc} |
| label_3:
0x00015aa2 cmp r5, r6 |
0x00015aa4 ite hs |
| if (r5 < r6) {
0x00015aa6 movhs r3, 0 | r3 = 0;
| }
| if (r5 >= r6) {
0x00015aa8 movlo r3, 1 | r3 = 1;
| }
0x00015aaa adds r2, r0, 1 | r2 = r0 + 1;
0x00015aac it ne |
| if (r2 == r0) {
0x00015aae movne r3, 0 | r3 = 0;
| }
| if (r3 == 0) {
0x00015ab0 cbz r3, 0x15abe | goto label_4;
| }
0x00015ab2 blx 0xa580 | r0 = fcn_0000a580 ();
0x00015ab6 ldr r0, [r0] | r0 = *(r0);
0x00015ab8 cmp r0, 4 |
| if (r0 == 4) {
0x00015aba beq 0x15a76 | goto label_0;
| }
0x00015abc pop {r4, r5, r6, pc} |
| label_4:
0x00015abe adds r0, 1 | r0++;
| if (r0 != 1) {
0x00015ac0 bne 0x15a8e | goto label_1;
| }
0x00015ac2 blx 0xa580 | r0 = fcn_0000a580 ();
0x00015ac6 ldr r0, [r0] | r0 = *(r0);
0x00015ac8 pop {r4, r5, r6, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x16014 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_gets () | void apr_file_gets (uint32_t arg1, uint32_t arg2, int16_t arg3) {
| int16_t var_0h;
| int16_t var_4h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00016014 svcmi 0xf0e92d | __asm ("svcmi aav.0x000000ff");
0x00016018 cmp r1, 1 |
0x0001601a ldr r4, [pc, 0x134] |
0x0001601c sub sp, 0xc |
0x0001601e ldr r3, [pc, 0x134] | r3 = *(0x16156);
0x00016020 add r4, pc | r4 = 0x2c176;
0x00016022 ldr r3, [r4, r3] |
0x00016024 ldr r3, [r3] | r3 = *(0x2c176);
0x00016026 str r3, [sp, 4] | var_4h = r3;
0x00016028 mov.w r3, 0 | r3 = 0;
| if (r1 <= 1) {
0x0001602c ble 0x16078 | goto label_4;
| }
0x0001602e ldr r3, [r2, 0x20] | r3 = *((r2 + 0x20));
0x00016030 add.w r8, r1, -1 | r8 = r1 + -1;
0x00016034 mov sb, r0 | sb = r0;
0x00016036 mov r6, r2 | r6 = r2;
0x00016038 add.w r7, r0, r8 | r7 = r0 + r8;
| if (r3 != 0) {
0x0001603c cbnz r3, 0x16096 | goto label_7;
| }
0x0001603e cmp r0, r7 |
0x00016040 ittt lo |
| if (r0 >= r7) {
0x00016042 movlo r4, r0 | r4 = r0;
| }
| if (r0 >= r7) {
0x00016044 movlo sl, sp | sl = sp;
| }
| if (r0 >= r7) {
0x00016046 movlo r8, 1 | r8 = 1;
| }
| if (r0 <= r7) {
0x0001604a blo 0x1605a | goto label_8;
| }
0x0001604c b 0x16142 | goto label_9;
| do {
0x0001604e ldrb r3, [r4], 1 | r3 = *(r4);
| r4++;
0x00016052 cmp r3, 0xa |
| if (r3 == 0xa) {
0x00016054 beq 0x1606e | goto label_2;
| }
0x00016056 cmp r4, r7 |
| if (r4 == r7) {
0x00016058 beq 0x16116 | goto label_10;
| }
| label_8:
0x0001605a mov r2, sl | r2 = sl;
0x0001605c mov r1, r4 | r1 = r4;
0x0001605e mov r0, r6 | r0 = r6;
0x00016060 str.w r8, [sp] | __asm ("str.w r8, [sp]");
0x00016064 blx 0xa2a4 | r0 = fcn_0000a2a4 ();
0x00016068 mov r5, r0 | r5 = r0;
0x0001606a cmp r0, 0 |
0x0001606c beq 0x1604e |
| } while (r0 == 0);
| label_2:
0x0001606e cmp r4, sb |
0x00016070 mov.w r3, 0 | r3 = 0;
0x00016074 strb r3, [r4] | *(r4) = r3;
| if (r4 >= sb) {
0x00016076 bls 0x1607a |
| label_4:
0x00016078 movs r5, 0 | r5 = 0;
| }
| label_3:
0x0001607a ldr r2, [pc, 0xdc] |
0x0001607c ldr r3, [pc, 0xd4] | r3 = *(0x16154);
0x0001607e add r2, pc | r2 = 0x2c1dc;
0x00016080 ldr r3, [r2, r3] | r3 = *(0x2c1dc);
0x00016082 ldr r2, [r3] | r2 = *(0x2c1dc);
0x00016084 ldr r3, [sp, 4] | r3 = var_4h;
0x00016086 eors r2, r3 | r2 ^= r3;
0x00016088 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001608c bne 0x1614c | goto label_11;
| }
0x0001608e mov r0, r5 | r0 = r5;
0x00016090 add sp, 0xc |
0x00016092 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_7:
0x00016096 ldr r0, [r2, 0x48] | r0 = *((r2 + 0x48));
| if (r0 != 0) {
0x00016098 cbz r0, 0x1609e |
0x0001609a blx 0xa268 | fcn_0000a268 ();
| }
0x0001609e ldr r3, [r6, 0x3c] | r3 = *((r6 + 0x3c));
0x000160a0 cmp r3, 1 |
| if (r3 == 1) {
0x000160a2 beq 0x1611a | goto label_12;
| }
| label_6:
0x000160a4 cmp sb, r7 |
| if (sb >= r7) {
0x000160a6 bhs 0x16138 | goto label_13;
| }
0x000160a8 mov r4, sb | r4 = sb;
0x000160aa mov.w sl, 1 | sl = 1;
0x000160ae mov fp, sp |
0x000160b0 b 0x160d0 |
| while (r2 >= r3) {
| label_0:
0x000160b2 mov r2, fp | r2 = fp;
0x000160b4 mov r1, r4 | r1 = r4;
0x000160b6 mov r0, r6 | r0 = r6;
0x000160b8 str.w sl, [sp] | __asm ("str.w sl, [sp]");
0x000160bc bl 0x15acc | r0 = fcn_00015acc (r0, r1, r2);
0x000160c0 mov r5, r0 | r5 = r0;
| if (r0 != 0) {
0x000160c2 cbnz r0, 0x160f2 | goto label_14;
| }
0x000160c4 ldrb r3, [r4] | r3 = *(r4);
0x000160c6 adds r4, 1 | r4++;
0x000160c8 cmp r3, 0xa |
| if (r3 == 0xa) {
0x000160ca beq 0x160f0 | goto label_15;
| }
| label_1:
0x000160cc cmp r7, r4 |
| if (r7 == r4) {
0x000160ce beq 0x16108 | goto label_16;
| }
0x000160d0 ldr r2, [r6, 0x30] | r2 = *((r6 + 0x30));
0x000160d2 ldr r3, [r6, 0x38] | r3 = *((r6 + 0x38));
0x000160d4 cmp r2, r3 |
0x000160d6 bhs 0x160b2 |
| }
0x000160d8 ldr r3, [r6, 0x28] | r3 = *((r6 + 0x28));
0x000160da adds r3, 1 | r3++;
| if (r3 != 1) {
0x000160dc bne 0x160b2 | goto label_0;
| }
0x000160de ldr r3, [r6, 0x2c] | r3 = *((r6 + 0x2c));
0x000160e0 adds r1, r2, 1 | r1 = r2 + 1;
0x000160e2 str r1, [r6, 0x30] | *((r6 + 0x30)) = r1;
0x000160e4 adds r4, 1 | r4++;
0x000160e6 ldrb r3, [r3, r2] | r3 = *((r3 + r2));
0x000160e8 cmp r3, 0xa |
0x000160ea strb r3, [r4, -0x1] | *((r4 - 0x1)) = r3;
| if (r3 != 0xa) {
0x000160ee bne 0x160cc | goto label_1;
| }
| label_15:
0x000160f0 movs r5, 0 | r5 = 0;
| label_14:
0x000160f2 ldr r0, [r6, 0x48] | r0 = *((r6 + 0x48));
0x000160f4 cmp r0, 0 |
| if (r0 == 0) {
0x000160f6 beq 0x1606e | goto label_2;
| }
| label_5:
0x000160f8 blx 0xacfc | fcn_0000acfc ();
0x000160fc cmp r4, sb |
0x000160fe mov.w r3, 0 | r3 = 0;
0x00016102 strb r3, [r4] | *(r4) = r3;
| if (r4 < sb) {
0x00016104 bls 0x1607a | goto label_3;
| }
0x00016106 b 0x16078 | goto label_4;
| label_16:
0x00016108 ldr r0, [r6, 0x48] | r0 = *((r6 + 0x48));
0x0001610a movs r5, 0 | r5 = 0;
0x0001610c cmp r0, 0 |
| if (r0 != 0) {
0x0001610e bne 0x160f8 | goto label_5;
| }
0x00016110 strb.w r0, [sb, r8] | *((sb + r8)) = r0;
0x00016114 b 0x16078 | goto label_4;
| label_10:
0x00016116 strb r0, [r4] | *(r4) = r0;
0x00016118 b 0x16078 | goto label_4;
| label_12:
0x0001611a mov r0, r6 | r0 = r6;
0x0001611c blx 0xab3c | r0 = close (r0);
0x00016120 mov r5, r0 | r5 = r0;
| if (r0 == 0) {
0x00016122 cbnz r0, 0x1612c |
0x00016124 str r0, [r6, 0x3c] | *((r6 + 0x3c)) = r0;
0x00016126 str r0, [r6, 0x30] | *((r6 + 0x30)) = r0;
0x00016128 str r0, [r6, 0x38] | *((r6 + 0x38)) = r0;
0x0001612a b 0x160a4 | goto label_6;
| }
0x0001612c ldr r0, [r6, 0x48] | r0 = *((r6 + 0x48));
0x0001612e cmp r0, 0 |
| if (r0 == 0) {
0x00016130 beq 0x1607a | goto label_3;
| }
0x00016132 blx 0xacfc | fcn_0000acfc ();
0x00016136 b 0x1607a | goto label_3;
| label_13:
0x00016138 ldr r0, [r6, 0x48] | r0 = *((r6 + 0x48));
0x0001613a mov r4, sb | r4 = sb;
0x0001613c movs r5, 0 | r5 = 0;
0x0001613e cmp r0, 0 |
| if (r0 != 0) {
0x00016140 bne 0x160f8 | goto label_5;
| }
| label_9:
0x00016142 movs r3, 0 | r3 = 0;
0x00016144 mov r5, r3 | r5 = r3;
0x00016146 strb.w r3, [sb] | *(sb) = r3;
0x0001614a b 0x1607a | goto label_3;
| label_11:
0x0001614c blx 0x9e90 | fcn_00009e90 ();
| if (r4 != 0) {
0x00016150 cbnz r4, 0x16164 | void (*0x16164)() ();
| }
0x00016152 movs r1, r0 | r1 = r0;
0x00016154 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x00016156 movs r0, r0 |
0x00016158 invalid |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x15108 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_mktemp () | void apr_file_mktemp (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h_4;
| int16_t var_4h_5;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00015108 push.w {r4, r5, r6, r7, r8, lr} |
0x0001510c mov r5, r1 | r5 = r1;
0x0001510e ldr r1, [pc, 0xcc] |
0x00015110 mov r7, r3 | r7 = r3;
0x00015112 sub sp, 8 |
0x00015114 mov r6, r0 | r6 = r0;
0x00015116 ldr r3, [pc, 0xc8] | r3 = *(0x151e2);
0x00015118 add r1, pc | r1 = 0x2a2fa;
0x0001511a ldr.w r8, [pc, 0xc8] |
0x0001511e ldr r3, [r1, r3] |
0x00015120 add r8, pc | r8 = 0x2a30a;
0x00015122 ldr r3, [r3] | r3 = *(0x2a2fa);
0x00015124 str r3, [sp, 4] | var_4h_5 = r3;
0x00015126 mov.w r3, 0 | r3 = 0;
| if (r2 == 0) {
0x0001512a cbz r2, 0x15174 | goto label_2;
| }
0x0001512c mov r0, r5 | r0 = r5;
0x0001512e mov r4, r2 | r4 = r2;
0x00015130 blx 0xa25c | fcn_0000a25c ();
0x00015134 str r0, [sp] | *(sp) = r0;
0x00015136 adds r0, 1 | r0++;
| if (r0 == 1) {
0x00015138 beq 0x151a8 | goto label_0;
| }
0x0001513a mov r2, r4 | r2 = r4;
0x0001513c mov r3, r7 | r3 = r7;
0x0001513e mov r1, sp | r1 = sp;
0x00015140 mov r0, r6 | r0 = r6;
0x00015142 blx 0x9d1c | fcn_00009d1c ();
0x00015146 mov r1, r5 | r1 = r5;
0x00015148 mov r0, r7 | r0 = r7;
0x0001514a ldr r5, [r6] | r5 = *(r6);
0x0001514c blx 0xa41c | fcn_0000a41c ();
0x00015150 lsls r2, r4, 0x14 | r2 = r4 << 0x14;
0x00015152 str r0, [r5, 8] | *((r5 + 8)) = r0;
0x00015154 it mi |
| if (r2 >= r4) {
0x00015156 movmi r0, 0 | r0 = 0;
| }
0x00015158 bpl 0x1519a |
| while (1) {
| label_1:
0x0001515a ldr r2, [pc, 0x8c] |
0x0001515c ldr r3, [pc, 0x80] | r3 = *(0x151e0);
0x0001515e add r2, pc | r2 = 0x2a34c;
0x00015160 ldr r3, [r2, r3] | r3 = *(0x2a34c);
0x00015162 ldr r2, [r3] | r2 = *(0x2a34c);
0x00015164 ldr r3, [sp, 4] | r3 = var_4h_5;
0x00015166 eors r2, r3 | r2 ^= r3;
0x00015168 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001516c bne 0x151d8 | goto label_3;
| }
0x0001516e add sp, 8 |
0x00015170 pop.w {r4, r5, r6, r7, r8, pc} |
| label_2:
0x00015174 mov r0, r5 | r0 = r5;
0x00015176 blx 0xa25c | fcn_0000a25c ();
0x0001517a str r0, [sp] | *(sp) = r0;
0x0001517c adds r0, 1 | r0++;
| if (r0 != 1) {
0x0001517e beq 0x151a8 |
0x00015180 mov r3, r7 | r3 = r7;
0x00015182 movw r2, 0x147 | r2 = 0x147;
0x00015186 mov r1, sp | r1 = sp;
0x00015188 mov r0, r6 | r0 = r6;
0x0001518a blx 0x9d1c | fcn_00009d1c ();
0x0001518e ldr r4, [r6] | r4 = *(r6);
0x00015190 mov r1, r5 | r1 = r5;
0x00015192 mov r0, r7 | r0 = r7;
0x00015194 blx 0xa41c | fcn_0000a41c ();
0x00015198 str r0, [r4, 8] | *((r4 + 8)) = r0;
0x0001519a ldr r0, [sp] | r0 = *(sp);
0x0001519c movs r1, 1 | r1 = 1;
0x0001519e blx 0xa5d8 | r0 = pthread_sigmask ();
0x000151a2 adds r3, r0, 1 | r3 = r0 + 1;
0x000151a4 mov r2, r0 | r2 = r0;
| if (r3 != r0) {
0x000151a6 bne 0x151b0 | goto label_4;
| }
| }
| label_0:
0x000151a8 blx 0xa580 | r0 = fcn_0000a580 ();
0x000151ac ldr r0, [r0] | r0 = *(r0);
0x000151ae b 0x1515a |
| }
| label_4:
0x000151b0 ldr r0, [sp] | r0 = *(sp);
0x000151b2 orr r2, r2, 1 | r2 |= 1;
0x000151b6 movs r1, 2 | r1 = 2;
0x000151b8 blx 0xa5d8 | pthread_sigmask ();
0x000151bc adds r0, 1 | r0++;
| if (r0 == 1) {
0x000151be beq 0x151a8 | goto label_0;
| }
0x000151c0 ldr r1, [r6] | r1 = *(r6);
0x000151c2 ldr r3, [pc, 0x28] | r3 = *(0x151ee);
0x000151c4 ldr r2, [pc, 0x28] | r2 = *(0x151f0);
0x000151c6 ldr r0, [r1] | r0 = *(r1);
0x000151c8 ldr.w r3, [r8, r3] | r3 = *((r8 + r3));
0x000151cc ldr.w r2, [r8, r2] | r2 = *((r8 + r2));
0x000151d0 blx 0x9fb0 | fcn_00009fb0 ();
0x000151d4 movs r0, 0 | r0 = 0;
0x000151d6 b 0x1515a | goto label_1;
| label_3:
0x000151d8 blx 0x9e90 | fcn_00009e90 ();
0x000151dc ldm r0!, {r2, r3, r6} | r2 = *(r0!);
| r3 = *((r0! + 4));
| r6 = *((r0! + 8));
0x000151de movs r1, r0 | r1 = r0;
0x000151e0 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x000151e2 movs r0, r0 |
0x000151e4 ldm r0!, {r2, r6} | r2 = *(r0!);
| r6 = *((r0! + 4));
0x000151e6 movs r1, r0 | r1 = r0;
0x000151e8 ldm r0!, {r1, r2} | r1 = *(r0!);
| r2 = *((r0! + 4));
0x000151ea movs r1, r0 | r1 = r0;
0x000151ec lsls r4, r7, 0x19 | r4 = r7 << 0x19;
0x000151ee movs r0, r0 |
0x000151f0 lsls r4, r0, 0x1a | r4 = r0 << 0x1a;
0x000151f2 movs r0, r0 |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x14ed4 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_read_full () | void apr_file_read_full (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_4h_2;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
| if (? >= ?) {
0x00014ed4 ldrbmi lr, [r0, sp, lsr 18]! |
| }
0x00014ed8 mov r5, r2 | r5 = r2;
0x00014eda ldr r2, [pc, 0x6c] |
0x00014edc mov r8, r3 | r8 = r3;
0x00014ede sub sp, 8 |
0x00014ee0 mov r7, r0 | r7 = r0;
0x00014ee2 ldr r3, [pc, 0x68] | r3 = *(0x14f4e);
0x00014ee4 mov sl, r1 | sl = r1;
0x00014ee6 add r2, pc | r2 = 0x29e34;
0x00014ee8 movs r6, 0 | r6 = 0;
0x00014eea mov sb, sp | sb = sp;
0x00014eec ldr r3, [r2, r3] |
0x00014eee ldr r3, [r3] | r3 = *(0x29e34);
0x00014ef0 str r3, [sp, 4] | var_4h_2 = r3;
0x00014ef2 mov.w r3, 0 | r3 = 0;
| do {
0x00014ef6 mov r1, sl | r1 = sl;
0x00014ef8 mov r2, sb | r2 = sb;
0x00014efa mov r0, r7 | r0 = r7;
0x00014efc str r5, [sp] | *(sp) = r5;
0x00014efe blx 0xa2a4 | fcn_0000a2a4 ();
0x00014f02 ldr r4, [sp] | r4 = *(sp);
0x00014f04 subs r5, r5, r4 | r5 -= r4;
0x00014f06 add sl, r4 | sl += r4;
0x00014f08 ite ne |
| if (r5 == r5) {
0x00014f0a movne r3, 1 | r3 = 1;
| }
| if (r5 != r5) {
0x00014f0c moveq r3, 0 | r3 = 0;
| }
0x00014f0e cmp r0, 0 |
0x00014f10 ite ne |
| if (r0 == 0) {
0x00014f12 movne r3, 0 | r3 = 0;
| }
| if (r0 != 0) {
0x00014f14 andeq r3, r3, 1 | r3 &= 1;
| }
0x00014f18 add r6, r4 | r6 += r4;
0x00014f1a cmp r3, 0 |
0x00014f1c bne 0x14ef6 |
| } while (r3 != 0);
0x00014f1e cmp.w r8, 0 |
| if (r8 != 0) {
0x00014f22 beq 0x14f28 |
0x00014f24 str.w r6, [r8] | __asm ("str.w r6, [r8]");
| }
0x00014f28 ldr r2, [pc, 0x24] |
0x00014f2a ldr r3, [pc, 0x20] | r3 = *(0x14f4e);
0x00014f2c add r2, pc | r2 = 0x29e80;
0x00014f2e ldr r3, [r2, r3] | r3 = *(0x29e80);
0x00014f30 ldr r2, [r3] | r2 = *(0x29e80);
0x00014f32 ldr r3, [sp, 4] | r3 = var_4h_2;
0x00014f34 eors r2, r3 | r2 ^= r3;
0x00014f36 mov.w r3, 0 | r3 = 0;
| if (r2 == r3) {
0x00014f3a bne 0x14f42 |
0x00014f3c add sp, 8 |
0x00014f3e pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
0x00014f42 blx 0x9e90 | fcn_00009e90 ();
0x00014f46 nop |
0x00014f48 ldm r2, {r1, r2, r3, r4, r5, r6} | r1 = *(r2);
| r2 = *((r2 + 4));
| r3 = *((r2 + 8));
| r4 = *((r2 + 12));
| r5 = *((r2 + 16));
| r6 = *((r2 + 20));
0x00014f4a movs r1, r0 | r1 = r0;
0x00014f4c lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x00014f4e movs r0, r0 |
0x00014f50 ldm r2!, {r3, r4, r5} | r3 = *(r2!);
| r4 = *((r2! + 4));
| r5 = *((r2! + 8));
0x00014f52 movs r1, r0 | r1 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x16268 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_seek () | void apr_file_seek (int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_0h;
| int16_t var_8h;
| int16_t var_38h;
| int16_t var_3ch;
| int16_t var_74h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00016268 invalid |
0x0001626c ldr r1, [pc, 0xec] |
0x0001626e mov r5, r2 | r5 = r2;
0x00016270 sub sp, 0x7c |
0x00016272 movs r3, 0 | r3 = 0;
0x00016274 ldr r2, [pc, 0xe8] | r2 = *(0x16360);
0x00016276 mov r4, r0 | r4 = r0;
0x00016278 add r1, pc | r1 = 0x2c5d8;
0x0001627a ldr r7, [r0, 0x20] | r7 = *((r0 + 0x20));
0x0001627c ldr r2, [r1, r2] |
0x0001627e ldr r2, [r2] | r2 = *(0x2c5d8);
0x00016280 str r2, [sp, 0x74] | var_74h = r2;
0x00016282 mov.w r2, 0 | r2 = 0;
0x00016286 str r3, [r0, 0x10] | *((r0 + 0x10)) = r3;
| if (r7 == 0) {
0x00016288 cbz r7, 0x162da | goto label_2;
| }
0x0001628a ldr r0, [r0, 0x48] | r0 = *((r0 + 0x48));
| if (r0 != 0) {
0x0001628c cbz r0, 0x16292 |
0x0001628e blx 0xa268 | fcn_0000a268 ();
| }
0x00016292 cmp r6, 1 |
| if (r6 == 1) {
0x00016294 beq 0x16330 | goto label_3;
| }
0x00016296 cmp r6, 2 |
| if (r6 == 2) {
0x00016298 beq 0x16316 | goto label_4;
| }
0x0001629a movs r7, 0x16 | r7 = 0x16;
0x0001629c cmp r6, 0 |
| if (r6 == 0) {
0x0001629e beq 0x16308 | goto label_5;
| }
| label_1:
0x000162a0 ldr r2, [r4, 0x38] | r2 = *((r4 + 0x38));
0x000162a2 ldr r3, [r4, 0x40] | r3 = *((r4 + 0x40));
0x000162a4 ldr r1, [r4, 0x30] | r1 = *((r4 + 0x30));
0x000162a6 ldr r0, [r4, 0x48] | r0 = *((r4 + 0x48));
0x000162a8 subs r3, r3, r2 | r3 -= r2;
0x000162aa ldr r2, [r4, 0x44] | r2 = *((r4 + 0x44));
0x000162ac sbc r2, r2, 0 | __asm ("sbc r2, r2, 0");
0x000162b0 adds r3, r3, r1 | r3 += r1;
0x000162b2 adc r2, r2, 0 | __asm ("adc r2, r2, 0");
0x000162b6 strd r3, r2, [r5] | __asm ("strd r3, r2, [r5]");
| if (r0 == 0) {
0x000162ba cbz r0, 0x162c0 | goto label_0;
| }
0x000162bc blx 0xacfc | fcn_0000acfc ();
| do {
| label_0:
0x000162c0 ldr r2, [pc, 0xa0] |
0x000162c2 ldr r3, [pc, 0x9c] | r3 = *(0x16362);
0x000162c4 add r2, pc | r2 = 0x2c62c;
0x000162c6 ldr r3, [r2, r3] | r3 = *(0x2c62c);
0x000162c8 ldr r2, [r3] | r2 = *(0x2c62c);
0x000162ca ldr r3, [sp, 0x74] | r3 = var_74h;
0x000162cc eors r2, r3 | r2 ^= r3;
0x000162ce mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x000162d2 bne 0x16358 | goto label_6;
| }
0x000162d4 mov r0, r7 | r0 = r7;
0x000162d6 add sp, 0x7c |
0x000162d8 pop {r4, r5, r6, r7, pc} |
| label_2:
0x000162da ldr r0, [r0, 4] | r0 = *((r0 + 4));
0x000162dc str r6, [sp] | *(sp) = r6;
0x000162de ldrd r2, r3, [r5] | __asm ("ldrd r2, r3, [r5]");
0x000162e2 blx 0xa0c0 | fcn_0000a0c0 ();
0x000162e6 cmp.w r1, -1 |
0x000162ea it eq |
| if (r1 == -1) {
0x000162ec cmpeq r0, -1 | __asm ("cmpeq r0, -1");
| }
0x000162f0 it ne |
| if (r1 != -1) {
0x000162f2 strdne r0, r1, [r5] | __asm ("strdne r0, r1, [r5]");
| }
0x000162f6 bne 0x162c0 |
| } while (r1 != -1);
0x000162f8 vmov.i8 d16, 0xff | __asm ("vmov.i8 d16, 0xff");
0x000162fc vstr d16, [r5] | __asm ("vstr d16, [r5]");
0x00016300 blx 0xa580 | r0 = fcn_0000a580 ();
0x00016304 ldr r7, [r0] | r7 = *(r0);
0x00016306 b 0x162c0 | goto label_0;
| label_5:
0x00016308 ldrd r2, r3, [r5] | __asm ("ldrd r2, r3, [r5]");
0x0001630c mov r0, r4 | r0 = r4;
0x0001630e bl 0x161f0 | r0 = fcn_000161f0 (r0, r1, r2);
0x00016312 mov r7, r0 | r7 = r0;
0x00016314 b 0x162a0 | goto label_1;
| label_4:
0x00016316 mov r2, r4 | r2 = r4;
0x00016318 mov.w r1, 0x100 | r1 = 0x100;
0x0001631c add r0, sp, 8 | r0 += var_8h;
0x0001631e blx 0x9c14 | r0 = fcn_00009c14 ();
0x00016322 mov r7, r0 | r7 = r0;
0x00016324 cmp r0, 0 |
| if (r0 != 0) {
0x00016326 bne 0x162a0 | goto label_1;
| }
0x00016328 ldr r2, [sp, 0x38] | r2 = var_38h;
0x0001632a ldr r1, [r5] | r1 = *(r5);
0x0001632c ldr r3, [sp, 0x3c] | r3 = var_3ch;
0x0001632e b 0x16346 | goto label_7;
| label_3:
0x00016330 ldr r1, [r4, 0x38] | r1 = *((r4 + 0x38));
0x00016332 ldrd r2, r3, [r4, 0x40] | __asm ("ldrd r2, r3, [r4, 0x40]");
0x00016336 subs r2, r2, r1 | r2 -= r1;
0x00016338 ldr r1, [r4, 0x30] | r1 = *((r4 + 0x30));
0x0001633a sbc r3, r3, 0 | __asm ("sbc r3, r3, 0");
0x0001633e adds r2, r2, r1 | r2 += r1;
0x00016340 ldr r1, [r5] | r1 = *(r5);
0x00016342 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
| label_7:
0x00016346 adds r2, r2, r1 | r2 += r1;
0x00016348 ldr r1, [r5, 4] | r1 = *((r5 + 4));
0x0001634a mov r0, r4 | r0 = r4;
0x0001634c adc.w r3, r3, r1 | __asm ("adc.w r3, r3, r1");
0x00016350 bl 0x161f0 | r0 = fcn_000161f0 (r0, r1, r2);
0x00016354 mov r7, r0 | r7 = r0;
0x00016356 b 0x162a0 | goto label_1;
| label_6:
0x00016358 blx 0x9e90 | fcn_00009e90 ();
0x0001635c invalid |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x16368 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_trunc () | void apr_file_trunc (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_4h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
| if (? >= ?) {
0x00016368 addlt fp, r2, r0, ror r5 |
| }
0x0001636c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00016370 mov r4, r0 | r4 = r0;
0x00016372 ldr r3, [r0, 0x20] | r3 = *((r0 + 0x20));
| if (r3 == 0) {
0x00016374 cbz r3, 0x16392 | goto label_1;
| }
0x00016376 ldr r0, [r0, 0x48] | r0 = *((r0 + 0x48));
| if (r0 != 0) {
0x00016378 cbz r0, 0x1637e |
0x0001637a blx 0xa268 | fcn_0000a268 ();
| }
0x0001637e ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x00016380 cmp r3, 1 |
| if (r3 == 1) {
0x00016382 beq 0x163b2 | goto label_2;
| }
| if (r3 != 0) {
0x00016384 cbnz r3, 0x1638a | goto label_3;
| }
0x00016386 str r3, [r4, 0x30] | *((r4 + 0x30)) = r3;
0x00016388 str r3, [r4, 0x38] | *((r4 + 0x38)) = r3;
| do {
| label_3:
0x0001638a ldr r0, [r4, 0x48] | r0 = *((r4 + 0x48));
| if (r0 != 0) {
0x0001638c cbz r0, 0x16392 |
0x0001638e blx 0xacfc | fcn_0000acfc ();
| }
| label_1:
0x00016392 ldrd r2, r3, [sp] | __asm ("ldrd r2, r3, [sp]");
0x00016396 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00016398 blx 0x9db8 | fcn_00009db8 ();
0x0001639c adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001639e beq 0x16404 | goto label_4;
| }
0x000163a0 mov r2, sp | r2 = sp;
0x000163a2 movs r1, 0 | r1 = 0;
0x000163a4 mov r0, r4 | r0 = r4;
0x000163a6 blx 0x9ecc | r0 = fcn_00009ecc ();
0x000163aa mov r5, r0 | r5 = r0;
| label_0:
0x000163ac mov r0, r5 | r0 = r5;
0x000163ae add sp, 8 |
0x000163b0 pop {r4, r5, r6, pc} |
| label_2:
0x000163b2 ldr r3, [r4, 0x30] | r3 = *((r4 + 0x30));
0x000163b4 cmp r3, 0 |
0x000163b6 beq 0x1638a |
| } while (r3 == 0);
0x000163b8 ldrd r2, r1, [r4, 0x40] | __asm ("ldrd r2, r1, [r4, 0x40]");
0x000163bc movs r6, 0 | r6 = 0;
0x000163be ldr r0, [sp] | r0 = *(sp);
0x000163c0 ldr r5, [sp, 4] | r5 = var_4h;
0x000163c2 adds r2, r3, r2 | r2 = r3 + r2;
0x000163c4 adc r1, r1, 0 | __asm ("adc r1, r1, 0");
0x000163c8 cmp r0, r2 |
0x000163ca sbcs.w ip, r5, r1 | __asm ("sbcs.w ip, r5, r1");
| if (r0 < r2) {
0x000163ce bge 0x163e4 |
0x000163d0 subs r2, r2, r0 | r2 -= r0;
0x000163d2 sbc.w r1, r1, r5 | __asm ("sbc.w r1, r1, r5");
0x000163d6 cmp r3, r2 |
0x000163d8 sbcs.w r1, r6, r1 | __asm ("sbcs.w r1, r6, r1");
0x000163dc itet hs |
| if (r3 < r2) {
0x000163de subhs r3, r3, r2 | r3 -= r2;
| }
| if (r3 >= r2) {
0x000163e0 strlo r6, [r4, 0x30] | *((r4 + 0x30)) = r6;
| }
| if (r3 >= r2) {
0x000163e2 strhs r3, [r4, 0x30] | *((r4 + 0x30)) = r3;
| goto label_5;
| }
| }
| label_5:
0x000163e4 mov r0, r4 | r0 = r4;
0x000163e6 blx 0xab3c | close (r0);
0x000163ea ldr r2, [r4, 0x48] | r2 = *((r4 + 0x48));
0x000163ec movs r3, 0 | r3 = 0;
0x000163ee mov r5, r0 | r5 = r0;
0x000163f0 strd r3, r3, [r4, 0x38] | __asm ("strd r3, r3, [r4, 0x38]");
0x000163f4 str r3, [r4, 0x30] | *((r4 + 0x30)) = r3;
| if (r2 != 0) {
0x000163f6 cbz r2, 0x163fe |
0x000163f8 mov r0, r2 | r0 = r2;
0x000163fa blx 0xacfc | fcn_0000acfc ();
| }
0x000163fe cmp r5, 0 |
| if (r5 != 0) {
0x00016400 bne 0x163ac | goto label_0;
| }
0x00016402 b 0x16392 | goto label_1;
| label_4:
0x00016404 blx 0xa580 | r0 = fcn_0000a580 ();
0x00016408 ldr r5, [r0] | r5 = *(r0);
0x0001640a mov r0, r5 | r0 = r5;
0x0001640c add sp, 8 |
0x0001640e pop {r4, r5, r6, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x14f54 */
| #include <stdint.h>
|
; (fcn) sym.apr_file_write_full () | void apr_file_write_full (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h_2;
| int16_t var_4h_3;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
| if (? >= ?) {
0x00014f54 ldrbmi lr, [r0, sp, lsr 18]! |
| }
0x00014f58 mov r5, r2 | r5 = r2;
0x00014f5a ldr r2, [pc, 0x6c] |
0x00014f5c mov r8, r3 | r8 = r3;
0x00014f5e sub sp, 8 |
0x00014f60 mov r7, r0 | r7 = r0;
0x00014f62 ldr r3, [pc, 0x68] | r3 = *(0x14fce);
0x00014f64 mov sl, r1 | sl = r1;
0x00014f66 add r2, pc | r2 = 0x29f34;
0x00014f68 movs r6, 0 | r6 = 0;
0x00014f6a mov sb, sp | sb = sp;
0x00014f6c ldr r3, [r2, r3] |
0x00014f6e ldr r3, [r3] | r3 = *(0x29f34);
0x00014f70 str r3, [sp, 4] | var_4h_3 = r3;
0x00014f72 mov.w r3, 0 | r3 = 0;
| do {
0x00014f76 mov r1, sl | r1 = sl;
0x00014f78 mov r2, sb | r2 = sb;
0x00014f7a mov r0, r7 | r0 = r7;
0x00014f7c str r5, [sp] | *(sp) = r5;
0x00014f7e blx 0xab7c | fcn_0000ab7c ();
0x00014f82 ldr r4, [sp] | r4 = *(sp);
0x00014f84 subs r5, r5, r4 | r5 -= r4;
0x00014f86 add sl, r4 | sl += r4;
0x00014f88 ite ne |
| if (r5 == r5) {
0x00014f8a movne r3, 1 | r3 = 1;
| }
| if (r5 != r5) {
0x00014f8c moveq r3, 0 | r3 = 0;
| }
0x00014f8e cmp r0, 0 |
0x00014f90 ite ne |
| if (r0 == 0) {
0x00014f92 movne r3, 0 | r3 = 0;
| }
| if (r0 != 0) {
0x00014f94 andeq r3, r3, 1 | r3 &= 1;
| }
0x00014f98 add r6, r4 | r6 += r4;
0x00014f9a cmp r3, 0 |
0x00014f9c bne 0x14f76 |
| } while (r3 != 0);
0x00014f9e cmp.w r8, 0 |
| if (r8 != 0) {
0x00014fa2 beq 0x14fa8 |
0x00014fa4 str.w r6, [r8] | __asm ("str.w r6, [r8]");
| }
0x00014fa8 ldr r2, [pc, 0x24] |
0x00014faa ldr r3, [pc, 0x20] | r3 = *(0x14fce);
0x00014fac add r2, pc | r2 = 0x29f80;
0x00014fae ldr r3, [r2, r3] | r3 = *(0x29f80);
0x00014fb0 ldr r2, [r3] | r2 = *(0x29f80);
0x00014fb2 ldr r3, [sp, 4] | r3 = var_4h_3;
0x00014fb4 eors r2, r3 | r2 ^= r3;
0x00014fb6 mov.w r3, 0 | r3 = 0;
| if (r2 == r3) {
0x00014fba bne 0x14fc2 |
0x00014fbc add sp, 8 |
0x00014fbe pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
0x00014fc2 blx 0x9e90 | fcn_00009e90 ();
0x00014fc6 nop |
0x00014fc8 ldm r1, {r1, r2, r3, r4, r5, r6, r7} | r1 = *(r1);
| r2 = *((r1 + 4));
| r3 = *((r1 + 8));
| r4 = *((r1 + 12));
| r5 = *((r1 + 16));
| r6 = *((r1 + 20));
| r7 = *((r1 + 24));
0x00014fca movs r1, r0 | r1 = r0;
0x00014fcc lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x00014fce movs r0, r0 |
0x00014fd0 ldm r1!, {r3, r4, r5, r7} | r3 = *(r1!);
| r4 = *((r1! + 4));
| r5 = *((r1! + 8));
| r7 = *((r1! + 12));
0x00014fd2 movs r1, r0 | r1 = r0;
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1485c).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x14548 */
| #include <stdint.h>
|
; (fcn) sym.apr_filepath_merge () | void apr_filepath_merge (int16_t arg_1h, int16_t arg_40h, int16_t arg1, int16_t arg2, uint32_t arg3, int16_t arg4) {
| int16_t var_bp_4h;
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00014548 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001454c mov r8, r1 | r8 = r1;
0x0001454e ldr r1, [pc, 0x2d8] |
0x00014550 mov sb, r3 | sb = r3;
0x00014552 sub sp, 0x1c |
0x00014554 ldr r3, [pc, 0x2d4] | r3 = *(0x1482c);
0x00014556 add r1, pc | r1 = 0x28d84;
0x00014558 str r0, [sp, 4] | var_4h = r0;
0x0001455a ldr r4, [sp, 0x40] | r4 = *(arg_40h);
0x0001455c ldr r3, [r1, r3] |
0x0001455e ldr r3, [r3] | r3 = *(0x28d84);
0x00014560 str r3, [sp, 0x14] | var_14h = r3;
0x00014562 mov.w r3, 0 | r3 = 0;
0x00014566 cmp r2, 0 |
| if (r2 == 0) {
0x00014568 beq.w 0x146e4 | goto label_17;
| }
0x0001456c ldrb r3, [r2] | r3 = *(r2);
0x0001456e mov r6, r2 | r6 = r2;
0x00014570 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x00014572 beq 0x145f8 | goto label_18;
| }
0x00014574 tst.w sb, 8 |
| if ((sb & 8) != 0) {
0x00014578 bne.w 0x146cc | goto label_4;
| }
| label_3:
0x0001457c cmp.w r8, 0 |
| if (r8 == 0) {
0x00014580 beq.w 0x1474a | goto label_19;
| }
| do {
| label_1:
0x00014584 mov r0, r8 | r0 = r8;
0x00014586 blx 0xa40c | r0 = fcn_0000a40c ();
0x0001458a mov sl, r0 | sl = r0;
| label_0:
0x0001458c mov r0, r6 | r0 = r6;
0x0001458e blx 0xa40c | r0 = fcn_0000a40c ();
0x00014592 add.w r1, r0, sl | r1 = r0 + sl;
0x00014596 adds r1, 4 | r1 += 4;
0x00014598 cmp.w r1, 0x1000 |
0x0001459c it hi |
| if (r1 <= 0x1000) {
0x0001459e movhi r0, 0x24 | r0 = 0x24;
| }
| if (r1 > 0x1000) {
0x000145a0 bhi.w 0x146b0 | goto label_2;
| }
0x000145a4 mov r0, r4 | r0 = r4;
0x000145a6 blx 0xa0d0 | fcn_0000a0d0 ();
0x000145aa ldrb r3, [r6] | r3 = *(r6);
0x000145ac mov r7, r0 | r7 = r0;
0x000145ae cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x000145b0 beq 0x1461e | goto label_20;
| }
0x000145b2 ldrb.w r3, [r8] | r3 = *(r8);
0x000145b6 cmp r3, 0x2f |
| if (r3 != 0x2f) {
0x000145b8 beq 0x145c6 |
0x000145ba tst.w sb, 4 |
0x000145be it ne |
| if ((sb & 4) != 0) {
0x000145c0 movwne r0, 0x4e35 | __asm ("movwne r0, aav.0x000000ff");
| }
| if ((sb & 4) != 0) {
0x000145c4 bne 0x146b0 | goto label_2;
| }
| }
0x000145c6 mov r2, sl | r2 = sl;
0x000145c8 mov r1, r8 | r1 = r8;
0x000145ca mov r0, r7 | r0 = r7;
0x000145cc blx 0x9cf8 | fcn_00009cf8 ();
0x000145d0 cmp.w sl, 0 |
| if (sl == 0) {
0x000145d4 beq.w 0x14742 | goto label_21;
| }
0x000145d8 add.w r3, r7, sl | r3 = r7 + sl;
0x000145dc ldrb r3, [r3, -0x1] | r3 = *((r3 - 0x1));
0x000145e0 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x000145e2 beq.w 0x14810 | goto label_22;
| }
0x000145e4 strh r5, [r2, 8] | *((r2 + 8)) = r5;
0x000145e6 add.w r3, sl, 1 | r3 = sl + 1;
0x000145ea mov r2, r3 | r2 = r3;
0x000145ec str r3, [sp] | *(sp) = r3;
0x000145ee movs r3, 0x2f | r3 = 0x2f;
0x000145f0 mov fp, r2 |
0x000145f2 strb.w r3, [r7, sl] | *((r7 + sl)) = r3;
0x000145f6 b 0x14632 | goto label_9;
| label_18:
0x000145f8 tst.w sb, 2 |
| if ((sb & 2) != 0) {
0x000145fc bne.w 0x14788 | goto label_12;
| }
0x00014600 tst.w sb, 8 |
| if ((sb & 8) != 0) {
0x00014604 bne 0x146de | goto label_23;
| }
0x00014606 cmp.w r8, 0 |
0x0001460a bne 0x14584 |
| } while (r8 != 0);
0x0001460c tst.w sb, 1 |
| if ((sb & 1) != 0) {
0x00014610 bne.w 0x1474a | goto label_19;
| }
0x00014614 mov sl, r8 | sl = r8;
0x00014616 ldr.w r8, [pc, 0x218] | r8 = *(0x00014830);
0x0001461a add r8, pc | r8 += pc;
0x0001461c b 0x1458c | goto label_0;
| do {
| label_20:
0x0001461e ldrb r3, [r6, 1]! | r3 = *((r6 += 1));
0x00014622 cmp r3, 0x2f |
0x00014624 beq 0x1461e |
| } while (r3 == 0x2f);
0x00014626 movs r3, 0x2f | r3 = 0x2f;
0x00014628 mov.w fp, 1 |
0x0001462c strb r3, [r7] | *(r7) = r3;
0x0001462e movs r3, 0 | r3 = 0;
0x00014630 str r3, [sp] | *(sp) = r3;
| label_9:
0x00014632 ldrb r0, [r6] | r0 = *(r6);
| if (r0 == 0) {
0x00014634 cbz r0, 0x14694 | goto label_7;
| }
| label_16:
0x00014636 ldr r3, [pc, 0x1fc] |
0x00014638 mov r1, r6 | r1 = r6;
0x0001463a add r3, pc | r3 = 0x28e74;
0x0001463c str r3, [sp, 0xc] | var_ch = r3;
0x0001463e and r3, sb, 2 | r3 = sb & 2;
0x00014642 str r3, [sp, 8] | var_8h = r3;
| label_8:
0x00014644 cmp r0, 0x2f |
0x00014646 mov r4, r1 | r4 = r1;
| if (r0 == 0x2f) {
0x00014648 beq 0x14738 | goto label_24;
| }
| do {
0x0001464a mov r5, r4 | r5 = r4;
0x0001464c ldrb r3, [r4, 1]! | r3 = *((r4 += 1));
0x00014650 cmp r3, 0 |
0x00014652 it ne |
| if (r3 != 0) {
0x00014654 cmpne r3, 0x2f | __asm ("cmpne r3, 0x2f");
| }
0x00014656 bne 0x1464a |
| } while (r3 != 0);
0x00014658 subs r2, r4, r1 | r2 = r4 - r1;
| if (r2 != r4) {
0x0001465a beq 0x14690 |
0x0001465c sub.w r0, r0, 0x2e | r0 -= 0x2e;
0x00014660 clz r0, r0 | r0 &= r0;
0x00014664 lsrs r0, r0, 5 | r0 >>= 5;
0x00014666 cmp r2, 1 |
0x00014668 ite ne |
| if (r2 == 1) {
0x0001466a movne r6, 0 | r6 = 0;
| }
| if (r2 != 1) {
0x0001466c andeq r6, r0, 1 | r6 = r0 & 1;
| }
| if (r6 != 0) {
0x00014670 cbnz r6, 0x14690 | goto label_14;
| }
0x00014672 cmp r2, 2 |
0x00014674 ite ne |
| if (r2 == 2) {
0x00014676 movne r0, 0 | r0 = 0;
| }
| if (r2 != 2) {
0x00014678 andeq r0, r0, 1 | r0 &= 1;
| }
0x0001467c cmp r0, 0 |
| if (r0 != 0) {
0x0001467e bne 0x146f2 | goto label_25;
| }
| if (r3 != 0) {
| label_5:
0x00014680 cbz r3, 0x14684 |
0x00014682 adds r2, 1 | r2++;
| }
0x00014684 add.w r0, r7, fp | r0 = r7 + fp;
0x00014688 add fp, r2 |
0x0001468a blx 0x9cf8 | fcn_00009cf8 ();
| label_6:
0x0001468e ldrb r3, [r5, 1] | r3 = *((r5 + 1));
| }
| label_14:
0x00014690 cmp r3, 0 |
| if (r3 != 0) {
0x00014692 bne 0x14738 | goto label_24;
| }
| label_7:
0x00014694 ldr r3, [sp] | r3 = *(sp);
0x00014696 movs r1, 0 | r1 = 0;
0x00014698 strb.w r1, [r7, fp] | *((r7 + fp)) = r1;
0x0001469c cmp sl, r3 |
0x0001469e ite ls |
| if (sl > r3) {
0x000146a0 movls r2, 0 | r2 = 0;
| }
| if (sl <= r3) {
0x000146a2 andhi r2, sb, 1 | r2 = sb & 1;
| }
0x000146a4 lsls r1, r0, 8 | r1 = r0 << 8;
0x000146a6 cmp r2, 0 |
| if (r2 != 0) {
0x000146a8 bne 0x14766 | goto label_26;
| }
| label_10:
0x000146aa ldr r3, [sp, 4] | r3 = var_4h;
0x000146ac movs r0, 0 | r0 = 0;
0x000146ae str r7, [r3] | *(r3) = r7;
| label_2:
0x000146b0 ldr r2, [pc, 0x184] |
0x000146b2 ldr r3, [pc, 0x178] | r3 = *(0x1482e);
0x000146b4 add r2, pc | r2 = 0x28ef0;
0x000146b6 ldr r3, [r2, r3] | r3 = *(0x28ef0);
0x000146b8 ldr r2, [r3] | r2 = *(0x28ef0);
0x000146ba ldr r3, [sp, 0x14] | r3 = var_14h;
0x000146bc eors r2, r3 | r2 ^= r3;
0x000146be mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x000146c2 bne.w 0x1481c | goto label_27;
| }
0x000146c6 add sp, 0x1c |
0x000146c8 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_4:
0x000146cc cmp.w r8, 0 |
| if (r8 == 0) {
0x000146d0 beq.w 0x147da | goto label_28;
| }
0x000146d4 ldrb.w r3, [r8] | r3 = *(r8);
0x000146d8 cmp r3, 0x2f |
| if (r3 != 0x2f) {
0x000146da bne.w 0x14584 | goto label_1;
| }
| label_23:
0x000146de movw r0, 0x4e34 | r0 = 0x4e34;
0x000146e2 b 0x146b0 | goto label_2;
| label_17:
0x000146e4 ldr r6, [pc, 0x154] |
0x000146e6 tst.w sb, 8 |
0x000146ea add r6, pc | r6 = 0x28f2a;
| if ((sb & 8) == 0) {
0x000146ec beq.w 0x1457c | goto label_3;
| }
0x000146f0 b 0x146cc | goto label_4;
| label_25:
0x000146f2 ldrb r0, [r1, 1] | r0 = *((r1 + 1));
0x000146f4 cmp r0, 0x2e |
| if (r0 != 0x2e) {
0x000146f6 bne 0x14680 | goto label_5;
| }
0x000146f8 cmp.w fp, 1 |
| if (fp == 1) {
0x000146fc beq 0x147ca | goto label_29;
| }
0x000146fe cmp.w fp, 0 |
| if (fp != 0) {
0x00014702 bne 0x1478e | goto label_30;
| }
| label_15:
0x00014704 ldr r2, [sp, 8] | r2 = var_8h;
0x00014706 cmp r2, 0 |
| if (r2 != 0) {
0x00014708 bne 0x14788 | goto label_12;
| }
0x0001470a cmp r3, 0 |
0x0001470c add.w r0, r7, fp | r0 = r7 + fp;
0x00014710 ite ne |
| if (r3 == 0) {
0x00014712 movne r2, 3 | r2 = 3;
| }
| if (r3 != 0) {
0x00014714 moveq r2, 2 | r2 = 2;
| }
0x00014716 ldr r1, [sp, 0xc] | r1 = var_ch;
0x00014718 blx 0x9cf8 | fcn_00009cf8 ();
0x0001471c ldrb r3, [r4] | r3 = *(r4);
0x0001471e cmp r3, 0 |
0x00014720 ite ne |
| if (r3 == 0) {
0x00014722 movne r3, 3 | r3 = 3;
| }
| if (r3 != 0) {
0x00014724 moveq r3, 2 | r3 = 2;
| }
0x00014726 add fp, r3 |
0x00014728 ldr r3, [sp] | r3 = *(sp);
0x0001472a cmp fp, r3 |
| if (fp >= r3) {
0x0001472c bhs 0x1468e | goto label_6;
| }
| label_11:
0x0001472e ldrb r3, [r5, 1] | r3 = *((r5 + 1));
0x00014730 str.w fp, [sp] | __asm ("str.w fp, [sp]");
0x00014734 cmp r3, 0 |
| if (r3 == 0) {
0x00014736 beq 0x14694 | goto label_7;
| }
| label_24:
0x00014738 ldrb r0, [r4, 1] | r0 = *((r4 + 1));
0x0001473a adds r1, r4, 1 | r1 = r4 + 1;
0x0001473c cmp r0, 0 |
| if (r0 != 0) {
0x0001473e bne 0x14644 | goto label_8;
| }
0x00014740 b 0x14694 | goto label_7;
| label_21:
0x00014742 mov fp, sl |
0x00014744 str.w sl, [sp] | __asm ("str.w sl, [sp]");
0x00014748 b 0x14632 | goto label_9;
| label_19:
0x0001474a mov r2, r4 | r2 = r4;
0x0001474c mov r1, sb | r1 = sb;
0x0001474e add r0, sp, 0x10 | r0 += var_10h;
0x00014750 blx 0xa9a0 | fcn_0000a9a0 ();
0x00014754 ldr.w r8, [sp, 0x10] | r8 = var_10h;
0x00014758 cmp r0, 0 |
| if (r0 == 0) {
0x0001475a beq.w 0x14584 | goto label_1;
| }
0x0001475e blx 0xa580 | r0 = fcn_0000a580 ();
0x00014762 ldr r0, [r0] | r0 = *(r0);
0x00014764 b 0x146b0 | goto label_2;
| label_26:
0x00014766 mov r2, sl | r2 = sl;
0x00014768 mov r1, r7 | r1 = r7;
0x0001476a mov r0, r8 | r0 = r8;
0x0001476c blx 0xac10 | r0 = fcn_0000ac10 ();
| if (r0 != 0) {
0x00014770 cbnz r0, 0x14788 | goto label_12;
| }
0x00014772 add r8, sl | r8 += sl;
0x00014774 ldrb r3, [r8, -0x1] | r3 = *((r8 - 0x1));
0x00014778 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x0001477a beq 0x146aa | goto label_10;
| }
0x0001477c ldrb.w r3, [r7, sl] | r3 = *((r7 + sl));
0x00014780 cmp r3, 0 |
0x00014782 it ne |
| if (r3 == 0) {
0x00014784 cmpne r3, 0x2f | __asm ("cmpne r3, 0x2f");
| goto label_31;
| }
| if (r3 == 0) {
| label_31:
0x00014786 beq 0x146aa | goto label_10;
| }
| label_12:
0x00014788 movw r0, 0x4e37 | r0 = 0x4e37;
0x0001478c b 0x146b0 | goto label_2;
| label_30:
0x0001478e cmp.w fp, 3 |
| if (fp == 3) {
0x00014792 beq 0x147fc | goto label_32;
| }
| if (fp >= 3) {
0x00014794 bls 0x147a2 |
0x00014796 sub.w r2, fp, 4 | r2 = fp - 4;
0x0001479a ldrb r1, [r7, r2] | r1 = *((r7 + r2));
0x0001479c add r2, r7 | r2 += r7;
0x0001479e cmp r1, 0x2f |
| if (r1 == 0x2f) {
0x000147a0 beq 0x147e4 | goto label_33;
| }
| }
| label_13:
0x000147a2 add.w r3, fp, -1 | r3 = fp + -1;
0x000147a6 adds r2, r7, r3 | r2 = r7 + r3;
0x000147a8 b 0x147b4 |
| while (r3 != 0) {
0x000147aa ldrb r1, [r2, -0x1]! | r1 = *((r2 -= 0x1));
0x000147ae cmp r1, 0x2f |
| if (r1 == 0x2f) {
0x000147b0 beq 0x147ba | goto label_34;
| }
0x000147b2 subs r3, 1 | r3--;
0x000147b4 mov fp, r3 |
0x000147b6 cmp r3, 0 |
0x000147b8 bne 0x147aa |
| }
| label_34:
0x000147ba ldr r2, [sp] | r2 = *(sp);
0x000147bc cmp r3, r2 |
| if (r3 >= r2) {
0x000147be bhs.w 0x1468e | goto label_6;
| }
0x000147c2 ldr r3, [sp, 8] | r3 = var_8h;
0x000147c4 cmp r3, 0 |
| if (r3 == 0) {
0x000147c6 beq 0x1472e | goto label_11;
| }
0x000147c8 b 0x14788 | goto label_12;
| label_29:
0x000147ca ldrb r2, [r7] | r2 = *(r7);
0x000147cc cmp r2, 0x2f |
| if (r2 != 0x2f) {
0x000147ce bne 0x147a2 | goto label_13;
| }
0x000147d0 ldr r2, [sp, 8] | r2 = var_8h;
0x000147d2 cmp r2, 0 |
| if (r2 != 0) {
0x000147d4 bne 0x14788 | goto label_12;
| }
0x000147d6 str r2, [sp] | *(sp) = r2;
0x000147d8 b 0x14690 | goto label_14;
| label_28:
0x000147da mov sl, r8 | sl = r8;
0x000147dc ldr.w r8, [pc, 0x60] |
0x000147e0 add r8, pc | r8 = 0x29024;
0x000147e2 b 0x1458c | goto label_0;
| label_33:
0x000147e4 ldrb r1, [r2, 1]! | r1 = *((r2 += 1));
0x000147e8 cmp r1, 0x2e |
| if (r1 != 0x2e) {
0x000147ea bne 0x147a2 | goto label_13;
| }
0x000147ec ldrb r1, [r2, 1]! | r1 = *((r2 += 1));
0x000147f0 cmp r1, 0x2e |
| if (r1 != 0x2e) {
0x000147f2 bne 0x147a2 | goto label_13;
| }
0x000147f4 ldrb r2, [r2, 1] | r2 = *((r2 + 1));
0x000147f6 cmp r2, 0x2f |
| if (r2 != 0x2f) {
0x000147f8 bne 0x147a2 | goto label_13;
| }
0x000147fa b 0x14704 | goto label_15;
| label_32:
0x000147fc ldrb r2, [r7] | r2 = *(r7);
0x000147fe cmp r2, 0x2e |
| if (r2 != 0x2e) {
0x00014800 bne 0x147a2 | goto label_13;
| }
0x00014802 ldrb r1, [r7, 1] | r1 = *((r7 + 1));
0x00014804 cmp r1, 0x2e |
| if (r1 != 0x2e) {
0x00014806 bne 0x147a2 | goto label_13;
| }
0x00014808 ldrb r2, [r7, 2] | r2 = *((r7 + 2));
0x0001480a cmp r2, 0x2f |
| if (r2 != 0x2f) {
0x0001480c bne 0x147a2 | goto label_13;
| }
0x0001480e b 0x14704 | goto label_15;
| label_22:
0x00014810 ldrb r0, [r6] | r0 = *(r6);
| if (r0 != 0) {
0x00014812 cbz r0, 0x14820 |
0x00014814 mov fp, sl |
0x00014816 str.w sl, [sp] | __asm ("str.w sl, [sp]");
0x0001481a b 0x14636 | goto label_16;
| label_27:
0x0001481c blx 0x9e90 | fcn_00009e90 ();
| }
0x00014820 strb.w r0, [r7, sl] | *((r7 + sl)) = r0;
0x00014824 b 0x146aa | goto label_10;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x14514 */
| #include <stdint.h>
|
; (fcn) sym.apr_filepath_root () | uint32_t apr_filepath_root (int16_t arg1, int16_t arg2, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r3 = arg4;
0x00014514 ldr r2, [r1] | r2 = *(r1);
0x00014516 ldrb r2, [r2] | r2 = *(r2);
0x00014518 cmp r2, 0x2f |
| if (r2 != 0x2f) {
0x0001451a beq 0x14522 |
0x0001451c movw r0, 0x4e35 | r0 = 0x4e35;
0x00014520 bx lr | return r0;
| }
0x00014522 push {r3, r4, r5, lr} |
0x00014524 mov r4, r1 | r4 = r1;
0x00014526 ldr r1, [pc, 0x1c] |
0x00014528 mov r5, r0 | r5 = r0;
0x0001452a mov r0, r3 | r0 = r3;
0x0001452c add r1, pc | r1 = 0x28a76;
0x0001452e blx 0xa41c | fcn_0000a41c ();
0x00014532 str r0, [r5] | *(r5) = r0;
0x00014534 ldr r3, [r4] | r3 = *(r4);
| do {
0x00014536 adds r3, 1 | r3++;
0x00014538 str r3, [r4] | *(r4) = r3;
0x0001453a ldrb r2, [r3] | r2 = *(r3);
0x0001453c cmp r2, 0x2f |
0x0001453e beq 0x14536 |
| } while (r2 == 0x2f);
0x00014540 movs r0, 0 | r0 = 0;
0x00014542 pop {r3, r4, r5, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x18a88 */
| #include <stdint.h>
|
; (fcn) sym.apr_getopt_init () | void apr_getopt_init (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00018a88 push.w {r4, r5, r6, r7, r8, lr} |
0x00018a8c mov r7, r1 | r7 = r1;
0x00018a8e mov r5, r0 | r5 = r0;
0x00018a90 movs r1, 0x30 | r1 = 0x30;
0x00018a92 mov r0, r7 | r0 = r7;
0x00018a94 mov r4, r2 | r4 = r2;
0x00018a96 ldr r6, [pc, 0x58] |
0x00018a98 mov r8, r3 | r8 = r3;
0x00018a9a blx 0xa0d0 | fcn_0000a0d0 ();
0x00018a9e ldr r3, [pc, 0x54] | r3 = *(0x18af6);
0x00018aa0 mov r2, r0 | r2 = r0;
0x00018aa2 str r0, [r5] | *(r5) = r0;
0x00018aa4 add r6, pc | r6 = 0x3159a;
0x00018aa6 str r7, [r0] | *(r0) = r7;
0x00018aa8 mov r0, r7 | r0 = r7;
0x00018aaa movs r7, 0 | r7 = 0;
0x00018aac str r7, [r2, 0x14] | *((r2 + 0x14)) = r7;
0x00018aae ldr r3, [r6, r3] | r3 = *(0x3159a);
0x00018ab0 str r3, [r2, 4] | *((r2 + 4)) = r3;
0x00018ab2 ldr r3, [pc, 0x44] | r3 = *(0x18afa);
0x00018ab4 ldr r3, [r6, r3] |
0x00018ab6 ldr r3, [r3] | r3 = *(0x3159a);
0x00018ab8 str r3, [r2, 8] | *((r2 + 8)) = r3;
0x00018aba ldr r2, [r5] | r2 = *(r5);
0x00018abc ldr r3, [pc, 0x3c] |
0x00018abe str r4, [r2, 0x18] | *((r2 + 0x18)) = r4;
0x00018ac0 adds r4, 1 | r4++;
0x00018ac2 lsls r4, r4, 2 | r4 <<= 2;
0x00018ac4 add r3, pc | r3 = 0x315c4;
0x00018ac6 str r3, [r2, 0x20] | *((r2 + 0x20)) = r3;
0x00018ac8 mov r1, r4 | r1 = r4;
0x00018aca subs r4, 4 | r4 -= 4;
0x00018acc blx 0xa0d0 | fcn_0000a0d0 ();
0x00018ad0 mov r2, r4 | r2 = r4;
0x00018ad2 mov r1, r8 | r1 = r8;
0x00018ad4 mov r6, r0 | r6 = r0;
0x00018ad6 blx 0x9cf8 | fcn_00009cf8 ();
0x00018ada ldr r3, [r5] | r3 = *(r5);
0x00018adc movs r2, 1 | r2 = 1;
0x00018ade mov r0, r7 | r0 = r7;
0x00018ae0 str r6, [r3, 0x1c] | *((r3 + 0x1c)) = r6;
0x00018ae2 str r7, [r6, r4] | *((r6 + r4)) = r7;
0x00018ae4 str r7, [r3, 0x24] | *((r3 + 0x24)) = r7;
0x00018ae6 str r2, [r3, 0xc] | *((r3 + 0xc)) = r2;
0x00018ae8 strd r2, r2, [r3, 0x28] | __asm ("strd r2, r2, [r3, 0x28]");
0x00018aec pop.w {r4, r5, r6, r7, r8, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x18b00 */
| #include <stdint.h>
|
; (fcn) sym.apr_getopt () | void apr_getopt (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
| if (? >= ?) {
0x00018b00 ldrbmi lr, [r0, sp, lsr 18]! |
| }
0x00018b04 mov r4, r0 | r4 = r0;
0x00018b06 ldr r0, [r0, 0x14] | r0 = *((r0 + 0x14));
0x00018b08 mov sb, r1 | sb = r1;
0x00018b0a mov r6, r2 | r6 = r2;
0x00018b0c mov r8, r3 | r8 = r3;
| if (r0 == 0) {
0x00018b0e cbnz r0, 0x18b16 |
0x00018b10 ldr r5, [r4, 0x20] | r5 = *((r4 + 0x20));
0x00018b12 ldrb r3, [r5] | r3 = *(r5);
| if (r3 != 0) {
0x00018b14 cbnz r3, 0x18b42 | goto label_3;
| }
| }
0x00018b16 movs r3, 0 | r3 = 0;
0x00018b18 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
0x00018b1a str r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
0x00018b1c ldr r3, [r4, 0x18] | r3 = *((r4 + 0x18));
0x00018b1e cmp r2, r3 |
| if (r2 < r3) {
0x00018b20 bge 0x18b7c |
0x00018b22 ldr r3, [r4, 0x1c] | r3 = *((r4 + 0x1c));
0x00018b24 ldr.w r5, [r3, r2, lsl 2] | offset_0 = r2 << 2;
| r5 = *((r3 + offset_0));
0x00018b28 str r5, [r4, 0x20] | *((r4 + 0x20)) = r5;
0x00018b2a ldrb r3, [r5] | r3 = *(r5);
0x00018b2c cmp r3, 0x2d |
| if (r3 != 0x2d) {
0x00018b2e bne 0x18b7c | goto label_4;
| }
0x00018b30 ldrb r3, [r5, 1] | r3 = *((r5 + 1));
| if (r3 != 0) {
0x00018b32 cbz r3, 0x18b42 |
0x00018b34 adds r3, r5, 1 | r3 = r5 + 1;
0x00018b36 str r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
0x00018b38 ldrb r1, [r5, 1] | r1 = *((r5 + 1));
0x00018b3a cmp r1, 0x2d |
0x00018b3c it ne |
| if (r1 == 0x2d) {
0x00018b3e movne r5, r3 | r5 = r3;
| }
| if (r1 == 0x2d) {
0x00018b40 beq 0x18c30 | goto label_5;
| }
| }
| label_3:
0x00018b42 add.w sl, r5, 1 | sl = r5 + 1;
0x00018b46 str.w sl, [r4, 0x20] | __asm ("str.w sl, [r4, 0x20]");
0x00018b4a ldrb r7, [r5] | r7 = *(r5);
0x00018b4c cmp r7, 0x3a |
0x00018b4e str r7, [r4, 0x10] | *((r4 + 0x10)) = r7;
| if (r7 == 0x3a) {
0x00018b50 beq 0x18ba0 | goto label_6;
| }
0x00018b52 mov r1, r7 | r1 = r7;
0x00018b54 mov r0, sb | r0 = sb;
0x00018b56 blx 0xa450 | r0 = fcn_0000a450 ();
| if (r0 == 0) {
0x00018b5a cbz r0, 0x18b92 | goto label_7;
| }
0x00018b5c ldrb r3, [r0, 1] | r3 = *((r0 + 1));
0x00018b5e cmp r3, 0x3a |
| if (r3 == 0x3a) {
0x00018b60 beq 0x18bdc | goto label_8;
| }
0x00018b62 movs r3, 0 | r3 = 0;
0x00018b64 str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x00018b68 ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x00018b6a ldrb r3, [r3] | r3 = *(r3);
| if (r3 == 0) {
0x00018b6c cbnz r3, 0x18b74 |
0x00018b6e ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00018b70 adds r3, 1 | r3++;
0x00018b72 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
| label_1:
0x00018b74 movs r0, 0 | r0 = 0;
0x00018b76 strb r7, [r6] | *(r6) = r7;
0x00018b78 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
| label_4:
0x00018b7c ldr r3, [pc, 0xd0] |
0x00018b7e movw r0, 0x117e |
0x00018b82 ldrb r7, [r4, 0x10] | r7 = *((r4 + 0x10));
0x00018b84 movt r0, 1 | r0 = 0x1117e;
0x00018b88 add r3, pc | r3 = 0x317dc;
0x00018b8a str r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
| do {
| label_2:
0x00018b8c strb r7, [r6] | *(r6) = r7;
0x00018b8e pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_7:
0x00018b92 cmp r7, 0x2d |
0x00018b94 itt eq |
| if (r7 == 0x2d) {
0x00018b96 movweq r0, 0x117e |
| }
| if (r7 == 0x2d) {
0x00018b9a movt r0, 1 | r0 = 0x1117e;
| }
0x00018b9e beq 0x18b8c |
| } while (r7 == 0x2d);
| label_6:
0x00018ba0 ldrb r3, [r5, 1] | r3 = *((r5 + 1));
| if (r3 == 0) {
0x00018ba2 cbnz r3, 0x18baa |
0x00018ba4 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00018ba6 adds r3, 1 | r3++;
0x00018ba8 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x00018baa ldr r5, [r4, 4] | r5 = *((r4 + 4));
| if (r5 == 0) {
0x00018bac cbz r5, 0x18bce | goto label_0;
| }
0x00018bae ldrb.w r3, [sb] | r3 = *(sb);
0x00018bb2 cmp r3, 0x3a |
| if (r3 == 0x3a) {
0x00018bb4 beq 0x18bce | goto label_0;
| }
0x00018bb6 ldr r3, [r4, 0x1c] | r3 = *((r4 + 0x1c));
0x00018bb8 ldr r7, [r4, 8] | r7 = *((r4 + 8));
0x00018bba ldr r0, [r3] | r0 = *(r3);
0x00018bbc blx 0x9e38 | fcn_00009e38 ();
0x00018bc0 ldr r1, [pc, 0x90] |
0x00018bc2 mov r2, r0 | r2 = r0;
0x00018bc4 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00018bc6 mov r0, r7 | r0 = r7;
0x00018bc8 add r1, pc | r1 = 0x31820;
0x00018bca blx r5 | uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00018bcc ldrb r7, [r4, 0x10] | r7 = *((r4 + 0x10));
| do {
| label_0:
0x00018bce movw r0, 0x117c |
0x00018bd2 strb r7, [r6] | *(r6) = r7;
0x00018bd4 movt r0, 1 | r0 = 0x1117c;
0x00018bd8 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_8:
0x00018bdc ldrb r2, [r5, 1] | r2 = *((r5 + 1));
0x00018bde ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
| if (r2 != 0) {
0x00018be0 cbnz r2, 0x18c20 | goto label_9;
| }
0x00018be2 ldr r2, [r4, 0x18] | r2 = *((r4 + 0x18));
0x00018be4 adds r3, 1 | r3++;
0x00018be6 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00018be8 cmp r2, r3 |
| if (r2 > r3) {
0x00018bea bgt 0x18c1a | goto label_10;
| }
0x00018bec ldr r3, [pc, 0x68] |
0x00018bee add r3, pc | r3 = 0x3184a;
0x00018bf0 str r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
0x00018bf2 ldrb.w r3, [sb] | r3 = *(sb);
0x00018bf6 cmp r3, 0x3a |
| if (r3 == 0x3a) {
0x00018bf8 beq 0x18c46 | goto label_11;
| }
0x00018bfa ldr r5, [r4, 4] | r5 = *((r4 + 4));
0x00018bfc cmp r5, 0 |
0x00018bfe beq 0x18bce |
| } while (r5 == 0);
0x00018c00 ldr r3, [r4, 0x1c] | r3 = *((r4 + 0x1c));
0x00018c02 ldr r7, [r4, 8] | r7 = *((r4 + 8));
0x00018c04 ldr r0, [r3] | r0 = *(r3);
0x00018c06 blx 0x9e38 | fcn_00009e38 ();
0x00018c0a ldr r1, [pc, 0x50] |
0x00018c0c mov r2, r0 | r2 = r0;
0x00018c0e ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00018c10 mov r0, r7 | r0 = r7;
0x00018c12 add r1, pc | r1 = 0x31874;
0x00018c14 blx r5 | uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00018c16 ldrb r7, [r4, 0x10] | r7 = *((r4 + 0x10));
0x00018c18 b 0x18bce | goto label_0;
| label_10:
0x00018c1a ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00018c1c ldr.w sl, [r2, r3, lsl 2] | offset_1 = r3 << 2;
| sl = *((r2 + offset_1));
| label_9:
0x00018c20 ldr r2, [pc, 0x3c] |
0x00018c22 adds r3, 1 | r3++;
0x00018c24 str.w sl, [r8] | __asm ("str.w sl, [r8]");
0x00018c28 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00018c2a add r2, pc | r2 = 0x3188e;
0x00018c2c str r2, [r4, 0x20] | *((r4 + 0x20)) = r2;
0x00018c2e b 0x18b74 | goto label_1;
| label_5:
0x00018c30 ldr r3, [pc, 0x30] |
0x00018c32 adds r2, 1 | r2++;
0x00018c34 movw r0, 0x117e |
0x00018c38 ldrb r7, [r4, 0x10] | r7 = *((r4 + 0x10));
0x00018c3a movt r0, 1 | r0 = 0x1117e;
0x00018c3e str r2, [r4, 0xc] | *((r4 + 0xc)) = r2;
0x00018c40 add r3, pc | r3 = 0x318a8;
0x00018c42 str r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
0x00018c44 b 0x18b8c | goto label_2;
| label_11:
0x00018c46 movw r0, 0x117d |
0x00018c4a movt r0, 1 | r0 = 0x1117d;
0x00018c4e b 0x18b8c | goto label_2;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x18c68 */
| #include <stdint.h>
|
; (fcn) sym.apr_getopt_long () | void apr_getopt_long (int16_t arg_0h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_8h;
| int16_t var_ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00018c68 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00018c6c mov r6, r0 | r6 = r0;
0x00018c6e ldr r0, [r0, 0x14] | r0 = *(arg_0hx14);
0x00018c70 sub sp, 0x14 |
0x00018c72 mov r4, r1 | r4 = r1;
0x00018c74 mov r8, r2 | r8 = r2;
0x00018c76 mov sb, r3 | sb = r3;
0x00018c78 cmp r0, 0 |
| if (r0 == 0) {
0x00018c7a beq 0x18d06 | goto label_6;
| }
0x00018c7c ldr r3, [pc, 0x270] |
0x00018c7e movs r1, 1 | r1 = 1;
0x00018c80 str r1, [r6, 0xc] | *((r6 + 0xc)) = r1;
0x00018c82 add r3, pc | r3 = 0x31b76;
0x00018c84 str r3, [r6, 0x20] | *((r6 + 0x20)) = r3;
0x00018c86 movs r3, 0 | r3 = 0;
0x00018c88 str r3, [r6, 0x14] | *((r6 + 0x14)) = r3;
| label_5:
0x00018c8a ldr r3, [r6, 0x24] | r3 = *((r6 + 0x24));
0x00018c8c ldr r0, [r6, 0x18] | r0 = *((r6 + 0x18));
| if (r3 == 0) {
0x00018c8e cbz r3, 0x18cb8 | goto label_7;
| }
0x00018c90 cmp r1, r0 |
| if (r1 >= r0) {
0x00018c92 bge.w 0x18e1e | goto label_8;
| }
0x00018c96 ldr r3, [r6, 0x1c] | r3 = *((r6 + 0x1c));
0x00018c98 add.w r3, r3, r1, lsl 2 | r3 += (r1 << 2);
0x00018c9c b 0x18ca8 |
| while (r2 != 0x2d) {
0x00018c9e adds r1, 1 | r1++;
0x00018ca0 cmp r1, r0 |
0x00018ca2 str r1, [r6, 0xc] | *((r6 + 0xc)) = r1;
| if (r1 == r0) {
0x00018ca4 beq.w 0x18e1e | goto label_8;
| }
0x00018ca8 ldr r2, [r3], 4 | r2 = *(r3);
| r3 += 4;
0x00018cac ldrb r2, [r2] | r2 = *(r2);
0x00018cae cmp r2, 0x2d |
0x00018cb0 bne 0x18c9e |
| }
0x00018cb2 mov r3, r1 | r3 = r1;
0x00018cb4 ldr r1, [r6, 0xc] | r1 = *((r6 + 0xc));
| label_2:
0x00018cb6 str r3, [r6, 0x2c] | *((r6 + 0x2c)) = r3;
| label_7:
0x00018cb8 cmp r1, r0 |
| if (r1 >= r0) {
0x00018cba bge 0x18d58 | goto label_9;
| }
0x00018cbc ldr.w fp, [r6, 0x1c] | fp = *((r6 + 0x1c));
0x00018cc0 ldr.w r5, [fp, r1, lsl 2] | offset_0 = r1 << 2;
| r5 = *((fp + offset_0));
0x00018cc4 ldrb r3, [r5] | r3 = *(r5);
0x00018cc6 cmp r3, 0x2d |
| if (r3 != 0x2d) {
0x00018cc8 bne 0x18d58 | goto label_9;
| }
0x00018cca adds r1, 1 | r1++;
0x00018ccc add.w sl, r5, 1 | sl = r5 + 1;
0x00018cd0 str r1, [r6, 0xc] | *((r6 + 0xc)) = r1;
0x00018cd2 ldrb r7, [r5, 1] | r7 = *((r5 + 1));
0x00018cd4 cmp r7, 0x2d |
| if (r7 == 0x2d) {
0x00018cd6 beq 0x18db0 | goto label_10;
| }
| if (r7 == 0) {
0x00018cd8 cbnz r7, 0x18d14 |
0x00018cda ldr r4, [r6, 4] | r4 = *((r6 + 4));
0x00018cdc cmp r4, 0 |
| if (r4 == 0) {
0x00018cde beq 0x18d8a | goto label_0;
| }
0x00018ce0 ldr.w r0, [fp] | r0 = *(fp);
0x00018ce4 ldr r5, [r6, 8] | r5 = *((r6 + 8));
0x00018ce6 blx 0x9e38 | fcn_00009e38 ();
0x00018cea ldr r3, [pc, 0x208] |
0x00018cec mov r2, r0 | r2 = r0;
0x00018cee ldr r1, [pc, 0x208] |
0x00018cf0 mov r0, r5 | r0 = r5;
0x00018cf2 str.w sl, [sp] | __asm ("str.w sl, [sp]");
0x00018cf6 add r3, pc | r3 = 0x31bf0;
0x00018cf8 add r1, pc | r1 = 0x31bf6;
0x00018cfa blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00018cfc movw r3, 0x117c |
0x00018d00 movt r3, 1 | r3 = 0x1117c;
0x00018d04 b 0x18d64 | goto label_1;
| label_6:
0x00018d06 ldr.w sl, [r6, 0x20] | sl = *((r6 + 0x20));
0x00018d0a ldrb.w r7, [sl] | r7 = *(sl);
0x00018d0e cmp r7, 0 |
| if (r7 == 0) {
0x00018d10 beq.w 0x18eea | goto label_11;
| }
| }
0x00018d14 ldr r5, [r4, 4] | r5 = *((r4 + 4));
0x00018d16 mov r1, r4 | r1 = r4;
| if (r5 != 0) {
0x00018d18 cbnz r5, 0x18d22 | goto label_12;
| }
0x00018d1a b 0x18d6c | goto label_13;
| do {
0x00018d1c ldr r5, [r1, 0x14] | r5 = *((r1 + 0x14));
0x00018d1e adds r1, 0x10 | r1 += 0x10;
| if (r5 == 0) {
0x00018d20 cbz r5, 0x18d6c | goto label_13;
| }
| label_12:
0x00018d22 cmp r7, r5 |
0x00018d24 bne 0x18d1c |
| } while (r7 != r5);
0x00018d26 str.w r7, [r8] | __asm ("str.w r7, [r8]");
0x00018d2a add.w r2, sl, 1 | r2 = sl + 1;
0x00018d2e ldr r3, [r1, 8] | r3 = *((r1 + 8));
0x00018d30 cmp r3, 0 |
| if (r3 != 0) {
0x00018d32 beq 0x18d9a |
0x00018d34 ldrb.w r3, [sl, 1] | r3 = *((sl + 1));
| if (r3 == 0) {
0x00018d38 cbnz r3, 0x18d4c |
0x00018d3a ldr r3, [r6, 0xc] | r3 = *((r6 + 0xc));
0x00018d3c ldr r2, [r6, 0x18] | r2 = *((r6 + 0x18));
0x00018d3e cmp r3, r2 |
| if (r3 >= r2) {
0x00018d40 bge 0x18e36 | goto label_14;
| }
0x00018d42 ldr r2, [r6, 0x1c] | r2 = *((r6 + 0x1c));
0x00018d44 adds r1, r3, 1 | r1 = r3 + 1;
0x00018d46 str r1, [r6, 0xc] | *((r6 + 0xc)) = r1;
0x00018d48 ldr.w r2, [r2, r3, lsl 2] | offset_1 = r3 << 2;
| r2 = *((r2 + offset_1));
| }
0x00018d4c ldr r3, [pc, 0x1ac] |
0x00018d4e str.w r2, [sb] | __asm ("str.w r2, [sb]");
0x00018d52 add r3, pc | r3 = 0x31c52;
0x00018d54 str r3, [r6, 0x20] | *((r6 + 0x20)) = r3;
0x00018d56 b 0x18da0 | goto label_3;
| label_9:
0x00018d58 ldr r2, [r6, 0x28] | r2 = *((r6 + 0x28));
0x00018d5a movw r3, 0x117e |
0x00018d5e movt r3, 1 | r3 = 0x1117e;
0x00018d62 str r2, [r6, 0xc] | *((r6 + 0xc)) = r2;
| label_1:
0x00018d64 mov r0, r3 | r0 = r3;
0x00018d66 add sp, 0x14 |
0x00018d68 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_13:
0x00018d6c ldr r4, [r6, 4] | r4 = *((r6 + 4));
| if (r4 != 0) {
0x00018d6e cbz r4, 0x18d8a |
0x00018d70 ldr r3, [r6, 0x1c] | r3 = *((r6 + 0x1c));
0x00018d72 ldr r5, [r6, 8] | r5 = *((r6 + 8));
0x00018d74 ldr r0, [r3] | r0 = *(r3);
0x00018d76 blx 0x9e38 | fcn_00009e38 ();
0x00018d7a ldr r3, [pc, 0x184] |
0x00018d7c mov r2, r0 | r2 = r0;
0x00018d7e ldr r1, [pc, 0x184] |
0x00018d80 mov r0, r5 | r0 = r5;
0x00018d82 str r7, [sp] | *(sp) = r7;
0x00018d84 add r3, pc | r3 = 0x31c8a;
0x00018d86 add r1, pc | r1 = 0x31c90;
0x00018d88 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
| }
| label_0:
0x00018d8a movw r3, 0x117c |
0x00018d8e movt r3, 1 | r3 = 0x1117c;
0x00018d92 mov r0, r3 | r0 = r3;
0x00018d94 add sp, 0x14 |
0x00018d96 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x00018d9a str.w r3, [sb] | __asm ("str.w r3, [sb]");
0x00018d9e str r2, [r6, 0x20] | *((r6 + 0x20)) = r2;
| label_3:
0x00018da0 mov r0, r6 | r0 = r6;
0x00018da2 bl 0x189d0 | fcn_000189d0 (r0);
0x00018da6 movs r3, 0 | r3 = 0;
0x00018da8 mov r0, r3 | r0 = r3;
0x00018daa add sp, 0x14 |
0x00018dac pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x00018db0 ldrb r3, [r5, 2] | r3 = *((r5 + 2));
0x00018db2 cmp r3, 0 |
| if (r3 == 0) {
0x00018db4 beq 0x18e22 | goto label_15;
| }
0x00018db6 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00018db8 add.w sl, r5, 2 | sl = r5 + 2;
| if (r3 == 0) {
0x00018dbc cbz r3, 0x18df4 | goto label_16;
| }
| do {
0x00018dbe ldr r1, [r4] | r1 = *(r4);
0x00018dc0 str r3, [sp, 0xc] | var_ch = r3;
0x00018dc2 mov r0, r1 | r0 = r1;
0x00018dc4 str r1, [sp, 8] | var_8h = r1;
| if (r1 != 0) {
0x00018dc6 cbz r1, 0x18dec |
0x00018dc8 blx 0xa40c | fcn_0000a40c ();
0x00018dcc ldr r1, [sp, 8] | r1 = var_8h;
0x00018dce mov r7, r0 | r7 = r0;
0x00018dd0 mov r2, r0 | r2 = r0;
0x00018dd2 mov r0, sl | r0 = sl;
0x00018dd4 blx 0xac10 | fcn_0000ac10 ();
0x00018dd8 add.w r1, sl, r7 | r1 = sl + r7;
| if (r0 != 0) {
0x00018ddc cbnz r0, 0x18dec | goto label_17;
| }
0x00018dde ldrb.w r2, [sl, r7] | r2 = *((sl + r7));
0x00018de2 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00018de4 cmp r2, 0x3d |
0x00018de6 it ne |
| if (r2 != 0x3d) {
0x00018de8 cmpne r2, 0 | __asm ("cmpne r2, 0");
| }
| if (r2 == 0x3d) {
0x00018dea beq 0x18e5e | goto label_18;
| }
| }
| label_17:
0x00018dec ldr r3, [r4, 0x14] | r3 = *((r4 + 0x14));
0x00018dee adds r4, 0x10 | r4 += 0x10;
0x00018df0 cmp r3, 0 |
0x00018df2 bne 0x18dbe |
| } while (r3 != 0);
| label_16:
0x00018df4 ldr r4, [r6, 4] | r4 = *((r6 + 4));
0x00018df6 cmp r4, 0 |
| if (r4 == 0) {
0x00018df8 beq 0x18d8a | goto label_0;
| }
0x00018dfa ldr.w r0, [fp] | r0 = *(fp);
0x00018dfe ldr r6, [r6, 8] | r6 = *((r6 + 8));
0x00018e00 blx 0x9e38 | fcn_00009e38 ();
0x00018e04 ldr r3, [pc, 0x100] |
0x00018e06 mov r2, r0 | r2 = r0;
0x00018e08 ldr r1, [pc, 0x100] |
0x00018e0a mov r0, r6 | r0 = r6;
0x00018e0c str r5, [sp] | *(sp) = r5;
0x00018e0e add r3, pc | r3 = 0x31d1a;
0x00018e10 add r1, pc | r1 = 0x31d20;
0x00018e12 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00018e14 movw r3, 0x117c |
0x00018e18 movt r3, 1 | r3 = 0x1117c;
0x00018e1c b 0x18d64 | goto label_1;
| label_8:
0x00018e1e mov r3, r1 | r3 = r1;
0x00018e20 b 0x18cb6 | goto label_2;
| label_15:
0x00018e22 mov r0, r6 | r0 = r6;
0x00018e24 bl 0x189d0 | fcn_000189d0 (r0);
0x00018e28 ldr r2, [r6, 0x28] | r2 = *((r6 + 0x28));
0x00018e2a movw r3, 0x117e |
0x00018e2e movt r3, 1 | r3 = 0x1117e;
0x00018e32 str r2, [r6, 0xc] | *((r6 + 0xc)) = r2;
0x00018e34 b 0x18d64 | goto label_1;
| label_14:
0x00018e36 ldr r4, [r6, 4] | r4 = *((r6 + 4));
| if (r4 != 0) {
0x00018e38 cbz r4, 0x18e54 |
0x00018e3a ldr r3, [r6, 0x1c] | r3 = *((r6 + 0x1c));
0x00018e3c ldr r5, [r6, 8] | r5 = *((r6 + 8));
0x00018e3e ldr r0, [r3] | r0 = *(r3);
0x00018e40 blx 0x9e38 | fcn_00009e38 ();
0x00018e44 ldr r3, [pc, 0xc8] |
0x00018e46 mov r2, r0 | r2 = r0;
0x00018e48 ldr r1, [pc, 0xc8] |
0x00018e4a mov r0, r5 | r0 = r5;
0x00018e4c str r7, [sp] | *(sp) = r7;
0x00018e4e add r3, pc | r3 = 0x31d62;
0x00018e50 add r1, pc | r1 = 0x31d68;
0x00018e52 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
| }
| label_4:
0x00018e54 movw r3, 0x117d |
0x00018e58 movt r3, 1 | r3 = 0x1117d;
0x00018e5c b 0x18d64 | goto label_1;
| label_18:
0x00018e5e str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x00018e62 ldr r3, [r4, 8] | r3 = *((r4 + 8));
| if (r3 == 0) {
0x00018e64 cbz r3, 0x18e8c | goto label_19;
| }
0x00018e66 ldrb r3, [r1] | r3 = *(r1);
0x00018e68 cmp r3, 0x3d |
0x00018e6a ittt eq |
| if (r3 != 0x3d) {
0x00018e6c addeq r7, 1 | r7++;
| }
| if (r3 != 0x3d) {
0x00018e6e addeq r7, sl | r7 += sl;
| }
| if (r3 == 0x3d) {
0x00018e70 streq r7, [sb] | *(sb) = r7;
| goto label_20;
| }
| if (r3 == 0x3d) {
| label_20:
0x00018e74 beq 0x18da0 | goto label_3;
| }
0x00018e76 ldr r3, [r6, 0xc] | r3 = *((r6 + 0xc));
0x00018e78 ldr r2, [r6, 0x18] | r2 = *((r6 + 0x18));
0x00018e7a cmp r3, r2 |
| if (r3 >= r2) {
0x00018e7c bge 0x18ec0 | goto label_21;
| }
0x00018e7e ldr.w r2, [fp, r3, lsl 2] | offset_2 = r3 << 2;
| r2 = *((fp + offset_2));
0x00018e82 adds r3, 1 | r3++;
0x00018e84 str r3, [r6, 0xc] | *((r6 + 0xc)) = r3;
0x00018e86 str.w r2, [sb] | __asm ("str.w r2, [sb]");
0x00018e8a b 0x18da0 | goto label_3;
| label_19:
0x00018e8c str.w r3, [sb] | __asm ("str.w r3, [sb]");
0x00018e90 ldrb r3, [r1] | r3 = *(r1);
0x00018e92 cmp r3, 0x3d |
| if (r3 != 0x3d) {
0x00018e94 bne 0x18da0 | goto label_3;
| }
0x00018e96 ldr r4, [r6, 4] | r4 = *((r6 + 4));
0x00018e98 cmp r4, 0 |
| if (r4 == 0) {
0x00018e9a beq 0x18e54 | goto label_4;
| }
0x00018e9c ldr.w r0, [fp] | r0 = *(fp);
0x00018ea0 ldr r6, [r6, 8] | r6 = *((r6 + 8));
0x00018ea2 blx 0x9e38 | fcn_00009e38 ();
0x00018ea6 ldr r3, [pc, 0x70] |
0x00018ea8 mov r2, r0 | r2 = r0;
0x00018eaa ldr r1, [pc, 0x70] |
0x00018eac mov r0, r6 | r0 = r6;
0x00018eae str r5, [sp] | *(sp) = r5;
0x00018eb0 add r3, pc | r3 = 0x31dce;
0x00018eb2 add r1, pc | r1 = 0x31dd4;
0x00018eb4 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00018eb6 movw r3, 0x117d |
0x00018eba movt r3, 1 | r3 = 0x1117d;
0x00018ebe b 0x18d64 | goto label_1;
| label_21:
0x00018ec0 ldr r4, [r6, 4] | r4 = *((r6 + 4));
0x00018ec2 cmp r4, 0 |
| if (r4 == 0) {
0x00018ec4 beq 0x18e54 | goto label_4;
| }
0x00018ec6 ldr.w r0, [fp] | r0 = *(fp);
0x00018eca ldr r6, [r6, 8] | r6 = *((r6 + 8));
0x00018ecc blx 0x9e38 | fcn_00009e38 ();
0x00018ed0 ldr r3, [pc, 0x4c] |
0x00018ed2 mov r2, r0 | r2 = r0;
0x00018ed4 ldr r1, [pc, 0x4c] |
0x00018ed6 mov r0, r6 | r0 = r6;
0x00018ed8 str r5, [sp] | *(sp) = r5;
0x00018eda add r3, pc | r3 = 0x31dfe;
0x00018edc add r1, pc | r1 = 0x31e04;
0x00018ede blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00018ee0 movw r3, 0x117d |
0x00018ee4 movt r3, 1 | r3 = 0x1117d;
0x00018ee8 b 0x18d64 | goto label_1;
| label_11:
0x00018eea ldr r1, [r6, 0xc] | r1 = *((r6 + 0xc));
0x00018eec b 0x18c8a | goto label_5;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x11530 */
| #include <stdint.h>
|
; (fcn) sym.apr_hash_copy () | void apr_hash_copy (int16_t arg1, int16_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x00011530 ldrd r3, r2, [r1, 0x18] | __asm ("ldrd r3, r2, [r1, 0x18]");
0x00011534 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00011538 mov r4, r1 | r4 = r1;
0x0001153a mov r5, r0 | r5 = r0;
0x0001153c adds r2, 0xc | r2 += 0xc;
0x0001153e add.w r3, r3, r3, lsl 2 | r3 += (r3 << 2);
0x00011542 adds r1, r3, r2 | r1 = r3 + r2;
0x00011544 lsls r1, r1, 2 | r1 <<= 2;
0x00011546 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001154a movs r3, 0 | r3 = 0;
0x0001154c ldrd r2, r1, [r4, 0x18] | __asm ("ldrd r2, r1, [r4, 0x18]");
0x00011550 mov ip, r3 |
0x00011552 str r3, [r0, 0x28] | *((r0 + 0x28)) = r3;
0x00011554 ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x00011556 add.w r7, r0, 0x2c | r7 = r0 + 0x2c;
0x0001155a strd r2, r1, [r0, 0x18] | __asm ("strd r2, r1, [r0, 0x18]");
0x0001155e mov sl, ip | sl = ip;
0x00011560 str r5, [r0] | *(r0) = r5;
0x00011562 str r3, [r0, 0x20] | *((r0 + 0x20)) = r3;
0x00011564 ldr r3, [r4, 0x24] | r3 = *((r4 + 0x24));
0x00011566 str r7, [r0, 4] | *((r0 + 4)) = r7;
0x00011568 ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x0001156a str r3, [r0, 0x24] | *((r0 + 0x24)) = r3;
0x0001156c ldr r3, [r4, 0x1c] | r3 = *((r4 + 0x1c));
0x0001156e sub.w lr, r2, 4 | lr = r2 - 4;
0x00011572 add.w sb, r2, r1, lsl 2 | sb = r2 + (r1 << 2);
0x00011576 add.w r8, r3, 0xc | r8 = r3 + 0xc;
0x0001157a lsl.w r8, r8, 2 | r8 <<= 2;
| label_0:
0x0001157e ldr r3, [lr, 4]! | r3 = *((lr += 4));
0x00011582 mov r1, r7 | r1 = r7;
| if (r3 == 0) {
0x00011584 cbz r3, 0x115b6 | goto label_1;
| }
0x00011586 add.w r2, ip, ip, lsl 2 | r2 = ip + (ip << 2);
0x0001158a add.w r2, r8, r2, lsl 2 | r2 = r8 + (r2 << 2);
0x0001158e add r2, r0 | r2 += r0;
| do {
0x00011590 str r2, [r1] | *(r1) = r2;
0x00011592 add.w ip, ip, 1 |
0x00011596 ldrd r4, r6, [r3, 4] | __asm ("ldrd r4, r6, [r3, 4]");
0x0001159a adds r2, 0x14 | r2 += 0x14;
0x0001159c str r4, [r2, -0x10] | *((r2 - 0x10)) = r4;
0x000115a0 ldr r5, [r3, 0xc] | r5 = *((r3 + 0xc));
0x000115a2 str r6, [r2, -0xc] | *((r2 - 0xc)) = r6;
0x000115a6 ldr r6, [r3, 0x10] | r6 = *((r3 + 0x10));
0x000115a8 ldr r3, [r3] | r3 = *(r3);
0x000115aa ldr r4, [r1] | r4 = *(r1);
0x000115ac strd r5, r6, [r4, 0xc] | __asm ("strd r5, r6, [r4, 0xc]");
0x000115b0 ldr r1, [r1] | r1 = *(r1);
0x000115b2 cmp r3, 0 |
0x000115b4 bne 0x11590 |
| } while (r3 != 0);
| label_1:
0x000115b6 cmp lr, sb |
0x000115b8 add.w r7, r7, 4 | r7 += 4;
0x000115bc str.w sl, [r1] | __asm ("str.w sl, [r1]");
| if (lr != sb) {
0x000115c0 bne 0x1157e | goto label_0;
| }
0x000115c2 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x11678 */
| #include <stdint.h>
|
; (fcn) sym.apr_hash_merge () | void apr_hash_merge (int16_t arg_48h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00011678 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001167c sub sp, 0x24 |
0x0001167e mov r4, r2 | r4 = r2;
0x00011680 mov r6, r1 | r6 = r1;
0x00011682 mov r5, r0 | r5 = r0;
0x00011684 str r1, [sp, 0x14] | var_14h = r1;
0x00011686 movs r1, 0x2c | r1 = 0x2c;
0x00011688 strd r3, r0, [sp, 0x18] | __asm ("strd r3, r0, [var_1ch]");
0x0001168c blx 0xa0d0 | fcn_0000a0d0 ();
0x00011690 ldr r2, [r4, 0x18] | r2 = *((r4 + 0x18));
0x00011692 mov r8, r0 | r8 = r0;
0x00011694 ldr r3, [r4, 0x24] | r3 = *((r4 + 0x24));
0x00011696 str r5, [r0] | *(r0) = r5;
0x00011698 str r2, [r0, 0x18] | *((r0 + 0x18)) = r2;
0x0001169a str r3, [r0, 0x24] | *((r0 + 0x24)) = r3;
0x0001169c ldr r2, [r6, 0x1c] | r2 = *((r6 + 0x1c));
0x0001169e ldr r3, [r4, 0x1c] | r3 = *((r4 + 0x1c));
0x000116a0 ldr r1, [r6, 0x18] | r1 = *((r6 + 0x18));
0x000116a2 cmp r3, r2 |
0x000116a4 it lo |
| if (r3 >= r2) {
0x000116a6 movlo r3, r2 | r3 = r2;
| }
0x000116a8 ldr r2, [r4, 0x18] | r2 = *((r4 + 0x18));
0x000116aa str r3, [r0, 0x1c] | *((r0 + 0x1c)) = r3;
0x000116ac add r2, r1 | r2 += r1;
0x000116ae movs r1, 0 | r1 = 0;
0x000116b0 cmp r3, r2 |
0x000116b2 str r1, [r0, 0x28] | *((r0 + 0x28)) = r1;
0x000116b4 ittt lo |
| if (r3 >= r2) {
0x000116b6 lsllo r3, r3, 1 | r3 <<= 1;
| }
| if (r3 >= r2) {
0x000116b8 addlo r3, 1 | r3++;
| }
| if (r3 >= r2) {
0x000116ba strlo r3, [r0, 0x1c] | *((r0 + 0x1c)) = r3;
| }
0x000116bc adds r3, 1 | r3++;
0x000116be lsls r5, r3, 2 | r5 = r3 << 2;
0x000116c0 ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x000116c2 mov r1, r5 | r1 = r5;
0x000116c4 str r3, [r0, 0x20] | *((r0 + 0x20)) = r3;
0x000116c6 ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x000116c8 blx 0xa0d0 | fcn_0000a0d0 ();
0x000116cc mov r2, r5 | r2 = r5;
0x000116ce movs r1, 0 | r1 = 0;
0x000116d0 blx 0xa600 | fcn_0000a600 ();
0x000116d4 ldr r2, [sp, 0x14] | r2 = var_14h;
0x000116d6 ldr r3, [r4, 0x18] | r3 = *((r4 + 0x18));
0x000116d8 str.w r0, [r8, 4] | __asm ("str.w r0, [r8, 4]");
0x000116dc ldr r2, [r2, 0x18] | r2 = *((r2 + 0x18));
0x000116de adds.w fp, r3, r2 |
0x000116e2 it eq |
| if (fp != r3) {
0x000116e4 streq fp, [sp, 0x10] | var_10h = fp;
| }
| if (fp != r3) {
0x000116e8 bne.w 0x1185a | goto label_7;
| }
| label_6:
0x000116ec ldr r6, [r4, 4] | r6 = *((r4 + 4));
0x000116ee mov.w sb, 0 | sb = 0;
0x000116f2 ldr r7, [r4, 0x1c] | r7 = *((r4 + 0x1c));
0x000116f4 ldr.w ip, [sp, 0x10] | ip = var_10h;
0x000116f8 add.w r7, r6, r7, lsl 2 | r7 = r6 + (r7 << 2);
0x000116fc subs r6, 4 | r6 -= 4;
| label_0:
0x000116fe ldr r2, [r6, 4]! | r2 = *((r6 += 4));
| if (r2 == 0) {
0x00011702 cbz r2, 0x11740 | goto label_8;
| }
0x00011704 add.w r3, sb, sb, lsl 2 | r3 = sb + (sb << 2);
0x00011708 ldr.w r5, [r8, 0x1c] | r5 = *((r8 + 0x1c));
0x0001170c ldr.w r0, [r8, 4] | r0 = *((r8 + 4));
0x00011710 mov lr, r6 | lr = r6;
0x00011712 add.w r3, ip, r3, lsl 2 | r3 = ip + (r3 << 2);
| do {
0x00011716 ldrd r6, r4, [r2, 8] | __asm ("ldrd r6, r4, [r2, 8]");
0x0001171a add.w sb, sb, 1 | sb++;
0x0001171e ldr r1, [r2, 4] | r1 = *((r2 + 4));
0x00011720 strd r6, r4, [r3, 8] | __asm ("strd r6, r4, [r3, 8]");
0x00011724 ldr r4, [r2, 0x10] | r4 = *((r2 + 0x10));
0x00011726 str r1, [r3, 4] | *((r3 + 4)) = r1;
0x00011728 ands r1, r5 | r1 &= r5;
0x0001172a str r4, [r3, 0x10] | *((r3 + 0x10)) = r4;
0x0001172c ldr.w r4, [r0, r1, lsl 2] | offset_0 = r1 << 2;
| r4 = *((r0 + offset_0));
0x00011730 str r4, [r3] | *(r3) = r4;
0x00011732 str.w r3, [r0, r1, lsl 2] | __asm ("str.w r3, [r0, r1, lsl 2]");
0x00011736 adds r3, 0x14 | r3 += 0x14;
0x00011738 ldr r2, [r2] | r2 = *(r2);
0x0001173a cmp r2, 0 |
0x0001173c bne 0x11716 |
| } while (r2 != 0);
0x0001173e mov r6, lr | r6 = lr;
| label_8:
0x00011740 cmp r7, r6 |
| if (r7 != r6) {
0x00011742 bne 0x116fe | goto label_0;
| }
0x00011744 movs r3, 0 | r3 = 0;
0x00011746 strd sb, r3, [sp, 8] | __asm ("strd sb, r3, [var_ch]");
| label_3:
0x0001174a ldr r3, [sp, 0x14] | r3 = var_14h;
0x0001174c ldr r2, [sp, 0xc] | r2 = var_ch;
0x0001174e ldr r3, [r3, 4] | r3 = *((r3 + 4));
0x00011750 ldr.w r6, [r3, r2, lsl 2] | offset_1 = r2 << 2;
| r6 = *((r3 + offset_1));
0x00011754 cmp r6, 0 |
| if (r6 == 0) {
0x00011756 beq 0x117bc | goto label_9;
| }
| label_2:
0x00011758 ldr.w r3, [r8, 0x24] | r3 = *((r8 + 0x24));
0x0001175c ldr.w sl, [r6, 8] | sl = *((r6 + 8));
0x00011760 cmp r3, 0 |
| if (r3 == 0) {
0x00011762 beq 0x11808 | goto label_10;
| }
0x00011764 mov r0, sl | r0 = sl;
0x00011766 add.w r1, r6, 0xc | r1 = r6 + 0xc;
0x0001176a blx r3 | uint32_t (*r3)(uint32_t, uint32_t) (r0, r1);
0x0001176c ldrd sl, fp, [r6, 8] | __asm ("ldrd sl, fp, [r6, 8]");
0x00011770 mov r5, r0 | r5 = r0;
| label_5:
0x00011772 ldr.w r7, [r8, 0x1c] | r7 = *((r8 + 0x1c));
0x00011776 ldr.w sb, [r8, 4] | sb = *((r8 + 4));
0x0001177a ands r7, r5 | r7 &= r5;
0x0001177c ldr.w r4, [sb, r7, lsl 2] | offset_2 = r7 << 2;
| r4 = *((sb + offset_2));
| if (r4 != 0) {
0x00011780 cbnz r4, 0x11788 | goto label_11;
| }
0x00011782 b 0x117d2 | goto label_12;
| do {
| label_1:
0x00011784 ldr r4, [r4] | r4 = *(r4);
| if (r4 == 0) {
0x00011786 cbz r4, 0x117d2 | goto label_12;
| }
| label_11:
0x00011788 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x0001178a cmp r3, fp |
0x0001178c bne 0x11784 |
| } while (r3 != fp);
0x0001178e ldr r0, [r4, 8] | r0 = *((r4 + 8));
0x00011790 mov r2, fp | r2 = fp;
0x00011792 mov r1, sl | r1 = sl;
0x00011794 blx 0x9dc4 | r0 = fcn_00009dc4 ();
0x00011798 cmp r0, 0 |
| if (r0 != 0) {
0x0001179a bne 0x11784 | goto label_1;
| }
0x0001179c ldr r5, [sp, 0x18] | r5 = var_18h;
0x0001179e ldr r3, [r6, 0x10] | r3 = *((r6 + 0x10));
0x000117a0 cmp r5, 0 |
| if (r5 == 0) {
0x000117a2 beq 0x11832 | goto label_13;
| }
0x000117a4 ldr r2, [sp, 0x48] | r2 = *(arg_48h);
0x000117a6 mov r1, sl | r1 = sl;
0x000117a8 str r2, [sp, 4] | var_4h = r2;
0x000117aa mov r2, fp | r2 = fp;
0x000117ac ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000117ae str r0, [sp] | *(sp) = r0;
0x000117b0 ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x000117b2 blx r5 | uint32_t (*r5)(uint32_t, uint32_t, uint32_t) (r0, r1, r2);
0x000117b4 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| label_4:
0x000117b6 ldr r6, [r6] | r6 = *(r6);
0x000117b8 cmp r6, 0 |
| if (r6 != 0) {
0x000117ba bne 0x11758 | goto label_2;
| }
| label_9:
0x000117bc ldr r3, [sp, 0x14] | r3 = var_14h;
0x000117be ldr r2, [sp, 0xc] | r2 = var_ch;
0x000117c0 ldr r3, [r3, 0x1c] | r3 = *((r3 + 0x1c));
0x000117c2 adds r2, 1 | r2++;
0x000117c4 str r2, [sp, 0xc] | var_ch = r2;
0x000117c6 cmp r3, r2 |
| if (r3 >= r2) {
0x000117c8 bhs 0x1174a | goto label_3;
| }
0x000117ca mov r0, r8 | r0 = r8;
0x000117cc add sp, 0x24 |
0x000117ce pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_12:
0x000117d2 ldr r2, [sp, 8] | r2 = var_8h;
0x000117d4 ldr r1, [sp, 0x10] | r1 = var_10h;
0x000117d6 ldr.w r3, [r8, 0x18] | r3 = *((r8 + 0x18));
0x000117da ldr r4, [r6, 0x10] | r4 = *((r6 + 0x10));
0x000117dc add.w r0, r2, r2, lsl 2 | r0 = r2 + (r2 << 2);
0x000117e0 adds r2, 1 | r2++;
0x000117e2 add.w ip, r3, 1 |
0x000117e6 str r2, [sp, 8] | var_8h = r2;
0x000117e8 add.w r3, r1, r0, lsl 2 | r3 = r1 + (r0 << 2);
0x000117ec str.w sl, [r3, 8] | __asm ("str.w sl, [r3, 8]");
0x000117f0 strd fp, r4, [r3, 0xc] | __asm ("strd fp, r4, [r3, 0xc]");
0x000117f4 ldr.w r2, [sb, r7, lsl 2] | offset_3 = r7 << 2;
| r2 = *((sb + offset_3));
0x000117f8 str r5, [r3, 4] | *((r3 + 4)) = r5;
0x000117fa str.w r2, [r1, r0, lsl 2] | __asm ("str.w r2, [r1, r0, lsl 2]");
0x000117fe str.w r3, [sb, r7, lsl 2] | __asm ("str.w r3, [sb, r7, lsl 2]");
0x00011802 str.w ip, [r8, 0x18] | __asm ("str.w ip, [r8, 0x18]");
0x00011806 b 0x117b6 | goto label_4;
| label_10:
0x00011808 ldr.w fp, [r6, 0xc] | fp = *((r6 + 0xc));
0x0001180c ldr.w r5, [r8, 0x20] | r5 = *((r8 + 0x20));
0x00011810 cmp.w fp, -1 |
| if (fp == -1) {
0x00011814 beq 0x11836 | goto label_14;
| }
0x00011816 add.w r4, sl, fp | r4 = sl + fp;
0x0001181a mov r3, sl | r3 = sl;
0x0001181c cmp.w fp, 0 |
| if (fp == 0) {
0x00011820 beq 0x11772 | goto label_5;
| }
| do {
0x00011822 ldrb r2, [r3], 1 | r2 = *(r3);
| r3++;
0x00011826 add.w r5, r5, r5, lsl 5 | r5 += (r5 << 5);
0x0001182a cmp r3, r4 |
0x0001182c add r5, r2 | r5 += r2;
0x0001182e bne 0x11822 |
| } while (r3 != r4);
0x00011830 b 0x11772 | goto label_5;
| label_13:
0x00011832 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00011834 b 0x117b6 | goto label_4;
| label_14:
0x00011836 ldrb.w r2, [sl] | r2 = *(sl);
| if (r2 == 0) {
0x0001183a cbz r2, 0x11856 | goto label_15;
| }
0x0001183c mov r3, sl | r3 = sl;
| do {
0x0001183e add.w r5, r5, r5, lsl 5 | r5 += (r5 << 5);
0x00011842 add r5, r2 | r5 += r2;
0x00011844 ldrb r2, [r3, 1]! | r2 = *((r3 += 1));
0x00011848 cmp r2, 0 |
0x0001184a bne 0x1183e |
| } while (r2 != 0);
0x0001184c sub.w fp, r3, sl |
| do {
0x00011850 str.w fp, [r6, 0xc] | __asm ("str.w fp, [r6, 0xc]");
0x00011854 b 0x11772 | goto label_5;
| label_15:
0x00011856 mov fp, r2 |
0x00011858 b 0x11850 |
| } while (1);
| label_7:
0x0001185a add.w fp, fp, fp, lsl 2 |
0x0001185e ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x00011860 lsl.w r1, fp, 2 | r1 = fp << 2;
0x00011864 blx 0xa0d0 | fcn_0000a0d0 ();
0x00011868 str r0, [sp, 0x10] | var_10h = r0;
0x0001186a b 0x116ec | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1134c */
| #include <stdint.h>
|
; (fcn) sym.apr_hash_next () | void apr_hash_next (int16_t arg1) {
| r0 = arg1;
0x0001134c mov ip, r0 |
0x0001134e ldr r0, [r0, 8] | r0 = *((r0 + 8));
0x00011350 str.w r0, [ip, 4] | __asm ("str.w r0, [ip, 4]");
| if (r0 != 0) {
0x00011354 cbnz r0, 0x1138e | goto label_0;
| }
0x00011356 ldr.w r3, [ip, 0xc] | r3 = *((ip + 0xc));
0x0001135a push {r4, r5} |
0x0001135c ldr.w r4, [ip] | r4 = *(ip);
0x00011360 lsls r2, r3, 2 | r2 = r3 << 2;
0x00011362 ldr r5, [r4, 0x1c] | r5 = *((r4 + 0x1c));
0x00011364 b 0x11376 |
| while (r5 >= r3) {
0x00011366 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00011368 str.w r3, [ip, 0xc] | __asm ("str.w r3, [ip, 0xc]");
0x0001136c ldr r1, [r1, r2] | r1 = *((r1 + r2));
0x0001136e adds r2, 4 | r2 += 4;
0x00011370 str.w r1, [ip, 4] | __asm ("str.w r1, [ip, 4]");
| if (r1 != 0) {
0x00011374 cbnz r1, 0x11382 | goto label_1;
| }
0x00011376 cmp r5, r3 |
0x00011378 add.w r3, r3, 1 | r3++;
0x0001137c bhs 0x11366 |
| }
0x0001137e pop {r4, r5} |
0x00011380 bx lr | return;
| label_1:
0x00011382 ldr r3, [r1] | r3 = *(r1);
0x00011384 mov r0, ip | r0 = ip;
0x00011386 pop {r4, r5} |
0x00011388 str.w r3, [ip, 8] | __asm ("str.w r3, [ip, 8]");
0x0001138c bx lr | return;
| label_0:
0x0001138e ldr r3, [r0] | r3 = *(r0);
0x00011390 mov r0, ip | r0 = ip;
0x00011392 str.w r3, [ip, 8] | __asm ("str.w r3, [ip, 8]");
0x00011396 bx lr | return;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x114ec */
| #include <stdint.h>
|
; (fcn) sym.apr_hashfunc_default () | void apr_hashfunc_default (int16_t arg1, int16_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x000114ec mov r3, r0 | r3 = r0;
0x000114ee ldr r0, [r1] | r0 = *(r1);
0x000114f0 adds r2, r0, 1 | r2 = r0 + 1;
| if (r2 == r0) {
0x000114f2 beq 0x1150a | goto label_0;
| }
| if (r0 == 0) {
0x000114f4 cbz r0, 0x11528 | goto label_1;
| }
0x000114f6 adds r1, r3, r0 | r1 = r3 + r0;
0x000114f8 movs r0, 0 | r0 = 0;
| do {
0x000114fa ldrb r2, [r3], 1 | r2 = *(r3);
| r3++;
0x000114fe add.w r0, r0, r0, lsl 5 | r0 += (r0 << 5);
0x00011502 cmp r3, r1 |
0x00011504 add r0, r2 | r0 += r2;
0x00011506 bne 0x114fa |
| } while (r3 != r1);
0x00011508 bx lr | return;
| label_0:
0x0001150a ldrb r2, [r3] | r2 = *(r3);
| if (r2 == 0) {
0x0001150c cbz r2, 0x1152a | goto label_2;
| }
0x0001150e mov ip, r3 |
0x00011510 movs r0, 0 | r0 = 0;
| do {
0x00011512 add.w r0, r0, r0, lsl 5 | r0 += (r0 << 5);
0x00011516 add r0, r2 | r0 += r2;
0x00011518 ldrb r2, [ip, 1]! | r2 = *((ip += 1));
0x0001151c cmp r2, 0 |
0x0001151e bne 0x11512 |
| } while (r2 != 0);
0x00011520 sub.w r2, ip, r3 | r2 = ip - r3;
| do {
0x00011524 str r2, [r1] | *(r1) = r2;
0x00011526 bx lr | return;
| label_1:
0x00011528 bx lr | return;
| label_2:
0x0001152a mov r0, r2 | r0 = r2;
0x0001152c b 0x11524 |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xef94 */
| #include <stdint.h>
|
; (fcn) sym.apr_match_glob () | void apr_match_glob (int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_64h;
| int16_t var_74h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0000ef94 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0000ef98 mov r6, r2 | r6 = r2;
0x0000ef9a ldr r2, [pc, 0xb8] |
0x0000ef9c sub sp, 0x78 |
0x0000ef9e mov r7, r1 | r7 = r1;
0x0000efa0 movs r1, 0x2f | r1 = 0x2f;
0x0000efa2 ldr r3, [pc, 0xb4] | r3 = *(0xf05a);
0x0000efa4 mov r4, r0 | r4 = r0;
0x0000efa6 add r2, pc | r2 = 0x1e000;
0x0000efa8 ldr r3, [r2, r3] |
0x0000efaa ldr r3, [r3] | r3 = *(0x1e000);
0x0000efac str r3, [sp, 0x74] | var_74h = r3;
0x0000efae mov.w r3, 0 | r3 = 0;
0x0000efb2 blx 0xa884 | r0 = fcn_0000a884 ();
0x0000efb6 cmp r0, 0 |
| if (r0 == 0) {
0x0000efb8 beq 0xf03e | goto label_3;
| }
| label_2:
0x0000efba subs r2, r0, r4 | r2 = r0 - r4;
0x0000efbc mov r1, r4 | r1 = r4;
0x0000efbe adds r4, r0, 1 | r4 = r0 + 1;
0x0000efc0 mov r0, r6 | r0 = r6;
0x0000efc2 blx 0x9ad0 | r0 = fcn_00009ad0 ();
0x0000efc6 mov r5, r0 | r5 = r0;
| label_1:
0x0000efc8 movs r2, 4 | r2 = 4;
0x0000efca movs r1, 0 | r1 = 0;
0x0000efcc mov r0, r6 | r0 = r6;
0x0000efce blx 0x99a8 | fcn_000099a8 ();
0x0000efd2 mov r1, r5 | r1 = r5;
0x0000efd4 str r0, [r7] | *(r7) = r0;
0x0000efd6 mov r2, r6 | r2 = r6;
0x0000efd8 add r0, sp, 4 | r0 += var_4h;
0x0000efda blx 0x9bb4 | fcn_00009bb4 ();
0x0000efde add r5, sp, 8 | r5 += var_8h;
0x0000efe0 mov r8, r0 | r8 = r0;
| if (r0 == 0) {
0x0000efe2 cbz r0, 0xeff0 | goto label_0;
| }
0x0000efe4 b 0xf008 | goto label_4;
| do {
0x0000efe6 ldr r1, [sp, 0x64] | r1 = var_64h;
0x0000efe8 mov r0, r4 | r0 = r4;
0x0000efea blx 0xa7c0 | r0 = fcn_0000a7c0 ();
| if (r0 == 0) {
0x0000efee cbz r0, 0xf024 | goto label_5;
| }
| label_0:
0x0000eff0 ldr r2, [sp, 4] | r2 = var_4h;
0x0000eff2 mov.w r1, 0x2000000 | r1 = 0x2000000;
0x0000eff6 mov r0, r5 | r0 = r5;
0x0000eff8 blx 0xa384 | r0 = fcn_0000a384 ();
0x0000effc mov r2, r0 | r2 = r0;
0x0000effe cmp r0, 0 |
0x0000f000 beq 0xefe6 |
| } while (r0 == 0);
0x0000f002 ldr r0, [sp, 4] | r0 = var_4h;
0x0000f004 blx 0xa830 | fcn_0000a830 ();
| label_4:
0x0000f008 ldr r2, [pc, 0x50] |
0x0000f00a ldr r3, [pc, 0x4c] | r3 = *(0xf05a);
0x0000f00c add r2, pc | r2 = 0x1e06c;
0x0000f00e ldr r3, [r2, r3] | r3 = *(0x1e06c);
0x0000f010 ldr r2, [r3] | r2 = *(0x1e06c);
0x0000f012 ldr r3, [sp, 0x74] | r3 = var_74h;
0x0000f014 eors r2, r3 | r2 ^= r3;
0x0000f016 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0000f01a bne 0xf050 | goto label_6;
| }
0x0000f01c mov r0, r8 | r0 = r8;
0x0000f01e add sp, 0x78 |
0x0000f020 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_5:
0x0000f024 ldr.w sl, [sp, 0x64] | sl = var_64h;
0x0000f028 ldr r0, [r7] | r0 = *(r7);
0x0000f02a blx 0xa764 | readdir ();
0x0000f02e mov r1, sl | r1 = sl;
0x0000f030 mov sb, r0 | sb = r0;
0x0000f032 mov r0, r6 | r0 = r6;
0x0000f034 blx 0xa41c | fcn_0000a41c ();
0x0000f038 str.w r0, [sb] | __asm ("str.w r0, [sb]");
0x0000f03c b 0xeff0 | goto label_0;
| label_3:
0x0000f03e ldr r5, [pc, 0x20] |
0x0000f040 movs r1, 0x5c | r1 = 0x5c;
0x0000f042 mov r0, r4 | r0 = r4;
0x0000f044 blx 0xa884 | fcn_0000a884 ();
0x0000f048 add r5, pc | r5 = 0x1e0ae;
0x0000f04a cmp r0, 0 |
| if (r0 == 0) {
0x0000f04c beq 0xefc8 | goto label_1;
| }
0x0000f04e b 0xefba | goto label_2;
| label_6:
0x0000f050 blx 0x9e90 | fcn_00009e90 ();
0x0000f054 cmp r1, 0xbe |
0x0000f056 movs r2, r0 | r2 = r0;
0x0000f058 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x0000f05a movs r0, r0 |
0x0000f05c cmp r1, 0x58 |
0x0000f05e movs r2, r0 | r2 = r0;
0x0000f060 asrs r0, r1, 0x14 | r0 = r1 >> 0x14;
0x0000f062 movs r1, r0 | r1 = r0;
0x0000f064 movs r0, r0 |
0x0000f066 movs r0, r0 |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x19b40 */
| #include <stdint.h>
|
; (fcn) sym.apr_mcast_loopback () | void apr_mcast_loopback (int16_t arg1, int16_t arg2) {
| int16_t var_0h;
| int16_t var_fh;
| int16_t var_10h;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x00019b40 invalid |
0x00019b44 stm r0!, {r7} | *(r0!) = r7;
0x00019b46 ldr r2, [pc, 0x80] |
0x00019b48 ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00019b4a add ip, pc |
0x00019b4c push {r4, lr} |
0x00019b4e ldr.w r2, [ip, r2] | r2 = *((ip + r2));
0x00019b52 sub sp, 0x18 |
0x00019b54 cmp r3, 2 |
0x00019b56 ldr r0, [r0, 4] | r0 = *((r0 + 4));
0x00019b58 ldr r2, [r2] | r2 = *(0x19bca);
0x00019b5a str r2, [sp, 0x14] | var_14h = r2;
0x00019b5c mov.w r2, 0 | r2 = 0;
0x00019b60 strb.w r1, [sp, 0xf] | var_fh = r1;
| if (r3 == 2) {
0x00019b64 beq 0x19b8a | goto label_2;
| }
0x00019b66 cmp r3, 0xa |
| if (r3 == 0xa) {
0x00019b68 beq 0x19ba2 | goto label_3;
| }
0x00019b6a movw r0, 0x1187 |
0x00019b6e movt r0, 1 | r0 = 0x11187;
| do {
| label_1:
0x00019b72 ldr r2, [pc, 0x58] |
0x00019b74 ldr r3, [pc, 0x50] | r3 = *(0x19bc8);
0x00019b76 add r2, pc | r2 = 0x33748;
0x00019b78 ldr r3, [r2, r3] | r3 = *(0x33748);
0x00019b7a ldr r2, [r3] | r2 = *(0x33748);
0x00019b7c ldr r3, [sp, 0x14] | r3 = var_14h;
0x00019b7e eors r2, r3 | r2 ^= r3;
0x00019b80 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x00019b84 bne 0x19bbe | goto label_4;
| }
0x00019b86 add sp, 0x18 |
0x00019b88 pop {r4, pc} |
| label_2:
0x00019b8a movs r4, 1 | r4 = 1;
0x00019b8c add.w r3, sp, 0xf | r3 += var_fh;
0x00019b90 movs r2, 0x22 | r2 = 0x22;
0x00019b92 movs r1, 0 | r1 = 0;
0x00019b94 str r4, [sp] | *(sp) = r4;
0x00019b96 blx 0x9ab8 | fcn_00009ab8 ();
0x00019b9a adds r0, 1 | r0++;
| if (r0 == 1) {
0x00019b9c beq 0x19bb6 | goto label_5;
| }
| label_0:
0x00019b9e movs r0, 0 | r0 = 0;
0x00019ba0 b 0x19b72 |
| } while (1);
| label_3:
0x00019ba2 movs r4, 4 | r4 = 4;
0x00019ba4 str r1, [sp, 0x10] | var_10h = r1;
0x00019ba6 add r3, sp, 0x10 | r3 += var_10h;
0x00019ba8 movs r2, 0x13 | r2 = 0x13;
0x00019baa movs r1, 0x29 | r1 = 0x29;
0x00019bac str r4, [sp] | *(sp) = r4;
0x00019bae blx 0x9ab8 | fcn_00009ab8 ();
0x00019bb2 adds r0, 1 | r0++;
| if (r0 != 1) {
0x00019bb4 bne 0x19b9e | goto label_0;
| }
| label_5:
0x00019bb6 blx 0xa580 | r0 = fcn_0000a580 ();
0x00019bba ldr r0, [r0] | r0 = *(r0);
0x00019bbc b 0x19b72 | goto label_1;
| label_4:
0x00019bbe blx 0x9e90 | fcn_00009e90 ();
0x00019bc2 nop |
0x00019bc4 ldrb r2, [r3, 0x18] | r2 = *((r3 + 0x18));
0x00019bc6 movs r1, r0 | r1 = r0;
0x00019bc8 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x00019bca movs r0, r0 |
0x00019bcc ldrb r6, [r5, 0x17] | r6 = *((r5 + 0x17));
0x00019bce movs r1, r0 | r1 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1c8d4 */
| #include <stdint.h>
|
; (fcn) sym.apr_poll_create_wakeup_pipe () | void apr_poll_create_wakeup_pipe (int16_t arg1, int16_t arg2, int16_t arg3) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0001c8d4 mvnsmi lr, sp, lsr 18 | __asm ("mvnsmi lr, sp, lsr 18");
0x0001c8d8 mov r4, r2 | r4 = r2;
0x0001c8da mov r7, r0 | r7 = r0;
0x0001c8dc mov r2, r0 | r2 = r0;
0x0001c8de mov r6, r1 | r6 = r1;
0x0001c8e0 mov r0, r4 | r0 = r4;
0x0001c8e2 adds r1, r4, 4 | r1 = r4 + 4;
0x0001c8e4 blx 0x9cbc | r0 = fcn_00009cbc ();
0x0001c8e8 mov r5, r0 | r5 = r0;
0x0001c8ea cbz r0, 0x1c8f2 |
| while (r0 != 1) {
0x0001c8ec mov r0, r5 | r0 = r5;
0x0001c8ee pop.w {r4, r5, r6, r7, r8, pc} |
0x0001c8f2 ldr r3, [r4] | r3 = *(r4);
0x0001c8f4 mov.w r8, 1 | r8 = 1;
0x0001c8f8 str r7, [r6] | *(r6) = r7;
0x0001c8fa movs r7, 2 | r7 = 2;
0x0001c8fc mov r1, r8 | r1 = r8;
0x0001c8fe strh.w r8, [r6, 8] | *((r6 + 8)) = r8;
0x0001c902 str r3, [r6, 0xc] | *((r6 + 0xc)) = r3;
0x0001c904 ldr r3, [r4] | r3 = *(r4);
0x0001c906 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001c908 str r7, [r6, 4] | *((r6 + 4)) = r7;
0x0001c90a blx 0xa5d8 | r0 = pthread_sigmask ();
0x0001c90e adds r2, r0, 1 | r2 = r0 + 1;
| if (r2 == r0) {
0x0001c910 beq 0x1c944 | goto label_0;
| }
0x0001c912 ldr r3, [r4] | r3 = *(r4);
0x0001c914 orr r2, r0, 1 | r2 = r0 | 1;
0x0001c918 mov r1, r7 | r1 = r7;
0x0001c91a ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001c91c blx 0xa5d8 | pthread_sigmask ();
0x0001c920 adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001c922 beq 0x1c944 | goto label_0;
| }
0x0001c924 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x0001c926 mov r1, r8 | r1 = r8;
0x0001c928 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001c92a blx 0xa5d8 | r0 = pthread_sigmask ();
0x0001c92e adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x0001c930 beq 0x1c944 | goto label_0;
| }
0x0001c932 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x0001c934 orr r2, r0, 1 | r2 = r0 | 1;
0x0001c938 mov r1, r7 | r1 = r7;
0x0001c93a ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001c93c blx 0xa5d8 | pthread_sigmask ();
0x0001c940 adds r0, 1 | r0++;
0x0001c942 bne 0x1c8ec |
| }
| label_0:
0x0001c944 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001c948 ldr r5, [r0] | r5 = *(r0);
0x0001c94a mov r0, r5 | r0 = r5;
0x0001c94c pop.w {r4, r5, r6, r7, r8, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1c1ac */
| #include <stdint.h>
|
; (fcn) sym.apr_pollcb_create_ex () | void apr_pollcb_create_ex (int16_t arg_28h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0001c1ac svcmi 0xf8e92d | __asm ("svcmi aav.0x000000ff");
0x0001c1b0 mov r4, r3 | r4 = r3;
0x0001c1b2 ldr r5, [sp, 0x28] | r5 = *(arg_28h);
0x0001c1b4 movs r3, 0 | r3 = 0;
0x0001c1b6 mov r8, r0 | r8 = r0;
0x0001c1b8 mov fp, r1 |
0x0001c1ba ldr r6, [pc, 0xac] |
0x0001c1bc mov r7, r2 | r7 = r2;
0x0001c1be str r3, [r0] | *(r0) = r3;
0x0001c1c0 add r6, pc | r6 = 0x3842e;
| if (r5 != 0) {
0x0001c1c2 cbz r5, 0x1c1cc |
0x0001c1c4 cmp r5, 5 |
| if (r5 == 5) {
0x0001c1c6 beq 0x1c1cc | goto label_2;
| }
0x0001c1c8 lsls r3, r4, 0x1b | r3 = r4 << 0x1b;
| if (r3 < r4) {
0x0001c1ca bmi 0x1c234 | goto label_3;
| }
| }
| label_2:
0x0001c1cc ldr r3, [pc, 0x9c] | r3 = *(0x1c26c);
0x0001c1ce ands sb, r4, 4 | sb = r4 & 4;
0x0001c1d2 it ne |
| if (sb == r4) {
0x0001c1d4 addne fp, fp, 1 |
| }
0x0001c1d8 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0001c1da ldr r5, [r3] | r5 = *(0x1c26c);
| if (r5 != 0) {
0x0001c1dc cbz r5, 0x1c234 |
0x0001c1de movs r1, 0x3c | r1 = 0x3c;
0x0001c1e0 mov r0, r7 | r0 = r7;
0x0001c1e2 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001c1e4 invalid |
0x0001c1e8 mov r3, r4 | r3 = r4;
0x0001c1ea str r4, [r0, 0xc] | *((r0 + 0xc)) = r4;
0x0001c1ec mov r1, fp | r1 = fp;
0x0001c1ee ldr r4, [r5] | r4 = *(r5);
0x0001c1f0 mov sl, r0 | sl = r0;
0x0001c1f2 str r2, [r0, 4] | *((r0 + 4)) = r2;
0x0001c1f4 mov r2, r7 | r2 = r7;
0x0001c1f6 str.w fp, [r0, 8] | __asm ("str.w fp, [r0, 8]");
0x0001c1fa str r7, [r0] | *(r0) = r7;
0x0001c1fc str r5, [r0, 0x38] | *((r0 + 0x38)) = r5;
0x0001c1fe blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t) (r1, r2, r3);
0x0001c200 movw r3, 0x1187 |
0x0001c204 mov r4, r0 | r4 = r0;
0x0001c206 movt r3, 1 | r3 = 0x11187;
0x0001c20a cmp r0, r3 |
| if (r0 == r3) {
0x0001c20c beq 0x1c234 | goto label_3;
| }
| if (r4 != 0) {
0x0001c20e cbnz r4, 0x1c23c | goto label_1;
| }
0x0001c210 cmp.w sb, 0 |
| if (sb != 0) {
0x0001c214 bne 0x1c242 | goto label_4;
| }
0x0001c216 ldr r3, [r5, 0x10] | r3 = *((r5 + 0x10));
| if (r3 != 0) {
0x0001c218 cbz r3, 0x1c22a |
| label_0:
0x0001c21a ldr r3, [pc, 0x54] | r3 = *(0x1c272);
0x0001c21c mov r0, r7 | r0 = r7;
0x0001c21e ldr r2, [pc, 0x54] |
0x0001c220 mov r1, sl | r1 = sl;
0x0001c222 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0001c224 add r2, pc | r2 = 0x3849e;
0x0001c226 blx 0x9fb0 | fcn_00009fb0 ();
| }
0x0001c22a mov r0, r4 | r0 = r4;
0x0001c22c str.w sl, [r8] | __asm ("str.w sl, [r8]");
0x0001c230 pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
| label_3:
0x0001c234 movw r4, 0x1187 |
0x0001c238 movt r4, 1 | r4 = 0x11187;
| do {
| label_1:
0x0001c23c mov r0, r4 | r0 = r4;
0x0001c23e pop.w {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_4:
0x0001c242 mov r2, sl | r2 = sl;
0x0001c244 add.w r5, sl, 0x18 | r5 = sl + 0x18;
0x0001c248 ldr r0, [r2], 0x10 | r0 = *(r2);
| r2 += 0x10;
0x0001c24c mov r1, r5 | r1 = r5;
0x0001c24e blx 0xa010 | r0 = fcn_0000a010 ();
| if (r0 == 0) {
0x0001c252 cbz r0, 0x1c258 | goto label_5;
| }
0x0001c254 mov r4, r0 | r4 = r0;
0x0001c256 b 0x1c23c |
| } while (1);
| label_5:
0x0001c258 mov r1, r5 | r1 = r5;
0x0001c25a mov r0, sl | r0 = sl;
0x0001c25c blx 0xa004 | r0 = fcn_0000a004 ();
0x0001c260 cmp r0, 0 |
| if (r0 == 0) {
0x0001c262 beq 0x1c21a | goto label_0;
| }
0x0001c264 mov r4, r0 | r4 = r0;
0x0001c266 b 0x1c23c | goto label_1;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1ddb8 */
| #include <stdint.h>
|
; (fcn) sym.apr_proc_create () | void apr_proc_create (int16_t arg_48h, int16_t arg_4ch, int16_t arg1, void * arg2, int16_t arg3, int16_t arg4) {
| int16_t var_1h;
| void * s;
| int16_t var_4h;
| int16_t var_8h;
| int16_t c;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0001ddb8 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001ddbc sub sp, 0x24 |
0x0001ddbe str r1, [sp] | *(sp) = r1;
0x0001ddc0 mov r8, r2 | r8 = r2;
0x0001ddc2 mov r5, r0 | r5 = r0;
0x0001ddc4 add r6, sp, 8 | r6 += var_8h;
0x0001ddc6 ldr r1, [pc, 0x364] |
0x0001ddc8 ldr r2, [pc, 0x364] | r2 = *(0x1e130);
0x0001ddca ldr.w sb, [pc, 0x368] |
0x0001ddce add r1, pc | r1 = 0x3bf00;
0x0001ddd0 ldr r4, [sp, 0x48] | r4 = *(arg_48h);
0x0001ddd2 ldr r2, [r1, r2] |
0x0001ddd4 add sb, pc | sb = 0x3bf0e;
0x0001ddd6 ldr.w sl, [sp, 0x4c] | sl = *(arg_4ch);
0x0001ddda ldr r2, [r2] | r2 = *(0x3bf00);
0x0001dddc str r2, [sp, 0x1c] | var_1ch = r2;
0x0001ddde mov.w r2, 0 | r2 = 0;
0x0001dde2 movs r2, 0 | r2 = 0;
0x0001dde4 str r2, [sp, 8] | var_8h = r2;
| if (r3 != 0) {
0x0001dde6 cbz r3, 0x1ddea |
0x0001dde8 mov r6, r3 | r6 = r3;
| }
0x0001ddea ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x0001ddec ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x0001ddee str r2, [r5, 4] | *((r5 + 4)) = r2;
0x0001ddf0 ldr r2, [r4, 0x14] | r2 = *((r4 + 0x14));
0x0001ddf2 str r2, [r5, 0xc] | *((r5 + 0xc)) = r2;
0x0001ddf4 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
0x0001ddf6 str r2, [r5, 8] | *((r5 + 8)) = r2;
| if (r3 != 0) {
0x0001ddf8 cbz r3, 0x1de1e |
0x0001ddfa ldr r0, [r4, 0x1c] | r0 = *((r4 + 0x1c));
| if (r0 != 0) {
0x0001ddfc cbz r0, 0x1de0a |
0x0001ddfe movs r1, 1 | r1 = 1;
0x0001de00 blx 0xa708 | fcn_0000a708 ();
0x0001de04 adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001de06 beq.w 0x1e038 | goto label_14;
| }
| }
0x0001de0a ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x0001de0c subs r3, 1 | r3--;
0x0001de0e cmp r3, 1 |
| if (r3 < 1) {
0x0001de10 bls.w 0x1e02a | goto label_15;
| }
0x0001de14 ldr r3, [sp] | r3 = *(sp);
0x0001de16 ldrb r3, [r3] | r3 = *(r3);
0x0001de18 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x0001de1a beq.w 0x1e02a | goto label_15;
| }
| }
| label_0:
0x0001de1e blx 0xa848 | r0 = fcn_0000a848 ();
0x0001de22 cmp r0, 0 |
0x0001de24 str r0, [r5] | *(r5) = r0;
| if (r0 < 0) {
0x0001de26 blt.w 0x1e038 | goto label_14;
| }
0x0001de2a ldr r0, [r4, 8] | r0 = *((r4 + 8));
| if (r0 != 0) {
0x0001de2c beq 0x1de70 |
| if (r0 != 0) {
0x0001de2e cbz r0, 0x1de38 |
0x0001de30 ldr r3, [r0, 4] | r3 = *((r0 + 4));
0x0001de32 adds r3, 1 | r3++;
| if (r3 != 1) {
0x0001de34 bne.w 0x1e094 | goto label_16;
| }
| }
| label_5:
0x0001de38 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
| if (r0 != 0) {
0x0001de3a cbz r0, 0x1de44 |
0x0001de3c ldr r3, [r0, 4] | r3 = *((r0 + 4));
0x0001de3e adds r3, 1 | r3++;
| if (r3 != 1) {
0x0001de40 bne.w 0x1e086 | goto label_17;
| }
| }
| label_4:
0x0001de44 ldr r0, [r4, 0x18] | r0 = *((r4 + 0x18));
| if (r0 != 0) {
0x0001de46 cbz r0, 0x1de54 |
0x0001de48 ldr r3, [r0, 4] | r3 = *((r0 + 4));
0x0001de4a adds r3, 1 | r3++;
0x0001de4c it eq |
| if (r3 != 1) {
0x0001de4e moveq r0, 0 | r0 = 0;
| }
| if (r3 != 1) {
0x0001de50 bne.w 0x1e08c | goto label_18;
| }
| }
| label_1:
0x0001de54 ldr r2, [pc, 0x2e0] |
0x0001de56 ldr r3, [pc, 0x2d8] | r3 = *(0x1e132);
0x0001de58 add r2, pc | r2 = 0x3bf94;
0x0001de5a ldr r3, [r2, r3] | r3 = *(0x3bf94);
0x0001de5c ldr r2, [r3] | r2 = *(0x3bf94);
0x0001de5e ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x0001de60 eors r2, r3 | r2 ^= r3;
0x0001de62 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001de66 bne.w 0x1e112 | goto label_19;
| }
0x0001de6a add sp, 0x24 |
0x0001de6c pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
| if (r0 != 0) {
0x0001de70 cbz r0, 0x1de82 |
0x0001de72 blx 0x9a0c | fcn_00009a0c ();
0x0001de76 ldr r3, [pc, 0x2c4] | r3 = *(0x1e13e);
0x0001de78 ldr r1, [r4, 8] | r1 = *((r4 + 8));
0x0001de7a ldr.w r2, [sb, r3] | r2 = *((sb + r3));
0x0001de7e blx 0x9e84 | fcn_00009e84 ();
| }
0x0001de82 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
| if (r0 != 0) {
0x0001de84 cbz r0, 0x1de96 |
0x0001de86 blx 0x9a0c | fcn_00009a0c ();
0x0001de8a ldr r3, [pc, 0x2b0] | r3 = *(0x1e13e);
0x0001de8c ldr r1, [r4, 0x10] | r1 = *((r4 + 0x10));
0x0001de8e ldr.w r2, [sb, r3] | r2 = *((sb + r3));
0x0001de92 blx 0x9e84 | fcn_00009e84 ();
| }
0x0001de96 ldr r0, [r4, 0x18] | r0 = *((r4 + 0x18));
| if (r0 != 0) {
0x0001de98 cbz r0, 0x1deaa |
0x0001de9a blx 0x9a0c | fcn_00009a0c ();
0x0001de9e ldr r3, [pc, 0x29c] | r3 = *(0x1e13e);
0x0001dea0 ldr r1, [r4, 0x18] | r1 = *((r4 + 0x18));
0x0001dea2 ldr.w r2, [sb, r3] | r2 = *((sb + r3));
0x0001dea6 blx 0x9e84 | fcn_00009e84 ();
| }
0x0001deaa blx 0xa9fc | fcn_0000a9fc ();
0x0001deae ldr r3, [r4, 8] | r3 = *((r4 + 8));
| if (r3 != 0) {
0x0001deb0 cbz r3, 0x1dec8 |
0x0001deb2 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001deb4 adds r1, r0, 1 | r1 = r0 + 1;
| if (r1 == r0) {
0x0001deb6 beq.w 0x1e0b0 | goto label_20;
| }
| if (r0 == 0) {
0x0001deba cbz r0, 0x1dec8 | goto label_7;
| }
0x0001debc movs r1, 0 | r1 = 0;
0x0001debe blx 0x9ef0 | fcn_00009ef0 ();
0x0001dec2 ldr r0, [r4, 8] | r0 = *((r4 + 8));
0x0001dec4 blx 0xa378 | fcn_0000a378 ();
| }
| label_7:
0x0001dec8 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
| if (r3 != 0) {
0x0001deca cbz r3, 0x1dee4 |
0x0001decc ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001dece adds r2, r0, 1 | r2 = r0 + 1;
| if (r2 == r0) {
0x0001ded0 beq.w 0x1e0b8 | goto label_21;
| }
0x0001ded4 cmp r0, 1 |
| if (r0 == 1) {
0x0001ded6 beq 0x1dee4 | goto label_8;
| }
0x0001ded8 movs r1, 1 | r1 = 1;
0x0001deda blx 0x9ef0 | fcn_00009ef0 ();
0x0001dede ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001dee0 blx 0xa378 | fcn_0000a378 ();
| }
| label_8:
0x0001dee4 ldr r3, [r4, 0x18] | r3 = *((r4 + 0x18));
| if (r3 != 0) {
0x0001dee6 cbz r3, 0x1df00 |
0x0001dee8 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001deea adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x0001deec beq.w 0x1e0c0 | goto label_22;
| }
0x0001def0 cmp r0, 2 |
| if (r0 == 2) {
0x0001def2 beq 0x1df00 | goto label_9;
| }
0x0001def4 movs r1, 2 | r1 = 2;
0x0001def6 blx 0x9ef0 | fcn_00009ef0 ();
0x0001defa ldr r0, [r4, 0x18] | r0 = *((r4 + 0x18));
0x0001defc blx 0xa378 | fcn_0000a378 ();
| }
| label_9:
0x0001df00 movs r1, 0 | r1 = 0;
0x0001df02 movs r0, 0x11 | r0 = 0x11;
0x0001df04 blx 0xaa88 | pthread_attr_setdetachstate ();
0x0001df08 ldr r0, [r4, 0x1c] | r0 = *((r4 + 0x1c));
| if (r0 != 0) {
0x0001df0a cbz r0, 0x1df16 |
0x0001df0c blx 0x9f88 | fcn_00009f88 ();
0x0001df10 adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001df12 beq.w 0x1e116 | goto label_23;
| }
| }
0x0001df16 blx 0x9fe0 | r0 = fcn_00009fe0 ();
| if (r0 != 0) {
0x0001df1a cbnz r0, 0x1df44 | goto label_24;
| }
0x0001df1c ldr r5, [r4, 0x48] | r5 = *((r4 + 0x48));
| if (r5 == 0) {
0x0001df1e cbz r5, 0x1df44 | goto label_24;
| }
0x0001df20 movw sb, 0x1187 |
0x0001df24 movt sb, 1 | sb = 0x11187;
| do {
0x0001df28 ldrd r2, r3, [r4, 0x40] | __asm ("ldrd r2, r3, [r4, 0x40]");
0x0001df2c ldrd r1, r0, [r5, 8] | __asm ("ldrd r1, r0, [r5, 8]");
0x0001df30 ldr r7, [r5, 4] | r7 = *((r5 + 4));
0x0001df32 blx r7 | r0 = uint32_t (*r7)(uint32_t, uint32_t) (r1, r2);
0x0001df34 cmp r0, 0 |
0x0001df36 it ne |
| if (r0 != 0) {
0x0001df38 cmpne r0, sb | __asm ("cmpne r0, sb");
| }
| if (r0 != 0) {
0x0001df3a bne.w 0x1e052 | goto label_3;
| }
0x0001df3e ldr r5, [r5] | r5 = *(r5);
0x0001df40 cmp r5, 0 |
0x0001df42 bne 0x1df28 |
| } while (r5 != 0);
| label_24:
0x0001df44 ldr r3, [r4, 0x44] | r3 = *((r4 + 0x44));
0x0001df46 adds r3, 1 | r3++;
| if (r3 != 1) {
0x0001df48 bne.w 0x1e05a | goto label_25;
| }
| label_2:
0x0001df4c ldr r3, [r4, 0x40] | r3 = *((r4 + 0x40));
0x0001df4e adds r3, 1 | r3++;
| if (r3 != 1) {
0x0001df50 beq 0x1df62 |
0x0001df52 blx 0x9fe0 | r0 = fcn_00009fe0 ();
| if (r0 != 0) {
0x0001df56 cbnz r0, 0x1df62 | goto label_26;
| }
0x0001df58 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x0001df5a blx 0xa910 | r0 = fcn_0000a910 ();
0x0001df5e cmp r0, 0 |
| if (r0 != 0) {
0x0001df60 bne 0x1e040 | goto label_27;
| }
| }
| label_26:
0x0001df62 ldr r0, [r4, 0x20] | r0 = *((r4 + 0x20));
0x0001df64 bics sb, r0, 4 | __asm ("bics sb, r0, 4");
| if (r0 != 0) {
0x0001df68 bne.w 0x1e09a | goto label_28;
| }
0x0001df6c ldr r3, [pc, 0x1d0] |
0x0001df6e ldr.w r0, [r8] | r0 = *(r8);
0x0001df72 add r3, pc | r3 = 0x3c0b6;
0x0001df74 str r3, [sp, 0xc] | c = r3;
0x0001df76 ldr r3, [pc, 0x1cc] |
0x0001df78 str r0, [sp, 4] | var_4h = r0;
0x0001df7a add r3, pc | r3 = 0x3c0c4;
0x0001df7c str r3, [sp, 0x10] | var_10h = r3;
| if (r0 == 0) {
0x0001df7e cbz r0, 0x1dfec | goto label_10;
| }
0x0001df80 mov r7, r8 | r7 = r8;
0x0001df82 mov r5, r8 | r5 = r8;
0x0001df84 mov fp, sb |
| do {
0x0001df86 blx 0xa40c | fcn_0000a40c ();
0x0001df8a add r0, sb | r0 += sb;
0x0001df8c add.w fp, fp, 1 |
0x0001df90 add.w sb, r0, 1 | sb = r0 + 1;
0x0001df94 ldr r0, [r5, 4]! | r0 = *((r5 += 4));
0x0001df98 cmp r0, 0 |
0x0001df9a bne 0x1df86 |
| } while (r0 != 0);
0x0001df9c cmp.w fp, 1 |
| if (fp == 1) {
0x0001dfa0 beq.w 0x1e0d4 | goto label_29;
| }
0x0001dfa4 mov r1, sb | r1 = sb;
0x0001dfa6 mov r0, sl | r0 = sl;
0x0001dfa8 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001dfac ldr.w r1, [r8] | r1 = *(r8);
0x0001dfb0 mov r5, r0 | r5 = r0;
0x0001dfb2 mov fp, r0 |
| if (r1 == 0) {
0x0001dfb4 cbz r1, 0x1dfe4 | goto label_30;
| }
0x0001dfb6 mov.w sb, 0x20 | sb = 0x20;
| do {
0x0001dfba mov r0, r1 | r0 = r1;
0x0001dfbc str r1, [sp, 4] | var_4h = r1;
0x0001dfbe blx 0xa40c | r0 = fcn_0000a40c ();
0x0001dfc2 mov r8, r0 | r8 = r0;
0x0001dfc4 ldr r1, [sp, 4] | r1 = var_4h;
0x0001dfc6 mov r0, fp | r0 = fp;
0x0001dfc8 mov r2, r8 | r2 = r8;
0x0001dfca blx 0x9cf8 | fcn_00009cf8 ();
0x0001dfce mov r3, r7 | r3 = r7;
0x0001dfd0 strb.w sb, [fp, r8] | *((fp + r8)) = sb;
0x0001dfd4 ldr r1, [r3, 4]! | r1 = *((r3 += 4));
0x0001dfd8 add r8, fp | r8 += fp;
0x0001dfda add.w fp, r8, 1 |
0x0001dfde mov r7, r3 | r7 = r3;
0x0001dfe0 cmp r1, 0 |
0x0001dfe2 bne 0x1dfba |
| } while (r1 != 0);
| label_30:
0x0001dfe4 movs r2, 0 | r2 = 0;
0x0001dfe6 strb r2, [fp, -0x1] | *((fp - 0x1)) = r2;
0x0001dfea str r5, [sp, 0x14] | var_14h = r5;
| label_10:
0x0001dfec movs r3, 0 | r3 = 0;
0x0001dfee str r3, [sp, 0x18] | var_18h = r3;
0x0001dff0 ldr r3, [r4, 0x24] | r3 = *((r4 + 0x24));
0x0001dff2 cmp r3, 0 |
| if (r3 != 0) {
0x0001dff4 bne 0x1e0f4 | goto label_31;
| }
| label_11:
0x0001dff6 ldr r3, [r4, 0x20] | r3 = *((r4 + 0x20));
0x0001dff8 cmp r3, 0 |
| if (r3 != 0) {
0x0001dffa bne 0x1e0c8 | goto label_32;
| }
0x0001dffc ldr r0, [pc, 0x148] |
0x0001dffe mov r2, r6 | r2 = r6;
0x0001e000 add r1, sp, 0xc | r1 += c;
0x0001e002 add r0, pc | r0 = 0x3c14e;
0x0001e004 blx 0xa4c0 | fcn_0000a4c0 ();
| label_6:
0x0001e008 ldr r3, [r4, 0x38] | r3 = *((r4 + 0x38));
| if (r3 == 0) {
0x0001e00a cbz r3, 0x1e052 | goto label_3;
| }
0x0001e00c ldr r1, [pc, 0x13c] |
0x0001e00e mov r0, sl | r0 = sl;
0x0001e010 ldr r2, [sp] | r2 = *(sp);
0x0001e012 add r1, pc | r1 = 0x3c162;
0x0001e014 blx 0xa500 | r0 = getgid ();
0x0001e018 mov r5, r0 | r5 = r0;
0x0001e01a blx 0xa580 | fcn_0000a580 ();
0x0001e01e ldr r3, [r4, 0x38] | r3 = *((r4 + 0x38));
0x0001e020 mov r2, r5 | r2 = r5;
0x0001e022 ldr r1, [r0] | r1 = *(r0);
0x0001e024 mov r0, sl | r0 = sl;
0x0001e026 blx r3 | uint32_t (*r3)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0001e028 b 0x1e052 | goto label_3;
| label_15:
0x0001e02a ldr r0, [sp] | r0 = *(sp);
0x0001e02c movs r1, 1 | r1 = 1;
0x0001e02e blx 0xa708 | fcn_0000a708 ();
0x0001e032 adds r0, 1 | r0++;
| if (r0 != 1) {
0x0001e034 bne.w 0x1de1e | goto label_0;
| }
| label_14:
0x0001e038 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001e03c ldr r0, [r0] | r0 = *(r0);
0x0001e03e b 0x1de54 | goto label_1;
| label_27:
0x0001e040 ldr r4, [r4, 0x38] | r4 = *((r4 + 0x38));
| if (r4 != 0) {
0x0001e042 cbz r4, 0x1e052 |
0x0001e044 blx 0xa580 | fcn_0000a580 ();
0x0001e048 ldr r2, [pc, 0x104] |
0x0001e04a ldr r1, [r0] | r1 = *(r0);
0x0001e04c mov r0, sl | r0 = sl;
0x0001e04e add r2, pc | r2 = 0x3c1a2;
0x0001e050 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t) (r0, r1, r2);
| }
| label_3:
0x0001e052 mov.w r0, -1 | r0 = -1;
0x0001e056 blx 0x9cd8 | fcn_00009cd8 ();
| label_25:
0x0001e05a blx 0x9fe0 | r0 = fcn_00009fe0 ();
0x0001e05e cmp r0, 0 |
| if (r0 != 0) {
0x0001e060 bne.w 0x1df4c | goto label_2;
| }
0x0001e064 ldr r0, [r4, 0x44] | r0 = *((r4 + 0x44));
0x0001e066 blx 0xa28c | r0 = fcn_0000a28c ();
0x0001e06a cmp r0, 0 |
| if (r0 == 0) {
0x0001e06c beq.w 0x1df4c | goto label_2;
| }
0x0001e070 ldr r4, [r4, 0x38] | r4 = *((r4 + 0x38));
0x0001e072 cmp r4, 0 |
| if (r4 == 0) {
0x0001e074 beq 0x1e052 | goto label_3;
| }
0x0001e076 blx 0xa580 | fcn_0000a580 ();
0x0001e07a ldr r2, [pc, 0xd8] |
0x0001e07c ldr r1, [r0] | r1 = *(r0);
0x0001e07e mov r0, sl | r0 = sl;
0x0001e080 add r2, pc | r2 = 0x3c1da;
0x0001e082 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t) (r0, r1, r2);
0x0001e084 b 0x1e052 | goto label_3;
| label_17:
0x0001e086 blx 0xa378 | fcn_0000a378 ();
0x0001e08a b 0x1de44 | goto label_4;
| label_18:
0x0001e08c blx 0xa378 | fcn_0000a378 ();
0x0001e090 movs r0, 0 | r0 = 0;
0x0001e092 b 0x1de54 | goto label_1;
| label_16:
0x0001e094 blx 0xa378 | fcn_0000a378 ();
0x0001e098 b 0x1de38 | goto label_5;
| label_28:
0x0001e09a cmp r0, 1 |
0x0001e09c ldr r3, [r4, 0x24] | r3 = *((r4 + 0x24));
| if (r0 == 1) {
0x0001e09e beq 0x1e0e6 | goto label_33;
| }
0x0001e0a0 cmp r0, 2 |
| if (r0 == 2) {
0x0001e0a2 beq 0x1e0da | goto label_34;
| }
0x0001e0a4 cbnz r3, 0x1e0fc |
| while (1) {
0x0001e0a6 ldr r0, [sp] | r0 = *(sp);
0x0001e0a8 mov r1, r8 | r1 = r8;
0x0001e0aa blx 0x9d28 | fcn_00009d28 ();
0x0001e0ae b 0x1e008 | goto label_6;
| label_20:
0x0001e0b0 movs r0, 0 | r0 = 0;
0x0001e0b2 blx 0xac94 | fcn_0000ac94 ();
0x0001e0b6 b 0x1dec8 | goto label_7;
| label_21:
0x0001e0b8 movs r0, 1 | r0 = 1;
0x0001e0ba blx 0xac94 | fcn_0000ac94 ();
0x0001e0be b 0x1dee4 | goto label_8;
| label_22:
0x0001e0c0 movs r0, 2 | r0 = 2;
0x0001e0c2 blx 0xac94 | fcn_0000ac94 ();
0x0001e0c6 b 0x1df00 | goto label_9;
| label_32:
0x0001e0c8 ldr r0, [pc, 0x8c] |
0x0001e0ca add r1, sp, 0xc | r1 += c;
0x0001e0cc add r0, pc | r0 = 0x3c228;
0x0001e0ce blx 0xa518 | memset (r0, r1, r2);
0x0001e0d2 b 0x1e008 | goto label_6;
| label_29:
0x0001e0d4 ldr r3, [sp, 4] | r3 = var_4h;
0x0001e0d6 str r3, [sp, 0x14] | var_14h = r3;
0x0001e0d8 b 0x1dfec | goto label_10;
| if (r3 != 0) {
| label_34:
0x0001e0da cbnz r3, 0x1e10a | goto label_35;
| }
| label_13:
0x0001e0dc ldr r0, [sp] | r0 = *(sp);
0x0001e0de mov r1, r8 | r1 = r8;
0x0001e0e0 blx 0xa518 | memset (r0, r1, r2);
0x0001e0e4 b 0x1e008 | goto label_6;
| if (r3 != 0) {
| label_33:
0x0001e0e6 cbnz r3, 0x1e104 | goto label_36;
| }
| label_12:
0x0001e0e8 ldr r0, [sp] | r0 = *(sp);
0x0001e0ea mov r2, r6 | r2 = r6;
0x0001e0ec mov r1, r8 | r1 = r8;
0x0001e0ee blx 0xa4c0 | fcn_0000a4c0 ();
0x0001e0f2 b 0x1e008 | goto label_6;
| label_31:
0x0001e0f4 movs r0, 1 | r0 = 1;
0x0001e0f6 blx 0xa8b4 | getpeername ();
0x0001e0fa b 0x1dff6 | goto label_11;
0x0001e0fc movs r0, 1 | r0 = 1;
0x0001e0fe blx 0xa8b4 | getpeername ();
0x0001e102 b 0x1e0a6 |
| }
| label_36:
0x0001e104 blx 0xa8b4 | getpeername ();
0x0001e108 b 0x1e0e8 | goto label_12;
| label_35:
0x0001e10a movs r0, 1 | r0 = 1;
0x0001e10c blx 0xa8b4 | getpeername ();
0x0001e110 b 0x1e0dc | goto label_13;
| label_19:
0x0001e112 blx 0x9e90 | fcn_00009e90 ();
| label_23:
0x0001e116 ldr r4, [r4, 0x38] | r4 = *((r4 + 0x38));
0x0001e118 cmp r4, 0 |
| if (r4 == 0) {
0x0001e11a beq 0x1e052 | goto label_3;
| }
0x0001e11c blx 0xa580 | fcn_0000a580 ();
0x0001e120 ldr r2, [pc, 0x38] |
0x0001e122 ldr r1, [r0] | r1 = *(r0);
0x0001e124 mov r0, sl | r0 = sl;
0x0001e126 add r2, pc | r2 = 0x3c286;
0x0001e128 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t) (r0, r1, r2);
0x0001e12a b 0x1e052 | goto label_3;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x10c10 */
| #include <stdint.h>
|
; (fcn) sym.apr_pstrcat () | void apr_pstrcat () {
| int16_t var_0h;
| int32_t var_1ch_2;
| int16_t var_1ch;
| int16_t var_20h;
| int16_t var_40h;
| int16_t var_44h;
| int16_t var_4h;
| int16_t var_4h_2;
0x00010c10 push {r0, r1, r2, r3} |
0x00010c12 ldr r2, [pc, 0xcc] |
0x00010c14 push.w {r4, r5, r6, r7, r8, sb, lr} |
0x00010c18 sub sp, 0x24 |
0x00010c1a ldr r3, [pc, 0xc8] | r3 = *(0x10ce6);
0x00010c1c add r4, sp, 0x40 | r4 += var_40h;
0x00010c1e add r2, pc | r2 = 0x21904;
0x00010c20 ldr r8, [r4], 4 | r8 = *(r4);
| r4 += 4;
0x00010c24 ldr r0, [sp, 0x44] | r0 = var_44h;
0x00010c26 ldr r3, [r2, r3] |
0x00010c28 adds r5, r4, 4 | r5 += var_4h;
0x00010c2a ldr r3, [r3] | r3 = *(0x21904);
0x00010c2c str r3, [sp, 0x1c] | var_1ch = r3;
0x00010c2e mov.w r3, 0 | r3 = 0;
0x00010c32 str r5, [sp] | *(sp) = r5;
0x00010c34 cmp r0, 0 |
| if (r0 == 0) {
0x00010c36 beq 0x10cd8 | goto label_2;
| }
0x00010c38 movs r7, 0 | r7 = 0;
0x00010c3a mov r6, r7 | r6 = r7;
| do {
0x00010c3c blx 0xa40c | fcn_0000a40c ();
0x00010c40 cmp r6, 5 |
0x00010c42 mov r3, r0 | r3 = r0;
0x00010c44 it le |
| if (r6 > 5) {
0x00010c46 addle r2, sp, 0x20 | r2 += var_20h;
| }
0x00010c48 add.w r5, r5, 4 | r5 += var_4h_2;
0x00010c4c it le |
| if (r6 > 5) {
0x00010c4e addle r2, r2, r6, lsl 2 | r2 += (r6 << 2);
| }
0x00010c52 add r7, r3 | r7 += r3;
0x00010c54 itt le |
| if (r6 > 5) {
0x00010c56 addle r6, 1 | r6++;
| }
| if (r6 > 5) {
0x00010c58 strle r0, [r2, -0x1c] | var_1ch_2 = r0;
| }
0x00010c5c ldr r0, [r5, -0x4] | r0 = *((r5 - 0x4));
0x00010c60 str r5, [sp] | *(sp) = r5;
0x00010c62 cmp r0, 0 |
0x00010c64 bne 0x10c3c |
| } while (r0 != 0);
0x00010c66 adds r1, r7, 1 | r1 = r7 + 1;
| label_1:
0x00010c68 mov r0, r8 | r0 = r8;
0x00010c6a adds r4, 4 | r4 += 4;
0x00010c6c blx 0xa0d0 | fcn_0000a0d0 ();
0x00010c70 ldr r6, [sp, 0x44] | r6 = var_44h;
0x00010c72 mov sb, r0 | sb = r0;
0x00010c74 mov r7, r0 | r7 = r0;
0x00010c76 str r4, [sp] | *(sp) = r4;
| if (r6 == 0) {
0x00010c78 cbz r6, 0x10cb4 | goto label_3;
| }
0x00010c7a mov.w r8, 0 | r8 = 0;
0x00010c7e b 0x10ca4 |
| while (r8 <= 5) {
0x00010c80 add r3, sp, 0x20 | r3 += var_20h;
0x00010c82 add.w r3, r3, r8, lsl 2 | r3 += (r8 << 2);
0x00010c86 add.w r8, r8, 1 | r8++;
0x00010c8a ldr r5, [r3, -0x1c] | r5 = var_1ch_2;
| label_0:
0x00010c8e mov r1, r6 | r1 = r6;
0x00010c90 mov r0, r7 | r0 = r7;
0x00010c92 adds r4, 4 | r4 += 4;
0x00010c94 mov r2, r5 | r2 = r5;
0x00010c96 blx 0x9cf8 | fcn_00009cf8 ();
0x00010c9a ldr r6, [r4, -0x4] | r6 = *((r4 - 0x4));
0x00010c9e add r7, r5 | r7 += r5;
0x00010ca0 str r4, [sp] | *(sp) = r4;
| if (r6 == 0) {
0x00010ca2 cbz r6, 0x10cb4 | goto label_3;
| }
0x00010ca4 cmp.w r8, 5 |
0x00010ca8 ble 0x10c80 |
| }
0x00010caa mov r0, r6 | r0 = r6;
0x00010cac blx 0xa40c | r0 = fcn_0000a40c ();
0x00010cb0 mov r5, r0 | r5 = r0;
0x00010cb2 b 0x10c8e | goto label_0;
| label_3:
0x00010cb4 movs r3, 0 | r3 = 0;
0x00010cb6 ldr r2, [pc, 0x30] |
0x00010cb8 strb r3, [r7] | *(r7) = r3;
0x00010cba ldr r3, [pc, 0x28] | r3 = *(0x10ce6);
0x00010cbc add r2, pc | r2 = 0x219aa;
0x00010cbe ldr r3, [r2, r3] | r3 = *(0x219aa);
0x00010cc0 ldr r2, [r3] | r2 = *(0x219aa);
0x00010cc2 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00010cc4 eors r2, r3 | r2 ^= r3;
0x00010cc6 mov.w r3, 0 | r3 = 0;
| if (r2 == r3) {
0x00010cca bne 0x10cdc |
0x00010ccc mov r0, sb | r0 = sb;
0x00010cce add sp, 0x24 |
0x00010cd0 pop.w {r4, r5, r6, r7, r8, sb, lr} |
0x00010cd4 add sp, 0x10 |
0x00010cd6 bx lr | return;
| label_2:
0x00010cd8 movs r1, 1 | r1 = 1;
0x00010cda b 0x10c68 | goto label_1;
| }
0x00010cdc blx 0x9e90 | r0 = fcn_00009e90 ();
0x00010ce0 lsrs r6, r0, 0x15 | r6 = r0 >> 0x15;
0x00010ce2 movs r2, r0 | r2 = r0;
0x00010ce4 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x00010ce6 movs r0, r0 |
0x00010ce8 lsrs r0, r5, 0x12 | r0 = r5 >> 0x12;
0x00010cea movs r2, r0 | r2 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x10cec */
| #include <stdint.h>
|
; (fcn) sym.apr_pstrcatv () | void apr_pstrcatv (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00010cec ssub8mi fp, r5, r8 | __asm ("ssub8mi fp, r5, r8");
| if (r2 == 0) {
0x00010cf0 cbz r2, 0x10d36 | goto label_0;
| }
0x00010cf2 mov ip, r0 |
0x00010cf4 mov r4, r1 | r4 = r1;
0x00010cf6 movs r6, 0 | r6 = 0;
| do {
0x00010cf8 ldr r7, [r1, 4] | r7 = *((r1 + 4));
0x00010cfa subs r2, 1 | r2--;
0x00010cfc add.w r1, r1, 8 | r1 += 8;
0x00010d00 add r6, r7 | r6 += r7;
0x00010d02 bne 0x10cf8 |
| } while (r2 != 1);
0x00010d04 adds r1, r6, 1 | r1 = r6 + 1;
| if (r3 != 0) {
0x00010d06 cbz r3, 0x10d0a |
0x00010d08 str r6, [r3] | *(r3) = r6;
| }
0x00010d0a mov r0, ip | r0 = ip;
0x00010d0c adds r4, 8 | r4 += 8;
0x00010d0e blx 0xa0d0 | r0 = fcn_0000a0d0 ();
0x00010d12 mov r6, r0 | r6 = r0;
0x00010d14 mov r3, r6 | r3 = r6;
| do {
0x00010d16 ldrd r1, r2, [r4, -0x8] | __asm ("ldrd r1, r2, [r4, -0x8]");
0x00010d1a mov r0, r3 | r0 = r3;
0x00010d1c adds r4, 8 | r4 += 8;
0x00010d1e blx 0x9cf8 | fcn_00009cf8 ();
0x00010d22 ldr r2, [r4, -0xc] | r2 = *((r4 - 0xc));
0x00010d26 subs r5, 1 | r5--;
0x00010d28 mov r3, r0 | r3 = r0;
0x00010d2a add r3, r2 | r3 += r2;
0x00010d2c bne 0x10d16 |
| } while (r5 != 1);
0x00010d2e movs r2, 0 | r2 = 0;
0x00010d30 mov r0, r6 | r0 = r6;
0x00010d32 strb r2, [r3] | *(r3) = r2;
0x00010d34 pop {r3, r4, r5, r6, r7, pc} |
| label_0:
0x00010d36 movs r1, 1 | r1 = 1;
| if (r3 != 0) {
0x00010d38 cbz r3, 0x10d3c |
0x00010d3a str r2, [r3] | *(r3) = r2;
| }
0x00010d3c blx 0xa0d0 | fcn_0000a0d0 ();
0x00010d40 movs r2, 0 | r2 = 0;
0x00010d42 mov r3, r0 | r3 = r0;
0x00010d44 mov r6, r0 | r6 = r0;
0x00010d46 strb r2, [r3] | *(r3) = r2;
0x00010d48 mov r0, r6 | r0 = r6;
0x00010d4a pop {r3, r4, r5, r6, r7, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x10cec */
| #include <stdint.h>
|
; (fcn) sym.apr_pstrcatv () | void apr_pstrcatv (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00010cec ssub8mi fp, r5, r8 | __asm ("ssub8mi fp, r5, r8");
| if (r2 == 0) {
0x00010cf0 cbz r2, 0x10d36 | goto label_0;
| }
0x00010cf2 mov ip, r0 |
0x00010cf4 mov r4, r1 | r4 = r1;
0x00010cf6 movs r6, 0 | r6 = 0;
| do {
0x00010cf8 ldr r7, [r1, 4] | r7 = *((r1 + 4));
0x00010cfa subs r2, 1 | r2--;
0x00010cfc add.w r1, r1, 8 | r1 += 8;
0x00010d00 add r6, r7 | r6 += r7;
0x00010d02 bne 0x10cf8 |
| } while (r2 != 1);
0x00010d04 adds r1, r6, 1 | r1 = r6 + 1;
| if (r3 != 0) {
0x00010d06 cbz r3, 0x10d0a |
0x00010d08 str r6, [r3] | *(r3) = r6;
| }
0x00010d0a mov r0, ip | r0 = ip;
0x00010d0c adds r4, 8 | r4 += 8;
0x00010d0e blx 0xa0d0 | r0 = fcn_0000a0d0 ();
0x00010d12 mov r6, r0 | r6 = r0;
0x00010d14 mov r3, r6 | r3 = r6;
| do {
0x00010d16 ldrd r1, r2, [r4, -0x8] | __asm ("ldrd r1, r2, [r4, -0x8]");
0x00010d1a mov r0, r3 | r0 = r3;
0x00010d1c adds r4, 8 | r4 += 8;
0x00010d1e blx 0x9cf8 | fcn_00009cf8 ();
0x00010d22 ldr r2, [r4, -0xc] | r2 = *((r4 - 0xc));
0x00010d26 subs r5, 1 | r5--;
0x00010d28 mov r3, r0 | r3 = r0;
0x00010d2a add r3, r2 | r3 += r2;
0x00010d2c bne 0x10d16 |
| } while (r5 != 1);
0x00010d2e movs r2, 0 | r2 = 0;
0x00010d30 mov r0, r6 | r0 = r6;
0x00010d32 strb r2, [r3] | *(r3) = r2;
0x00010d34 pop {r3, r4, r5, r6, r7, pc} |
| label_0:
0x00010d36 movs r1, 1 | r1 = 1;
| if (r3 != 0) {
0x00010d38 cbz r3, 0x10d3c |
0x00010d3a str r2, [r3] | *(r3) = r2;
| }
0x00010d3c blx 0xa0d0 | fcn_0000a0d0 ();
0x00010d40 movs r2, 0 | r2 = 0;
0x00010d42 mov r3, r0 | r3 = r0;
0x00010d44 mov r6, r0 | r6 = r0;
0x00010d46 strb r2, [r3] | *(r3) = r2;
0x00010d48 mov r0, r6 | r0 = r6;
0x00010d4a pop {r3, r4, r5, r6, r7, pc} |
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1ee44).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1d4a4 */
| #include <stdint.h>
|
; (fcn) sym.apr_shm_create () | void apr_shm_create (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| int16_t var_20h;
| int16_t var_24h;
| int16_t var_28h;
| int16_t var_74h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
| if (? >= ?) {
0x0001d4a4 ldrbmi lr, [r0, sp, lsr 18]! |
| }
0x0001d4a8 sub sp, 0x78 |
0x0001d4aa str r1, [sp, 0xc] | var_ch = r1;
0x0001d4ac mov r5, r3 | r5 = r3;
0x0001d4ae mov r8, r0 | r8 = r0;
0x0001d4b0 mov r4, r2 | r4 = r2;
0x0001d4b2 ldr r1, [pc, 0x178] |
0x0001d4b4 mov r0, r5 | r0 = r5;
0x0001d4b6 ldr r3, [pc, 0x178] | r3 = *(0x1d632);
0x0001d4b8 ldr.w sb, [pc, 0x178] | sb = *(0x0001d634);
0x0001d4bc add r1, pc | r1 = 0x3aaee;
0x0001d4be ldr r3, [r1, r3] |
0x0001d4c0 movs r1, 0x20 | r1 = 0x20;
0x0001d4c2 add sb, pc | sb += pc;
0x0001d4c4 ldr r3, [r3] | r3 = *(0x3aaee);
0x0001d4c6 str r3, [sp, 0x74] | var_74h = r3;
0x0001d4c8 mov.w r3, 0 | r3 = 0;
0x0001d4cc cmp r2, 0 |
| if (r2 == 0) {
0x0001d4ce beq.w 0x1d5d6 | goto label_1;
| }
0x0001d4d2 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001d4d6 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0001d4d8 mov r6, r0 | r6 = r0;
0x0001d4da mov r1, r4 | r1 = r4;
0x0001d4dc str r5, [r0] | *(r0) = r5;
0x0001d4de str r3, [r0, 0xc] | *((r0 + 0xc)) = r3;
0x0001d4e0 mov r0, r5 | r0 = r5;
0x0001d4e2 blx 0xa41c | fcn_0000a41c ();
0x0001d4e6 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0001d4e8 movs r2, 0x46 | r2 = 0x46;
0x0001d4ea str r0, [r6, 0x14] | *((r6 + 0x14)) = r0;
0x0001d4ec mov r1, r4 | r1 = r4;
0x0001d4ee add r0, sp, 0x1c | r0 += var_1ch;
0x0001d4f0 str r3, [r6, 0x10] | *((r6 + 0x10)) = r3;
0x0001d4f2 movw r3, 0xfff | r3 = 0xfff;
0x0001d4f6 str r5, [sp] | *(sp) = r5;
0x0001d4f8 blx 0xa80c | r0 = fcn_0000a80c ();
0x0001d4fc mov r7, r0 | r7 = r0;
0x0001d4fe cbz r0, 0x1d51e |
| while (r0 != 0) {
| label_0:
0x0001d500 ldr r2, [pc, 0x134] |
0x0001d502 ldr r3, [pc, 0x12c] | r3 = *(0x1d632);
0x0001d504 add r2, pc | r2 = 0x3ab40;
0x0001d506 ldr r3, [r2, r3] | r3 = *(0x3ab40);
0x0001d508 ldr r2, [r3] | r2 = *(0x3ab40);
0x0001d50a ldr r3, [sp, 0x74] | r3 = var_74h;
0x0001d50c eors r2, r3 | r2 ^= r3;
0x0001d50e mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001d512 bne.w 0x1d628 | goto label_2;
| }
0x0001d516 mov r0, r7 | r0 = r7;
0x0001d518 add sp, 0x78 |
0x0001d51a pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
0x0001d51e mov r0, r4 | r0 = r4;
0x0001d520 add.w sl, sp, 0x20 | sl += var_20h;
0x0001d524 blx 0xa40c | fcn_0000a40c ();
0x0001d528 mov r1, sl | r1 = sl;
0x0001d52a str r0, [sp, 0x20] | var_20h = r0;
0x0001d52c mov r0, r4 | r0 = r4;
0x0001d52e blx 0xa6e4 | r0 = fcn_0000a6e4 ();
0x0001d532 mov r1, r0 | r1 = r0;
0x0001d534 mov r0, r4 | r0 = r4;
0x0001d536 blx 0xa994 | r0 = fcn_0000a994 ();
0x0001d53a mov r3, r0 | r3 = r0;
0x0001d53c str r0, [r6, 0x1c] | *((r6 + 0x1c)) = r0;
0x0001d53e adds r3, 1 | r3++;
| if (r3 == 1) {
0x0001d540 beq 0x1d5c8 | goto label_3;
| }
0x0001d542 ldr r1, [r6, 0x10] | r1 = *((r6 + 0x10));
0x0001d544 mov.w r2, 0x780 | r2 = 0x780;
0x0001d548 blx 0x9d50 | r0 = ftruncate64 ();
0x0001d54c cmp r0, 0 |
0x0001d54e str r0, [r6, 0x18] | *((r6 + 0x18)) = r0;
| if (r0 < 0) {
0x0001d550 blt 0x1d5c8 | goto label_3;
| }
0x0001d552 mov r2, r7 | r2 = r7;
0x0001d554 mov r1, r7 | r1 = r7;
0x0001d556 blx 0x9f6c | r0 = fcn_00009f6c ();
0x0001d55a adds r3, r0, 1 | r3 = r0 + 1;
0x0001d55c str r0, [r6, 4] | *((r6 + 4)) = r0;
| if (r3 == r0) {
0x0001d55e beq 0x1d5c8 | goto label_3;
| }
0x0001d560 str r0, [r6, 8] | *((r6 + 8)) = r0;
0x0001d562 mov r2, sl | r2 = sl;
0x0001d564 ldr r0, [r6, 0x18] | r0 = *((r6 + 0x18));
0x0001d566 movs r1, 2 | r1 = 2;
0x0001d568 blx 0xa1a8 | fcn_0000a1a8 ();
0x0001d56c adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001d56e beq 0x1d5c8 | goto label_3;
| }
0x0001d570 mov r2, r5 | r2 = r5;
0x0001d572 add r1, sp, 0x14 | r1 += var_14h;
0x0001d574 add r0, sp, 0x10 | r0 += var_10h;
0x0001d576 blx 0xa274 | fcn_0000a274 ();
0x0001d57a ldr r3, [sp, 0x10] | r3 = var_10h;
0x0001d57c mov r2, sl | r2 = sl;
0x0001d57e ldr r0, [r6, 0x18] | r0 = *((r6 + 0x18));
0x0001d580 movs r1, 1 | r1 = 1;
0x0001d582 str r3, [sp, 0x24] | var_24h = r3;
0x0001d584 ldr r3, [sp, 0x14] | r3 = var_14h;
0x0001d586 str r3, [sp, 0x28] | var_28h = r3;
0x0001d588 blx 0xa1a8 | fcn_0000a1a8 ();
0x0001d58c adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001d58e beq 0x1d5c8 | goto label_3;
| }
0x0001d590 movs r3, 4 | r3 = 4;
0x0001d592 ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x0001d594 add r2, sp, 0x18 | r2 += var_18h;
0x0001d596 add r1, sp, 0xc | r1 += var_ch;
0x0001d598 str r3, [sp, 0x18] | var_18h = r3;
0x0001d59a blx 0xab7c | r0 = fcn_0000ab7c ();
0x0001d59e mov r7, r0 | r7 = r0;
0x0001d5a0 ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x0001d5a2 cmp r7, 0 |
| if (r7 != 0) {
0x0001d5a4 bne 0x1d622 | goto label_4;
| }
0x0001d5a6 blx 0xa378 | r0 = fcn_0000a378 ();
0x0001d5aa mov r7, r0 | r7 = r0;
0x0001d5ac cmp r0, 0 |
0x0001d5ae bne 0x1d500 |
| }
0x0001d5b0 ldr r3, [pc, 0x88] | r3 = *(0x1d63c);
0x0001d5b2 mov r1, r6 | r1 = r6;
0x0001d5b4 ldr r2, [pc, 0x88] |
0x0001d5b6 ldr r0, [r6] | r0 = *(r6);
0x0001d5b8 ldr.w r3, [sb, r3] | r3 = *((sb + r3));
0x0001d5bc add r2, pc | r2 = 0x3ac00;
0x0001d5be blx 0x9fb0 | fcn_00009fb0 ();
0x0001d5c2 str.w r6, [r8] | __asm ("str.w r6, [r8]");
0x0001d5c6 b 0x1d500 | goto label_0;
| label_3:
0x0001d5c8 ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x0001d5ca blx 0xa378 | fcn_0000a378 ();
| do {
0x0001d5ce blx 0xa580 | r0 = fcn_0000a580 ();
0x0001d5d2 ldr r7, [r0] | r7 = *(r0);
0x0001d5d4 b 0x1d500 | goto label_0;
| label_1:
0x0001d5d6 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001d5da ldr r1, [sp, 0xc] | r1 = var_ch;
0x0001d5dc mov.w r3, -1 | r3 = -1;
0x0001d5e0 str r5, [r0] | *(r0) = r5;
0x0001d5e2 mov r6, r0 | r6 = r0;
0x0001d5e4 str r4, [r0, 0x14] | *((r0 + 0x14)) = r4;
0x0001d5e6 movs r2, 3 | r2 = 3;
0x0001d5e8 str r1, [r0, 0xc] | *((r0 + 0xc)) = r1;
0x0001d5ea adds r1, 8 | r1 += 8;
0x0001d5ec str r1, [r0, 0x10] | *((r0 + 0x10)) = r1;
0x0001d5ee mov r0, r4 | r0 = r4;
0x0001d5f0 str r3, [sp] | *(sp) = r3;
0x0001d5f2 movs r3, 0x21 | r3 = 0x21;
0x0001d5f4 str r4, [sp, 4] | var_4h = r4;
0x0001d5f6 blx 0xa444 | r0 = fcn_0000a444 ();
0x0001d5fa adds r2, r0, 1 | r2 = r0 + 1;
0x0001d5fc str r0, [r6, 4] | *((r6 + 4)) = r0;
0x0001d5fe beq 0x1d5ce |
| } while (r2 == r0);
0x0001d600 ldr r3, [r6, 0x10] | r3 = *((r6 + 0x10));
0x0001d602 mov r1, r6 | r1 = r6;
0x0001d604 ldr r2, [pc, 0x3c] |
0x0001d606 mov r7, r4 | r7 = r4;
0x0001d608 str r3, [r0], 8 | *(r0) = r3;
| r0 += 8;
0x0001d60c ldr r3, [pc, 0x2c] | r3 = *(0x1d63c);
0x0001d60e add r2, pc | r2 = 0x3ac56;
0x0001d610 str r0, [r6, 8] | *((r6 + 8)) = r0;
0x0001d612 ldr r0, [r6] | r0 = *(r6);
0x0001d614 ldr.w r3, [sb, r3] | r3 = *((sb + r3));
0x0001d618 blx 0x9fb0 | fcn_00009fb0 ();
0x0001d61c str.w r6, [r8] | __asm ("str.w r6, [r8]");
0x0001d620 b 0x1d500 | goto label_0;
| label_4:
0x0001d622 blx 0xa378 | fcn_0000a378 ();
0x0001d626 b 0x1d500 | goto label_0;
| label_2:
0x0001d628 blx 0x9e90 | fcn_00009e90 ();
0x0001d62c add r8, r5 | r8 += r5;
0x0001d62e movs r1, r0 | r1 = r0;
0x0001d630 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x0001d632 movs r0, r0 |
0x0001d634 add sl, r4 | sl += r4;
0x0001d636 movs r1, r0 | r1 = r0;
0x0001d638 add r0, ip | r0 += ip;
0x0001d63a movs r1, r0 | r1 = r0;
0x0001d63c lsls r0, r0, 0x1a | r0 <<= 0x1a;
0x0001d63e movs r0, r0 |
0x0001d640 mcr2 p15, 3, pc, c5, c15, 7 | __asm ("mcr2 p15, 3, pc, c5, c15, 7");
0x0001d644 mrc2 p15, 0, apsr_nzcv, c3, c15, 7 | __asm ("mrc2 p15, 0, apsr_nzcv, c3, c15, 7");
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1d648 */
| #include <stdint.h>
|
; (fcn) sym.apr_shm_create_ex () | void apr_shm_create_ex () {
| do {
0x0000a160 invalid | void (*0xa164)() ();
0x0001d648 b.w 0xa160 |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1d64c */
| #include <stdint.h>
|
; (fcn) sym.apr_shm_remove () | void apr_shm_remove (int16_t arg1, int16_t arg2) {
| int16_t var_0h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x0001d64c push {r4, r5, r6, r7, lr} |
0x0001d64e mov r7, r1 | r7 = r1;
0x0001d650 ldr r4, [pc, 0xa0] |
0x0001d652 mov r1, r0 | r1 = r0;
0x0001d654 mov r6, r0 | r6 = r0;
0x0001d656 sub sp, 0x1c |
0x0001d658 ldr r0, [pc, 0x9c] | r0 = *(0x1d6f8);
0x0001d65a movw r3, 0xfff | r3 = 0xfff;
0x0001d65e add r4, pc | r4 = 0x3ad56;
0x0001d660 str r7, [sp] | *(sp) = r7;
0x0001d662 movs r2, 2 | r2 = 2;
0x0001d664 ldr r0, [r4, r0] |
0x0001d666 ldr r0, [r0] | r0 = *(0x3ad56);
0x0001d668 str r0, [sp, 0x14] | var_14h = r0;
0x0001d66a mov.w r0, 0 | r0 = 0;
0x0001d66e add r0, sp, 0xc | r0 += var_ch;
0x0001d670 blx 0xa80c | r0 = fcn_0000a80c ();
0x0001d674 mov r4, r0 | r4 = r0;
0x0001d676 cbz r0, 0x1d692 |
| while (1) {
| label_0:
0x0001d678 ldr r2, [pc, 0x80] |
0x0001d67a ldr r3, [pc, 0x7c] | r3 = *(0x1d6fa);
0x0001d67c add r2, pc | r2 = 0x3ad7c;
0x0001d67e ldr r3, [r2, r3] | r3 = *(0x3ad7c);
0x0001d680 ldr r2, [r3] | r2 = *(0x3ad7c);
0x0001d682 ldr r3, [sp, 0x14] | r3 = var_14h;
0x0001d684 eors r2, r3 | r2 ^= r3;
0x0001d686 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001d68a bne 0x1d6f0 | goto label_1;
| }
0x0001d68c mov r0, r4 | r0 = r4;
0x0001d68e add sp, 0x1c |
0x0001d690 pop {r4, r5, r6, r7, pc} |
0x0001d692 mov r0, r6 | r0 = r6;
0x0001d694 blx 0xa40c | fcn_0000a40c ();
0x0001d698 add r1, sp, 0x10 | r1 += var_10h;
0x0001d69a str r0, [sp, 0x10] | var_10h = r0;
0x0001d69c mov r0, r6 | r0 = r6;
0x0001d69e blx 0xa6e4 | r0 = fcn_0000a6e4 ();
0x0001d6a2 mov r1, r0 | r1 = r0;
0x0001d6a4 mov r0, r6 | r0 = r6;
0x0001d6a6 blx 0xa994 | r0 = fcn_0000a994 ();
0x0001d6aa adds r3, r0, 1 | r3 = r0 + 1;
0x0001d6ac mov r5, r0 | r5 = r0;
| if (r3 == r0) {
0x0001d6ae beq 0x1d6de | goto label_2;
| }
0x0001d6b0 ldr r0, [sp, 0xc] | r0 = var_ch;
0x0001d6b2 blx 0xa378 | fcn_0000a378 ();
0x0001d6b6 mov.w r2, 0x180 | r2 = 0x180;
0x0001d6ba mov r0, r5 | r0 = r5;
0x0001d6bc mov r1, r4 | r1 = r4;
0x0001d6be blx 0x9d50 | r0 = ftruncate64 ();
0x0001d6c2 cmp r0, 0 |
| if (r0 < 0) {
0x0001d6c4 blt 0x1d6de | goto label_2;
| }
0x0001d6c6 mov r2, r4 | r2 = r4;
0x0001d6c8 mov r1, r4 | r1 = r4;
0x0001d6ca blx 0xa1a8 | fcn_0000a1a8 ();
0x0001d6ce adds r0, 1 | r0++;
| if (r0 == 1) {
0x0001d6d0 beq 0x1d6de | goto label_2;
| }
0x0001d6d2 mov r1, r7 | r1 = r7;
0x0001d6d4 mov r0, r6 | r0 = r6;
0x0001d6d6 blx 0xa46c | r0 = fcn_0000a46c ();
0x0001d6da mov r4, r0 | r4 = r0;
0x0001d6dc b 0x1d678 |
| }
| label_2:
0x0001d6de blx 0xa580 | fcn_0000a580 ();
0x0001d6e2 mov r1, r7 | r1 = r7;
0x0001d6e4 mov r3, r0 | r3 = r0;
0x0001d6e6 mov r0, r6 | r0 = r6;
0x0001d6e8 ldr r4, [r3] | r4 = *(r3);
0x0001d6ea blx 0xa46c | fcn_0000a46c ();
0x0001d6ee b 0x1d678 | goto label_0;
| label_1:
0x0001d6f0 blx 0x9e90 | r0 = fcn_00009e90 ();
0x0001d6f4 orrs r6, r0 | r6 |= r0;
0x0001d6f6 movs r1, r0 | r1 = r0;
0x0001d6f8 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x0001d6fa movs r0, r0 |
0x0001d6fc cmn r0, r5 |
0x0001d6fe movs r1, r0 | r1 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1b224 */
| #include <stdint.h>
|
; (fcn) sym.apr_socket_accept () | void apr_socket_accept (int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_18h;
| int16_t var_2ch;
| int32_t var_5ch;
| int16_t var_ach;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0001b224 svcmi 0xf0e92d | __asm ("svcmi aav.0x000000ff");
0x0001b228 mov sb, r2 | sb = r2;
0x0001b22a ldr r2, [pc, 0x188] |
0x0001b22c sub sp, 0xb4 |
0x0001b22e add r6, sp, 0x2c | r6 += var_2ch;
0x0001b230 mov r5, r1 | r5 = r1;
0x0001b232 ldr r3, [pc, 0x184] | r3 = *(0x1b3ba);
0x0001b234 mov.w sl, 0x80 | sl = 0x80;
0x0001b238 add r2, pc | r2 = 0x365f2;
0x0001b23a mov r4, r0 | r4 = r0;
0x0001b23c ldr r0, [r1, 4] | r0 = *((r1 + 4));
0x0001b23e mov r1, r6 | r1 = r6;
0x0001b240 ldr r3, [r2, r3] |
0x0001b242 add r2, sp, 0x18 | r2 += var_18h;
0x0001b244 ldr r3, [r3] | r3 = *(0x365f2);
0x0001b246 str r3, [sp, 0xac] | var_ach = r3;
0x0001b248 mov.w r3, 0 | r3 = 0;
0x0001b24c str.w sl, [sp, 0x18] | __asm ("str.w sl, [var_18h]");
0x0001b250 blx 0xa038 | r0 = lseek64 ();
0x0001b254 subs.w r8, r0, 0 | r8 = r0 - 0;
| if (r8 < r0) {
0x0001b258 blt 0x1b358 | goto label_3;
| }
0x0001b25a mov r1, sb | r1 = sb;
0x0001b25c mov r0, r4 | r0 = r4;
0x0001b25e bl 0x1b02c | fcn_0001b02c (r0, r1);
0x0001b262 ldr r7, [r4] | r7 = *(r4);
0x0001b264 movs r2, 0 | r2 = 0;
0x0001b266 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x0001b268 ldrh.w fp, [sp, 0x2c] | fp = var_2ch;
0x0001b26c ldr r0, [r7, 0x10] | r0 = *((r7 + 0x10));
0x0001b26e str r3, [r7, 0xc] | *((r7 + 0xc)) = r3;
0x0001b270 movs r3, 1 | r3 = 1;
0x0001b272 str r3, [r7, 8] | *((r7 + 8)) = r3;
0x0001b274 mov r1, fp | r1 = fp;
0x0001b276 blx 0x9bcc | fcn_00009bcc ();
0x0001b27a ldr r0, [r7, 0x14] | r0 = *((r7 + 0x14));
0x0001b27c mov r1, fp | r1 = fp;
0x0001b27e movs r2, 0 | r2 = 0;
0x0001b280 blx 0x9bcc | fcn_00009bcc ();
0x0001b284 mov r1, r6 | r1 = r6;
0x0001b286 ldr r6, [r4] | r6 = *(r4);
0x0001b288 movs r3, 0 | r3 = 0;
0x0001b28a vmov.i8 d16, 0xff | __asm ("vmov.i8 d16, 0xff");
0x0001b28e str r3, [r7, 0x30] | *((r7 + 0x30)) = r3;
0x0001b290 mov r2, sl | r2 = sl;
0x0001b292 str.w r8, [r6, 4] | __asm ("str.w r8, [r6, 4]");
0x0001b296 ldr.w r8, [r6, 0x14] | r8 = *((r6 + 0x14));
0x0001b29a str r3, [r6, 0x2c] | *((r6 + 0x2c)) = r3;
0x0001b29c vstr d16, [r6, 0x18] | __asm ("vstr d16, [r6, 0x18]");
0x0001b2a0 add.w r0, r8, 0x28 | r0 = r8 + 0x28;
0x0001b2a4 blx 0x9cf8 | fcn_00009cf8 ();
0x0001b2a8 ldr r7, [r5, 0x10] | r7 = *((r5 + 0x10));
0x0001b2aa movs r2, 0xa8 | r2 = 0xa8;
0x0001b2ac ldr r3, [sp, 0x18] | r3 = var_18h;
0x0001b2ae ldr r0, [r6, 0x10] | r0 = *((r6 + 0x10));
0x0001b2b0 mov r1, r7 | r1 = r7;
0x0001b2b2 str.w r3, [r8, 0x14] | __asm ("str.w r3, [r8, 0x14]");
0x0001b2b6 blx 0x9cf8 | fcn_00009cf8 ();
0x0001b2ba ldr r6, [r4] | r6 = *(r4);
0x0001b2bc ldrh r2, [r7, 0x28] | r2 = *((r7 + 0x28));
0x0001b2be ldr r3, [r6, 0x10] | r3 = *((r6 + 0x10));
0x0001b2c0 cmp r2, 2 |
0x0001b2c2 str.w sb, [r3] | __asm ("str.w sb, [r3]");
| if (r2 == 2) {
0x0001b2c6 beq 0x1b374 | goto label_4;
| }
0x0001b2c8 cmp r2, 0xa |
| if (r2 == 0xa) {
0x0001b2ca beq 0x1b3a4 | goto label_5;
| }
0x0001b2cc cmp r2, 1 |
0x0001b2ce ldr r0, [r6, 0x14] | r0 = *((r6 + 0x14));
| if (r2 == 1) {
0x0001b2d0 beq 0x1b37e | goto label_6;
| }
| label_1:
0x0001b2d2 ldr r2, [r6, 0x14] | r2 = *((r6 + 0x14));
0x0001b2d4 ldrh r3, [r2, 0x2a] | r3 = *((r2 + 0x2a));
0x0001b2d6 rev16 r3, r3 | __asm ("rev16 r3, r3");
0x0001b2d8 strh r3, [r2, 0xc] | *((r2 + 0xc)) = r3;
| label_2:
0x0001b2da ldr r3, [r5, 0x24] | r3 = *((r5 + 0x24));
| if (r3 != 0) {
0x0001b2dc cbz r3, 0x1b2e2 |
0x0001b2de movs r3, 1 | r3 = 1;
0x0001b2e0 str r3, [r6, 0x24] | *((r6 + 0x24)) = r3;
| }
0x0001b2e2 ldr r3, [r5, 0x30] | r3 = *((r5 + 0x30));
0x0001b2e4 lsls r1, r3, 0x16 | r1 = r3 << 0x16;
0x0001b2e6 ittt mi |
| if (r1 >= r3) {
0x0001b2e8 ldrmi r3, [r6, 0x30] | r3 = *((r6 + 0x30));
| }
| if (r1 >= r3) {
0x0001b2ea orrmi r3, r3, 0x200 | r3 |= 0x200;
| }
| if (r1 >= r3) {
0x0001b2ec strbmi r0, [r0, 0xc] | *((r0 + 0xc)) = r0;
| }
0x0001b2ee str r3, [r6, 0x30] | *((r6 + 0x30)) = r3;
0x0001b2f0 ldr r3, [r5, 0x28] | r3 = *((r5 + 0x28));
| if (r3 != 0) {
0x0001b2f2 cbnz r3, 0x1b352 | goto label_7;
| }
0x0001b2f4 ldr r1, [pc, 0xc4] |
0x0001b2f6 ldr r2, [r7, 0x18] | r2 = *((r7 + 0x18));
0x0001b2f8 ldr r0, [r7, 0x20] | r0 = *((r7 + 0x20));
0x0001b2fa add r1, pc | r1 = 0x366ba;
0x0001b2fc blx 0x9dc4 | r0 = fcn_00009dc4 ();
0x0001b300 cbz r0, 0x1b352 |
| while (1) {
0x0001b302 ldr r0, [r6, 4] | r0 = *((r6 + 4));
0x0001b304 movs r1, 1 | r1 = 1;
0x0001b306 blx 0xa5d8 | r0 = pthread_sigmask ();
0x0001b30a adds r2, r0, 1 | r2 = r0 + 1;
0x0001b30c mov r6, r0 | r6 = r0;
| if (r2 == r0) {
0x0001b30e beq 0x1b360 | goto label_8;
| }
0x0001b310 ldr r3, [r4] | r3 = *(r4);
0x0001b312 orr r2, r0, 1 | r2 = r0 | 1;
0x0001b316 movs r1, 2 | r1 = 2;
0x0001b318 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001b31a blx 0xa5d8 | r0 = pthread_sigmask ();
0x0001b31e adds r3, r0, 1 | r3 = r0 + 1;
0x0001b320 mov r6, r0 | r6 = r0;
| if (r3 == r0) {
0x0001b322 beq 0x1b360 | goto label_8;
| }
0x0001b324 ldr r3, [pc, 0x98] |
0x0001b326 movs r5, 0 | r5 = 0;
0x0001b328 ldr r1, [r4] | r1 = *(r4);
0x0001b32a add r3, pc | r3 = 0x366ee;
0x0001b32c ldr r0, [r1] | r0 = *(r1);
0x0001b32e mov r2, r3 | r2 = r3;
0x0001b330 str r5, [r1, 0x34] | *((r1 + 0x34)) = r5;
0x0001b332 blx 0x9fb0 | fcn_00009fb0 ();
| label_0:
0x0001b336 ldr r2, [pc, 0x8c] |
0x0001b338 ldr r3, [pc, 0x7c] | r3 = *(0x1b3b8);
0x0001b33a add r2, pc | r2 = 0x36704;
0x0001b33c ldr r3, [r2, r3] | r3 = *(0x36704);
0x0001b33e ldr r2, [r3] | r2 = *(0x36704);
0x0001b340 ldr r3, [sp, 0xac] | r3 = var_ach;
0x0001b342 eors r2, r3 | r2 ^= r3;
0x0001b344 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001b348 bne 0x1b3ae | goto label_9;
| }
0x0001b34a mov r0, r5 | r0 = r5;
0x0001b34c add sp, 0xb4 |
0x0001b34e pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_7:
0x0001b352 movs r3, 1 | r3 = 1;
0x0001b354 str r3, [r6, 0x28] | *((r6 + 0x28)) = r3;
0x0001b356 b 0x1b302 |
| }
| label_3:
0x0001b358 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001b35c ldr r5, [r0] | r5 = *(r0);
0x0001b35e b 0x1b336 | goto label_0;
| label_8:
0x0001b360 blx 0xa580 | fcn_0000a580 ();
0x0001b364 ldr r3, [r4] | r3 = *(r4);
0x0001b366 ldr r5, [r0] | r5 = *(r0);
0x0001b368 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001b36a blx 0xac94 | fcn_0000ac94 ();
0x0001b36e ldr r3, [r4] | r3 = *(r4);
0x0001b370 str r6, [r3, 4] | *((r3 + 4)) = r6;
0x0001b372 b 0x1b336 | goto label_0;
| label_4:
0x0001b374 add.w r2, r3, 0x2c | r2 = r3 + 0x2c;
0x0001b378 str r2, [r3, 0x20] | *((r3 + 0x20)) = r2;
0x0001b37a ldr r6, [r4] | r6 = *(r4);
0x0001b37c b 0x1b2d2 | goto label_1;
| label_6:
0x0001b37e movs r2, 0xa8 | r2 = 0xa8;
0x0001b380 mov r1, r7 | r1 = r7;
0x0001b382 blx 0x9cf8 | fcn_00009cf8 ();
0x0001b386 ldr r3, [r4] | r3 = *(r4);
0x0001b388 ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x0001b38a add.w r2, r3, 0x2a | r2 = r3 + 0x2a;
0x0001b38c lsls r2, r5, 8 | r2 = r5 << 8;
0x0001b38e str r2, [r3, 0x20] | *((r3 + 0x20)) = r2;
0x0001b390 ldr r3, [r4] | r3 = *(r4);
0x0001b392 ldr r3, [r3, 0x14] | r3 = *((r3 + 0x14));
0x0001b394 add.w r2, r3, 0x2a | r2 = r3 + 0x2a;
0x0001b398 str r2, [r3, 0x20] | *((r3 + 0x20)) = r2;
0x0001b39a ldrh r3, [r7, 0x28] | r3 = *((r7 + 0x28));
0x0001b39c ldr r6, [r4] | r6 = *(r4);
0x0001b39e cmp r3, 1 |
| if (r3 == 1) {
0x0001b3a0 beq 0x1b2da | goto label_2;
| }
0x0001b3a2 b 0x1b2d2 | goto label_1;
| label_5:
0x0001b3a4 add.w r2, r3, 0x30 | r2 = r3 + 0x30;
0x0001b3a8 str r2, [r3, 0x20] | *((r3 + 0x20)) = r2;
0x0001b3aa ldr r6, [r4] | r6 = *(r4);
0x0001b3ac b 0x1b2d2 | goto label_1;
| label_9:
0x0001b3ae blx 0x9e90 | fcn_00009e90 ();
0x0001b3b2 nop |
0x0001b3b4 str r4, [r5, 0x70] | *((r5 + 0x70)) = r4;
0x0001b3b6 movs r1, r0 | r1 = r0;
0x0001b3b8 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x0001b3ba movs r0, r0 |
0x0001b3bc ldr r2, [r6, 0x5c] | r2 = var_5ch;
0x0001b3be movs r1, r0 | r1 = r0;
0x0001b3c0 stc2l p15, c15, [fp], {0xff} | __asm ("stc2l p15, c15, [fp], {0xff}");
0x0001b3c4 str r2, [r5, 0x60] | *((r5 + 0x60)) = r2;
0x0001b3c6 movs r1, r0 | r1 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1b0a8 */
| #include <stdint.h>
|
; (fcn) sym.apr_socket_create () | void apr_socket_create (int16_t arg_18h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0001b0a8 mvnsmi lr, sp, lsr 18 | __asm ("mvnsmi lr, sp, lsr 18");
0x0001b0ac mov r4, r0 | r4 = r0;
0x0001b0ae mov r7, r2 | r7 = r2;
0x0001b0b0 mov r8, r3 | r8 = r3;
| if (r1 == 0) {
0x0001b0b2 cbz r1, 0x1b0e6 | goto label_1;
| }
0x0001b0b4 cmp r1, 1 |
0x0001b0b6 mov r5, r1 | r5 = r1;
0x0001b0b8 ite ne |
| if (r1 == 1) {
0x0001b0ba movne r6, r3 | r6 = r3;
| }
| if (r1 != 1) {
0x0001b0bc moveq r6, 0 | r6 = 0;
| }
0x0001b0be ldr r1, [sp, 0x18] | r1 = *(arg_18h);
0x0001b0c0 bl 0x1b02c | fcn_0001b02c (r0, r1);
0x0001b0c4 mov r2, r6 | r2 = r6;
0x0001b0c6 ldr r6, [r4] | r6 = *(r4);
0x0001b0c8 mov r1, r7 | r1 = r7;
0x0001b0ca mov r0, r5 | r0 = r5;
0x0001b0cc blx 0xaaa4 | fcn_0000aaa4 ();
0x0001b0d0 str r0, [r6, 4] | *((r6 + 4)) = r0;
0x0001b0d2 ldr r6, [r4] | r6 = *(r4);
0x0001b0d4 ldr r3, [r6, 4] | r3 = *((r6 + 4));
0x0001b0d6 cmp r3, 0 |
0x0001b0d8 bge 0x1b106 |
| while (r3 < 0) {
0x0001b0da blx 0xa580 | r0 = fcn_0000a580 ();
0x0001b0de ldr r5, [r0] | r5 = *(r0);
0x0001b0e0 mov r0, r5 | r0 = r5;
0x0001b0e2 pop.w {r4, r5, r6, r7, r8, pc} |
| label_1:
0x0001b0e6 ldr r1, [sp, 0x18] | r1 = *(arg_18h);
0x0001b0e8 bl 0x1b02c | fcn_0001b02c (r0, r1);
0x0001b0ec mov r2, r8 | r2 = r8;
0x0001b0ee mov r1, r7 | r1 = r7;
0x0001b0f0 movs r0, 0xa | r0 = 0xa;
0x0001b0f2 ldr r5, [r4] | r5 = *(r4);
0x0001b0f4 blx 0xaaa4 | fcn_0000aaa4 ();
0x0001b0f8 ldr r6, [r4] | r6 = *(r4);
0x0001b0fa str r0, [r5, 4] | *((r5 + 4)) = r0;
0x0001b0fc ldr r3, [r6, 4] | r3 = *((r6 + 4));
0x0001b0fe cmp r3, 0 |
0x0001b100 it ge |
| if (r3 < 0) {
0x0001b102 movge r5, 0xa | r5 = 0xa;
| }
| if (r3 >= 0) {
0x0001b104 blt 0x1b180 |
| label_0:
0x0001b106 ldr r0, [r6, 0x10] | r0 = *((r6 + 0x10));
0x0001b108 mov r1, r5 | r1 = r5;
0x0001b10a movs r2, 0 | r2 = 0;
0x0001b10c str r7, [r6, 8] | *((r6 + 8)) = r7;
0x0001b10e str.w r8, [r6, 0xc] | __asm ("str.w r8, [r6, 0xc]");
0x0001b112 blx 0x9bcc | fcn_00009bcc ();
0x0001b116 ldr r0, [r6, 0x14] | r0 = *((r6 + 0x14));
0x0001b118 movs r2, 0 | r2 = 0;
0x0001b11a mov r1, r5 | r1 = r5;
0x0001b11c movs r5, 0 | r5 = 0;
0x0001b11e blx 0x9bcc | fcn_00009bcc ();
0x0001b122 ldr r3, [r4] | r3 = *(r4);
0x0001b124 movs r1, 1 | r1 = 1;
0x0001b126 str r5, [r6, 0x30] | *((r6 + 0x30)) = r5;
0x0001b128 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001b12a blx 0xa5d8 | r0 = pthread_sigmask ();
0x0001b12e adds r2, r0, 1 | r2 = r0 + 1;
0x0001b130 mov r6, r0 | r6 = r0;
| if (r2 != r0) {
0x0001b132 beq 0x1b168 |
0x0001b134 ldr r3, [r4] | r3 = *(r4);
0x0001b136 orr r2, r0, 1 | r2 = r0 | 1;
0x0001b13a movs r1, 2 | r1 = 2;
0x0001b13c ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001b13e blx 0xa5d8 | r0 = pthread_sigmask ();
0x0001b142 adds r3, r0, 1 | r3 = r0 + 1;
0x0001b144 mov r6, r0 | r6 = r0;
| if (r3 == r0) {
0x0001b146 beq 0x1b168 | goto label_2;
| }
0x0001b148 ldr r1, [r4] | r1 = *(r4);
0x0001b14a vmov.i8 d16, 0xff | __asm ("vmov.i8 d16, 0xff");
0x0001b14e ldr r3, [pc, 0x48] |
0x0001b150 ldr r2, [pc, 0x48] |
0x0001b152 ldr r0, [r1] | r0 = *(r1);
0x0001b154 add r3, pc | r3 = 0x362f2;
0x0001b156 vstr d16, [r1, 0x18] | __asm ("vstr d16, [r1, 0x18]");
0x0001b15a add r2, pc | r2 = 0x362fa;
0x0001b15c str r5, [r1, 0x34] | *((r1 + 0x34)) = r5;
0x0001b15e blx 0x9fb0 | fcn_00009fb0 ();
0x0001b162 mov r0, r5 | r0 = r5;
0x0001b164 pop.w {r4, r5, r6, r7, r8, pc} |
| }
| label_2:
0x0001b168 blx 0xa580 | fcn_0000a580 ();
0x0001b16c ldr r3, [r4] | r3 = *(r4);
0x0001b16e ldr r5, [r0] | r5 = *(r0);
0x0001b170 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001b172 blx 0xac94 | fcn_0000ac94 ();
0x0001b176 ldr r3, [r4] | r3 = *(r4);
0x0001b178 mov r0, r5 | r0 = r5;
0x0001b17a str r6, [r3, 4] | *((r3 + 4)) = r6;
0x0001b17c pop.w {r4, r5, r6, r7, r8, pc} |
| }
0x0001b180 mov r2, r8 | r2 = r8;
0x0001b182 mov r1, r7 | r1 = r7;
0x0001b184 movs r0, 2 | r0 = 2;
0x0001b186 movs r5, 2 | r5 = 2;
0x0001b188 blx 0xaaa4 | fcn_0000aaa4 ();
0x0001b18c str r0, [r6, 4] | *((r6 + 4)) = r0;
0x0001b18e ldr r6, [r4] | r6 = *(r4);
0x0001b190 ldr r3, [r6, 4] | r3 = *((r6 + 4));
0x0001b192 cmp r3, 0 |
0x0001b194 blt 0x1b0da |
| }
0x0001b196 b 0x1b106 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1a054 */
| #include <stdint.h>
|
; (fcn) sym.apr_socket_sendfile () | void apr_socket_sendfile (int16_t arg_38h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_14h_2;
| int16_t var_4h;
| int16_t var_8h;
| int32_t var_8h_2;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0001a054 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0001a058 mov r5, r0 | r5 = r0;
0x0001a05a ldr r0, [pc, 0x1e4] |
0x0001a05c mov r6, r1 | r6 = r1;
0x0001a05e sub sp, 0x18 |
0x0001a060 mov r8, r2 | r8 = r2;
0x0001a062 ldr r1, [pc, 0x1e0] | r1 = *(0x1a246);
0x0001a064 add r0, pc | r0 = 0x342aa;
0x0001a066 ldr r7, [sp, 0x38] | r7 = *(arg_38h);
0x0001a068 ldr r1, [r0, r1] |
0x0001a06a ldr r1, [r1] | r1 = *(0x342aa);
0x0001a06c str r1, [sp, 0x14] | var_14h = r1;
0x0001a06e mov.w r1, 0 | r1 = 0;
0x0001a072 ldrd r0, r1, [r3] | __asm ("ldrd r0, r1, [r3]");
0x0001a076 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x0001a07a cmp r2, 0 |
| if (r2 == 0) {
0x0001a07c beq.w 0x1a1ac | goto label_7;
| }
| label_3:
0x0001a080 ldr.w r3, [r8, 4] | r3 = *((r8 + 4));
0x0001a084 cmp r3, 0 |
0x0001a086 it le |
| if (r3 > 0) {
0x0001a088 movle sl, 0 | sl = 0;
| }
| if (r3 > 0) {
0x0001a08c bgt 0x1a154 | goto label_8;
| }
| label_2:
0x0001a08e ldr r3, [r5, 0x30] | r3 = *((r5 + 0x30));
0x0001a090 lsls r1, r3, 0x12 | r1 = r3 << 0x12;
0x0001a092 itet mi |
| if (r1 < r3) {
0x0001a094 bicmi r3, r3, 0x2000 | __asm ("bicmi r3, r3, aav.0x000000ff");
| }
| if (r1 >= r3) {
0x0001a098 addmi sb, sp, 8 | sb += var_8h;
| }
| if (r1 < r3) {
0x0001a09c str r3, [r5, 0x30] | *((r5 + 0x30)) = r3;
| }
| if (r1 >= r3) {
0x0001a09e bpl 0x1a140 | goto label_9;
| }
| label_4:
0x0001a0a0 movs r2, 0 | r2 = 0;
0x0001a0a2 mov r1, r5 | r1 = r5;
0x0001a0a4 mov r0, r2 | r0 = r2;
0x0001a0a6 blx 0xa138 | r0 = fcn_0000a138 ();
0x0001a0aa mov sb, r0 | sb = r0;
0x0001a0ac cmp r0, 0 |
| if (r0 != 0) {
0x0001a0ae bne.w 0x1a202 | goto label_10;
| }
0x0001a0b2 add.w sb, sp, 8 | sb += var_8h;
0x0001a0b6 b 0x1a0c4 |
| while (r3 == r0) {
0x0001a0b8 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001a0bc ldr r2, [r0] | r2 = *(r0);
0x0001a0be mov r3, r0 | r3 = r0;
0x0001a0c0 cmp r2, 4 |
| if (r2 != 4) {
0x0001a0c2 bne 0x1a1b4 | goto label_11;
| }
0x0001a0c4 ldr r3, [r7] | r3 = *(r7);
0x0001a0c6 mov r2, sb | r2 = sb;
0x0001a0c8 ldr r1, [r6, 4] | r1 = *((r6 + 4));
0x0001a0ca ldr r0, [r5, 4] | r0 = *((r5 + 4));
0x0001a0cc blx 0x99dc | r0 = fcn_000099dc ();
0x0001a0d0 adds r3, r0, 1 | r3 = r0 + 1;
0x0001a0d2 mov r4, r0 | r4 = r0;
0x0001a0d4 beq 0x1a0b8 |
| }
| label_0:
0x0001a0d6 ldr r3, [r7] | r3 = *(r7);
0x0001a0d8 add.w r6, sl, r4 | r6 = sl + r4;
0x0001a0dc cmp r3, r4 |
| if (r3 > r4) {
0x0001a0de bhi 0x1a1ce | goto label_12;
| }
0x0001a0e0 ldr.w r2, [r8, 0xc] | r2 = *((r8 + 0xc));
0x0001a0e4 cmp r2, 0 |
| if (r2 > 0) {
0x0001a0e6 ble 0x1a0fe |
0x0001a0e8 add r3, sp, 4 | r3 += var_4h;
0x0001a0ea ldr.w r1, [r8, 8] | r1 = *((r8 + 8));
0x0001a0ee mov r0, r5 | r0 = r5;
0x0001a0f0 blx 0xaab0 | fcn_0000aab0 ();
0x0001a0f4 ldr r3, [sp, 4] | r3 = var_4h;
0x0001a0f6 add r6, r3 | r6 += r3;
0x0001a0f8 cmp r0, 0 |
| if (r0 != 0) {
0x0001a0fa bne.w 0x1a226 | goto label_13;
| }
| }
0x0001a0fe movs r2, 0 | r2 = 0;
0x0001a100 mov r0, r5 | r0 = r5;
0x0001a102 mov.w r1, 0x400 | r1 = 0x400;
0x0001a106 blx 0xa698 | fcn_0000a698 ();
0x0001a10a cmp r4, 0 |
0x0001a10c str r6, [r7] | *(r7) = r6;
0x0001a10e it ge |
| if (r4 < 0) {
0x0001a110 movge sb, 0 | sb = 0;
| }
| if (r4 < 0) {
0x0001a114 blt 0x1a1f8 | goto label_14;
| }
| label_1:
0x0001a116 ldr r2, [pc, 0x130] |
0x0001a118 ldr r3, [pc, 0x128] | r3 = *(0x1a244);
0x0001a11a add r2, pc | r2 = 0x34368;
0x0001a11c ldr r3, [r2, r3] | r3 = *(0x34368);
0x0001a11e ldr r2, [r3] | r2 = *(0x34368);
0x0001a120 ldr r3, [sp, 0x14] | r3 = var_14h;
0x0001a122 eors r2, r3 | r2 ^= r3;
0x0001a124 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0001a128 bne.w 0x1a23a | goto label_15;
| }
0x0001a12c mov r0, sb | r0 = sb;
0x0001a12e add sp, 0x18 |
0x0001a130 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| do {
0x0001a134 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001a138 ldr r2, [r0] | r2 = *(r0);
0x0001a13a mov r3, r0 | r3 = r0;
0x0001a13c cmp r2, 4 |
| if (r2 != 4) {
0x0001a13e bne 0x1a1b4 | goto label_11;
| }
| label_9:
0x0001a140 mov r2, sb | r2 = sb;
0x0001a142 ldr r3, [r7] | r3 = *(r7);
0x0001a144 ldr r1, [r6, 4] | r1 = *((r6 + 4));
0x0001a146 ldr r0, [r5, 4] | r0 = *((r5 + 4));
0x0001a148 blx 0x99dc | r0 = fcn_000099dc ();
0x0001a14c adds r2, r0, 1 | r2 = r0 + 1;
0x0001a14e mov r4, r0 | r4 = r0;
0x0001a150 beq 0x1a134 |
| } while (r2 == r0);
0x0001a152 b 0x1a0d6 | goto label_0;
| label_8:
0x0001a154 movs r2, 1 | r2 = 1;
0x0001a156 mov.w r1, 0x400 | r1 = 0x400;
0x0001a15a mov r0, r5 | r0 = r5;
0x0001a15c blx 0xa698 | r0 = fcn_0000a698 ();
0x0001a160 mov sb, r0 | sb = r0;
0x0001a162 cmp r0, 0 |
| if (r0 != 0) {
0x0001a164 bne 0x1a116 | goto label_1;
| }
0x0001a166 ldrd r1, r2, [r8] | __asm ("ldrd r1, r2, [r8]");
0x0001a16a add r3, sp, 4 | r3 += var_4h;
0x0001a16c mov r0, r5 | r0 = r5;
0x0001a16e blx 0xaab0 | r0 = fcn_0000aab0 ();
0x0001a172 cmp r0, 0 |
| if (r0 != 0) {
0x0001a174 bne 0x1a218 | goto label_16;
| }
0x0001a176 ldr.w r1, [r8, 4] | r1 = *((r8 + 4));
0x0001a17a ldr r4, [sp, 4] | r4 = var_4h;
0x0001a17c cmp r1, 0 |
0x0001a17e mov sl, r4 | sl = r4;
| if (r1 <= 0) {
0x0001a180 ble 0x1a08e | goto label_2;
| }
0x0001a182 ldr.w r3, [r8] | r3 = *(r8);
0x0001a186 add.w r1, r3, r1, lsl 3 | r1 = r3 + (r1 << 3);
| do {
0x0001a18a ldr r2, [r3, 4] | r2 = *((r3 + 4));
0x0001a18c adds r3, 8 | r3 += 8;
0x0001a18e cmp r1, r3 |
0x0001a190 add r0, r2 | r0 += r2;
0x0001a192 bne 0x1a18a |
| } while (r1 != r3);
0x0001a194 cmp r4, r0 |
| if (r4 >= r0) {
0x0001a196 bhs.w 0x1a08e | goto label_2;
| }
0x0001a19a movs r2, 0 | r2 = 0;
0x0001a19c mov.w r1, 0x400 | r1 = 0x400;
0x0001a1a0 mov r0, r5 | r0 = r5;
0x0001a1a2 str r4, [r7] | *(r7) = r4;
0x0001a1a4 blx 0xa698 | r0 = fcn_0000a698 ();
0x0001a1a8 mov sb, r0 | sb = r0;
0x0001a1aa b 0x1a116 | goto label_1;
| label_7:
0x0001a1ac ldr.w r8, [pc, 0x9c] |
0x0001a1b0 add r8, pc | r8 = 0x34400;
0x0001a1b2 b 0x1a080 | goto label_3;
| label_11:
0x0001a1b4 cmp r2, 0xb |
| if (r2 == 0xb) {
0x0001a1b6 beq 0x1a208 | goto label_17;
| }
| label_5:
0x0001a1b8 str.w sl, [r7] | __asm ("str.w sl, [r7]");
| label_6:
0x0001a1bc movs r2, 0 | r2 = 0;
0x0001a1be mov.w r1, 0x400 | r1 = 0x400;
0x0001a1c2 mov r0, r5 | r0 = r5;
0x0001a1c4 ldr.w sb, [r3] | sb = *(r3);
0x0001a1c8 blx 0xa698 | fcn_0000a698 ();
0x0001a1cc b 0x1a116 | goto label_1;
| label_12:
0x0001a1ce movs r2, 0 | r2 = 0;
0x0001a1d0 mov.w r1, 0x400 | r1 = 0x400;
0x0001a1d4 mov r0, r5 | r0 = r5;
0x0001a1d6 str r6, [r7] | *(r7) = r6;
0x0001a1d8 blx 0xa698 | fcn_0000a698 ();
0x0001a1dc cmp r4, 0 |
0x0001a1de mov sb, r0 | sb = r0;
| if (r4 <= 0) {
0x0001a1e0 ble 0x1a230 | goto label_18;
| }
0x0001a1e2 ldrd r2, r3, [r5, 0x18] | __asm ("ldrd r2, r3, [r5, 0x18]");
0x0001a1e6 cmp r2, 1 |
0x0001a1e8 sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (r2 < 1) {
0x0001a1ec blt 0x1a116 | goto label_1;
| }
0x0001a1ee ldr r3, [r5, 0x30] | r3 = *((r5 + 0x30));
0x0001a1f0 orr r3, r3, 0x2000 | r3 |= 0x2000;
0x0001a1f4 str r3, [r5, 0x30] | *((r5 + 0x30)) = r3;
0x0001a1f6 b 0x1a116 | goto label_1;
| label_14:
0x0001a1f8 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001a1fc ldr.w sb, [r0] | sb = *(r0);
0x0001a200 b 0x1a116 | goto label_1;
| label_10:
0x0001a202 movs r3, 0 | r3 = 0;
0x0001a204 str r3, [r7] | *(r7) = r3;
0x0001a206 b 0x1a116 | goto label_1;
| label_17:
0x0001a208 ldrd r1, r2, [r5, 0x18] | __asm ("ldrd r1, r2, [r5, 0x18]");
0x0001a20c cmp r1, 1 |
0x0001a20e sbcs r2, r2, 0 | __asm ("sbcs r2, r2, 0");
| if (r1 >= 1) {
0x0001a212 bge.w 0x1a0a0 | goto label_4;
| }
0x0001a216 b 0x1a1b8 | goto label_5;
| label_16:
0x0001a218 str.w sb, [r7] | __asm ("str.w sb, [r7]");
0x0001a21c blx 0xa580 | r0 = fcn_0000a580 ();
0x0001a220 ldr.w sb, [r0] | sb = *(r0);
0x0001a224 b 0x1a116 | goto label_1;
| label_13:
0x0001a226 str r6, [r7] | *(r7) = r6;
0x0001a228 blx 0xa580 | r0 = fcn_0000a580 ();
0x0001a22c mov r3, r0 | r3 = r0;
0x0001a22e b 0x1a1bc | goto label_6;
| label_18:
0x0001a230 movw sb, 0x117e |
0x0001a234 movt sb, 1 | sb = 0x1117e;
0x0001a238 b 0x1a116 | goto label_1;
| label_15:
0x0001a23a blx 0x9e90 | fcn_00009e90 ();
0x0001a23e nop |
0x0001a240 ldrb r0, [r0, 4] | r0 = *((r0 + 4));
0x0001a242 movs r1, r0 | r1 = r0;
0x0001a244 lsls r0, r4, 0x19 | r0 = r4 << 0x19;
0x0001a246 movs r0, r0 |
0x0001a248 ldrb r2, [r1, 1] | r2 = *((r1 + 1));
0x0001a24a movs r1, r0 | r1 = r0;
0x0001a24c ldrb r4, [r5, 0x1c] | r4 = *((r5 + 0x1c));
0x0001a24e movs r1, r0 | r1 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x19ddc */
| #include <stdint.h>
|
; (fcn) sym.apr_socket_sendto () | void apr_socket_sendto (int16_t arg_28h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int32_t var_0h;
| int32_t var_0h_2;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
| if (? >= ?) {
0x00019ddc ldrbmi lr, [r0, sp, lsr 18]! |
| }
0x00019de0 sub sp, 8 |
0x00019de2 ldr.w sb, [sp, 0x28] | sb = *(arg_28h);
0x00019de6 mov r6, r1 | r6 = r1;
0x00019de8 mov r4, r0 | r4 = r0;
0x00019dea mov r7, r2 | r7 = r2;
0x00019dec mov r8, r3 | r8 = r3;
0x00019dee add.w sl, r1, 0x28 | sl = r1 + 0x28;
0x00019df2 b 0x19e00 |
| while (r2 == r0) {
0x00019df4 blx 0xa580 | r0 = fcn_0000a580 ();
0x00019df8 ldr r3, [r0] | r3 = *(r0);
0x00019dfa mov r5, r0 | r5 = r0;
0x00019dfc cmp r3, 4 |
| if (r3 != 4) {
0x00019dfe bne 0x19e26 | goto label_2;
| }
0x00019e00 ldr r5, [r6, 0x14] | r5 = *((r6 + 0x14));
0x00019e02 mov r3, r7 | r3 = r7;
0x00019e04 ldr.w r2, [sb] | r2 = *(sb);
0x00019e08 mov r1, r8 | r1 = r8;
0x00019e0a ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00019e0c strd sl, r5, [sp] | __asm ("strd sl, r5, [sp]");
0x00019e10 blx 0xa818 | r0 = fcn_0000a818 ();
0x00019e14 adds r2, r0, 1 | r2 = r0 + 1;
0x00019e16 beq 0x19df4 |
| }
| label_1:
0x00019e18 movs r3, 0 | r3 = 0;
0x00019e1a str.w r0, [sb] | __asm ("str.w r0, [sb]");
0x00019e1e mov r0, r3 | r0 = r3;
0x00019e20 add sp, 8 |
0x00019e22 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| do {
| label_2:
0x00019e26 cmp r3, 0xb |
| if (r3 != 0xb) {
0x00019e28 bne 0x19e76 | goto label_3;
| }
0x00019e2a ldrd r2, r3, [r4, 0x18] | __asm ("ldrd r2, r3, [r4, 0x18]");
0x00019e2e cmp r2, 1 |
0x00019e30 sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (r2 < 1) {
0x00019e34 blt 0x19e76 | goto label_3;
| }
0x00019e36 movs r2, 0 | r2 = 0;
0x00019e38 mov r1, r4 | r1 = r4;
0x00019e3a mov r0, r2 | r0 = r2;
0x00019e3c blx 0xa138 | r0 = fcn_0000a138 ();
0x00019e40 mov r3, r0 | r3 = r0;
| if (r0 == 0) {
0x00019e42 cbz r0, 0x19e4c | goto label_4;
| }
0x00019e44 b 0x19e68 | goto label_5;
| label_0:
0x00019e46 ldr r3, [r5] | r3 = *(r5);
0x00019e48 cmp r3, 4 |
0x00019e4a bne 0x19e26 |
| } while (r3 != 4);
| label_4:
0x00019e4c ldr.w ip, [r6, 0x14] | ip = *((r6 + 0x14));
0x00019e50 mov r3, r7 | r3 = r7;
0x00019e52 ldr.w r2, [sb] | r2 = *(sb);
0x00019e56 mov r1, r8 | r1 = r8;
0x00019e58 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00019e5a strd sl, ip, [sp] | __asm ("strd sl, ip, [sp]");
0x00019e5e blx 0xa818 | r0 = fcn_0000a818 ();
0x00019e62 adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x00019e64 beq 0x19e46 | goto label_0;
| }
0x00019e66 b 0x19e18 | goto label_1;
| label_5:
0x00019e68 movs r2, 0 | r2 = 0;
0x00019e6a mov r0, r3 | r0 = r3;
0x00019e6c str.w r2, [sb] | __asm ("str.w r2, [sb]");
0x00019e70 add sp, 8 |
0x00019e72 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_3:
0x00019e76 movs r3, 0 | r3 = 0;
0x00019e78 str.w r3, [sb] | __asm ("str.w r3, [sb]");
0x00019e7c ldr r3, [r5] | r3 = *(r5);
0x00019e7e mov r0, r3 | r0 = r3;
0x00019e80 add sp, 8 |
0x00019e82 pop.w {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x19f84 */
| #include <stdint.h>
|
; (fcn) sym.apr_socket_sendv () | void apr_socket_sendv (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00019f84 push.w {r4, r5, r6, r7, r8, lr} |
0x00019f88 subs r6, r2, 0 | r6 = r2 - 0;
0x00019f8a mov r5, r0 | r5 = r0;
0x00019f8c mov r7, r1 | r7 = r1;
0x00019f8e mov r8, r3 | r8 = r3;
| if (r6 <= r2) {
0x00019f90 ble 0x1a050 | goto label_5;
| }
0x00019f92 mov r3, r1 | r3 = r1;
0x00019f94 add.w r1, r1, r6, lsl 3 | r1 += (r6 << 3);
0x00019f98 movs r4, 0 | r4 = 0;
| do {
0x00019f9a ldr r2, [r3, 4] | r2 = *((r3 + 4));
0x00019f9c adds r3, 8 | r3 += 8;
0x00019f9e cmp r3, r1 |
0x00019fa0 add r4, r2 | r4 += r2;
0x00019fa2 bne 0x19f9a |
| } while (r3 != r1);
| label_4:
0x00019fa4 ldr r3, [r5, 0x30] | r3 = *((r5 + 0x30));
0x00019fa6 lsls r1, r3, 0x12 | r1 = r3 << 0x12;
0x00019fa8 itt mi |
| if (r1 < r3) {
0x00019faa bicmi r3, r3, 0x2000 | __asm ("bicmi r3, r3, aav.0x000000ff");
| }
| if (r1 < r3) {
0x00019fae str r3, [r5, 0x30] | *((r5 + 0x30)) = r3;
| }
| if (r1 < r3) {
0x00019fb0 bmi 0x1a00e | goto label_6;
| }
0x00019fb2 b 0x19fbe |
| while (r2 == r0) {
0x00019fb4 blx 0xa580 | r0 = fcn_0000a580 ();
0x00019fb8 ldr r3, [r0] | r3 = *(r0);
0x00019fba cmp r3, 4 |
| if (r3 != 4) {
0x00019fbc bne 0x19ff0 | goto label_0;
| }
0x00019fbe mov r2, r6 | r2 = r6;
0x00019fc0 ldr r0, [r5, 4] | r0 = *((r5 + 4));
0x00019fc2 mov r1, r7 | r1 = r7;
0x00019fc4 blx 0xa73c | r0 = fcn_0000a73c ();
0x00019fc8 adds r2, r0, 1 | r2 = r0 + 1;
0x00019fca beq 0x19fb4 |
| }
0x00019fcc ldrd r2, r3, [r5, 0x18] | __asm ("ldrd r2, r3, [r5, 0x18]");
0x00019fd0 cmp r2, 1 |
0x00019fd2 sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (r2 >= 1) {
0x00019fd6 blt 0x19fe4 |
| label_2:
0x00019fd8 cmp r4, r0 |
0x00019fda ittt hi |
| if (r4 <= r0) {
0x00019fdc ldrhi r3, [r5, 0x30] | r3 = *((r5 + 0x30));
| }
| if (r4 <= r0) {
0x00019fde orrhi r3, r3, 0x2000 | r3 |= 0x2000;
| }
| if (r4 <= r0) {
0x00019fe2 str r3, [r5, 0x30] | *((r5 + 0x30)) = r3;
| goto label_3;
| }
| }
| label_3:
0x00019fe4 movs r3, 0 | r3 = 0;
0x00019fe6 str.w r0, [r8] | __asm ("str.w r0, [r8]");
0x00019fea mov r0, r3 | r0 = r3;
0x00019fec pop.w {r4, r5, r6, r7, r8, pc} |
| label_0:
0x00019ff0 cmp r3, 0xb |
0x00019ff2 beq 0x1a002 |
| while (r2 < 1) {
0x00019ff4 movs r3, 0 | r3 = 0;
0x00019ff6 str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x00019ffa ldr r3, [r0] | r3 = *(r0);
0x00019ffc mov r0, r3 | r0 = r3;
0x00019ffe pop.w {r4, r5, r6, r7, r8, pc} |
0x0001a002 ldrd r2, r3, [r5, 0x18] | __asm ("ldrd r2, r3, [r5, 0x18]");
0x0001a006 cmp r2, 1 |
0x0001a008 sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
0x0001a00c blt 0x19ff4 |
| }
| label_6:
0x0001a00e movs r2, 0 | r2 = 0;
0x0001a010 mov r1, r5 | r1 = r5;
0x0001a012 mov r0, r2 | r0 = r2;
0x0001a014 blx 0xa138 | r0 = fcn_0000a138 ();
0x0001a018 mov r3, r0 | r3 = r0;
| if (r0 == 0) {
0x0001a01a cbz r0, 0x1a028 | goto label_7;
| }
0x0001a01c b 0x1a044 | goto label_8;
| label_1:
0x0001a01e blx 0xa580 | r0 = fcn_0000a580 ();
0x0001a022 ldr r3, [r0] | r3 = *(r0);
0x0001a024 cmp r3, 4 |
| if (r3 != 4) {
0x0001a026 bne 0x19ff0 | goto label_0;
| }
| label_7:
0x0001a028 ldr r0, [r5, 4] | r0 = *((r5 + 4));
0x0001a02a mov r2, r6 | r2 = r6;
0x0001a02c mov r1, r7 | r1 = r7;
0x0001a02e blx 0xa73c | r0 = fcn_0000a73c ();
0x0001a032 adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x0001a034 beq 0x1a01e | goto label_1;
| }
0x0001a036 ldrd r2, r3, [r5, 0x18] | __asm ("ldrd r2, r3, [r5, 0x18]");
0x0001a03a cmp r2, 1 |
0x0001a03c sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (r2 >= 1) {
0x0001a040 bge 0x19fd8 | goto label_2;
| }
0x0001a042 b 0x19fe4 | goto label_3;
| label_8:
0x0001a044 movs r2, 0 | r2 = 0;
0x0001a046 mov r0, r3 | r0 = r3;
0x0001a048 str.w r2, [r8] | __asm ("str.w r2, [r8]");
0x0001a04c pop.w {r4, r5, r6, r7, r8, pc} |
| label_5:
0x0001a050 movs r4, 0 | r4 = 0;
0x0001a052 b 0x19fa4 | goto label_4;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x13148 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) sym.apr_table_compress () | void apr_table_compress (int16_t arg_0h, int16_t arg1, uint32_t arg2) {
| int16_t var_4h_2;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h_2;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| int16_t var_20h;
| uint32_t var_24h;
| r0 = arg1;
| r1 = arg2;
0x00013148 cmp r1, 2 |
0x0001314a push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001314e sub sp, 0x2c |
0x00013150 str r1, [sp, 0x24] | var_24h = r1;
0x00013152 str r0, [sp, 0x1c] | var_1ch = r0;
| if (r1 == 2) {
0x00013154 beq.w 0x132b2 | goto label_8;
| }
0x00013158 ldr r1, [r0, 8] | r1 = *((r0 + 8));
0x0001315a mov r4, r0 | r4 = r0;
0x0001315c cmp r1, 1 |
| if (r1 <= 1) {
0x0001315e ble.w 0x132b2 | goto label_8;
| }
0x00013162 lsls r1, r1, 2 | r1 <<= 2;
0x00013164 ldr r0, [r0] | r0 = *(r0);
0x00013166 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001316a mov r3, r4 | r3 = r4;
0x0001316c ldr r4, [r4, 8] | r4 = *((r4 + 8));
0x0001316e ldr r2, [r3, 0x10] | r2 = *((r3 + 0x10));
0x00013170 mov sl, r0 | sl = r0;
0x00013172 mov r1, r0 | r1 = r0;
0x00013174 mov r0, r4 | r0 = r4;
0x00013176 str r4, [sp, 8] | var_8h = r4;
| do {
0x00013178 subs r0, 1 | r0--;
0x0001317a str r2, [r1], 4 | *(r1) = r2;
| r1 += 4;
0x0001317e add.w r2, r2, 0xc | r2 += 0xc;
0x00013182 bne 0x13178 |
| } while (r0 != 1);
0x00013184 ldr r4, [sp, 8] | r4 = var_8h;
0x00013186 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00013188 str r0, [sp, 0x20] | var_20h = r0;
0x0001318a lsls r1, r4, 2 | r1 = r4 << 2;
0x0001318c ldr r0, [r3] | r0 = *(r3);
0x0001318e blx 0xa0d0 | fcn_0000a0d0 ();
0x00013192 cmp r4, 1 |
0x00013194 str r0, [sp, 0x18] | var_18h = r0;
| if (r4 < 1) {
0x00013196 bls.w 0x132e2 | goto label_9;
| }
0x0001319a ldr r3, [sp, 8] | r3 = var_8h;
0x0001319c add.w r5, sl, 4 | r5 = sl + 4;
0x000131a0 ldr r4, [sp, 0x20] | r4 = var_20h;
0x000131a2 mov r8, r5 | r8 = r5;
0x000131a4 subs r6, r3, 2 | r6 = r3 - 2;
0x000131a6 bic r6, r6, 1 | r6 = BIT_MASK (r6, 1);
0x000131aa adds r6, 2 | r6 += 2;
| do {
0x000131ac ldr.w r7, [sl, r4, lsl 2] | offset_0 = r4 << 2;
| r7 = *((sl + offset_0));
0x000131b0 ldr.w r5, [r8, r4, lsl 2] | offset_1 = r4 << 2;
| r5 = *((r8 + offset_1));
0x000131b4 ldr r0, [r7] | r0 = *(r7);
0x000131b6 ldr r1, [r5] | r1 = *(r5);
0x000131b8 blx 0x9f94 | r0 = fcn_00009f94 ();
0x000131bc cmp r0, 0 |
0x000131be itt gt |
| if (r0 <= 0) {
0x000131c0 strgt r5, [sl, r4, lsl 2] | offset_2 = r4 << 2;
| *((sl + offset_2)) = r5;
| }
| if (r0 > 0) {
0x000131c4 str.w r7, [r8, r4, lsl 2] | __asm ("str.w r7, [r8, r4, lsl 2]");
| }
0x000131c8 adds r4, 2 | r4 += 2;
0x000131ca cmp r6, r4 |
0x000131cc bne 0x131ac |
| } while (r6 != r4);
0x000131ce ldr r3, [sp, 8] | r3 = var_8h;
0x000131d0 cmp r3, 2 |
0x000131d2 itt hi |
| if (r3 <= 2) {
0x000131d4 movhi r3, 2 | r3 = 2;
| }
| if (r3 <= 2) {
0x000131d6 strhi r3, [sp, 0x14] | var_14h = r3;
| }
| if (r3 < 2) {
0x000131d8 bls.w 0x132e2 | goto label_9;
| }
| label_1:
0x000131dc ldr r2, [sp, 0x14] | r2 = var_14h;
0x000131de mov r3, r2 | r3 = r2;
0x000131e0 str r2, [sp, 0xc] | var_ch = r2;
0x000131e2 lsls r2, r2, 1 | r2 <<= 1;
0x000131e4 str r2, [sp, 0x14] | var_14h = r2;
0x000131e6 ldr r2, [sp, 8] | r2 = var_8h;
0x000131e8 cmp r2, r3 |
0x000131ea it ls |
| if (r2 > r3) {
0x000131ec movls r3, 0 | r3 = 0;
| }
| if (r2 < r3) {
0x000131ee bls 0x13286 | goto label_10;
| }
0x000131f0 ldr r4, [sp, 0x18] | r4 = var_18h;
0x000131f2 movs r3, 0 | r3 = 0;
0x000131f4 ldr.w r8, [sp, 0xc] | r8 = var_ch;
0x000131f8 str r3, [sp, 4] | var_4h_2 = r3;
| label_0:
0x000131fa ldr r3, [sp, 0xc] | r3 = var_ch;
0x000131fc ldr r2, [sp, 8] | r2 = var_8h;
0x000131fe ldr r7, [sp, 4] | r7 = var_4h_2;
0x00013200 add r3, r8 | r3 += r8;
0x00013202 cmp r2, r3 |
0x00013204 str r3, [sp, 0x10] | var_10h_2 = r3;
0x00013206 it hs |
| if (r2 < r3) {
0x00013208 movhs r2, r3 | r2 = r3;
| }
0x0001320a cmp r8, r7 |
0x0001320c mov sb, r2 | sb = r2;
| if (r8 == r7) {
0x0001320e beq 0x132de | goto label_11;
| }
0x00013210 cmp r2, r8 |
| if (r2 == r8) {
0x00013212 beq 0x132b8 | goto label_12;
| }
0x00013214 mov r6, r8 | r6 = r8;
0x00013216 b 0x1321c |
| while (r7 != r8) {
0x00013218 cmp r6, sb |
| if (r6 == sb) {
0x0001321a beq 0x132ba | goto label_13;
| }
0x0001321c ldr.w fp, [sl, r7, lsl 2] | offset_3 = r7 << 2;
| fp = *((sl + offset_3));
0x00013220 adds r4, 4 | r4 += 4;
0x00013222 ldr.w r5, [sl, r6, lsl 2] | offset_4 = r6 << 2;
| r5 = *((sl + offset_4));
0x00013226 ldr.w r0, [fp] | r0 = *(fp);
0x0001322a ldr r1, [r5] | r1 = *(r5);
0x0001322c blx 0x9f94 | r0 = fcn_00009f94 ();
0x00013230 cmp r0, 0 |
0x00013232 itte le |
| if (r0 > 0) {
0x00013234 addle r7, 1 | r7++;
| }
| if (r0 > 0) {
0x00013236 movle r5, fp | r5 = fp;
| }
| if (r0 <= 0) {
0x00013238 addgt r6, 1 | r6++;
| }
0x0001323a cmp r7, r8 |
0x0001323c str r5, [r4, -0x4] | *((r4 - 0x4)) = r5;
0x00013240 bne 0x13218 |
| }
| label_3:
0x00013242 cmp sb, r6 |
| if (sb < r6) {
0x00013244 bls 0x13264 | goto label_2;
| }
0x00013246 add.w r3, sl, r6, lsl 2 | r3 = sl + (r6 << 2);
0x0001324a add.w r5, sl, sb, lsl 2 | r5 = sl + (sb << 2);
0x0001324e subs r1, r4, 4 | r1 = r4 - 4;
| do {
0x00013250 ldr r2, [r3], 4 | r2 = *(r3);
| r3 += 4;
0x00013254 cmp r5, r3 |
0x00013256 str r2, [r1, 4]! | *((r1 += 4)) = r2;
0x0001325a bne 0x13250 |
| } while (r5 != r3);
0x0001325c sub.w sb, sb, r6 | sb -= r6;
0x00013260 add.w r4, r4, sb, lsl 2 | r4 += (sb << 2);
| label_2:
0x00013264 ldrd r2, r3, [sp, 0xc] | __asm ("ldrd r2, r3, [var_ch]");
0x00013268 add r3, r2 | r3 += r2;
0x0001326a ldr r2, [sp, 0x14] | r2 = var_14h;
0x0001326c mov r8, r3 | r8 = r3;
0x0001326e ldr r3, [sp, 4] | r3 = var_4h_2;
0x00013270 add r3, r2 | r3 += r2;
0x00013272 str r3, [sp, 4] | var_4h_2 = r3;
0x00013274 ldr r3, [sp, 8] | r3 = var_8h;
0x00013276 cmp r3, r8 |
| if (r3 > r8) {
0x00013278 bhi 0x131fa | goto label_0;
| }
0x0001327a ldr r3, [sp, 0x18] | r3 = var_18h;
0x0001327c ldr r2, [sp, 8] | r2 = var_8h;
0x0001327e subs r3, r4, r3 | r3 = r4 - r3;
0x00013280 asrs r3, r3, 2 | r3 >>= 2;
0x00013282 cmp r2, r3 |
| if (r2 < r3) {
0x00013284 bls 0x132a0 | goto label_14;
| }
| label_10:
0x00013286 ldr r2, [sp, 0x18] | r2 = var_18h;
0x00013288 lsls r1, r3, 2 | r1 = r3 << 2;
0x0001328a ldr r4, [sp, 8] | r4 = var_8h;
0x0001328c add.w r0, sl, r1 | r0 = sl + r1;
0x00013290 add r1, r2 | r1 += r2;
| do {
0x00013292 ldr r2, [r0], 4 | r2 = *(r0);
| r0 += 4;
0x00013296 adds r3, 1 | r3++;
0x00013298 cmp r4, r3 |
0x0001329a str r2, [r1], 4 | *(r1) = r2;
| r1 += 4;
0x0001329e bhi 0x13292 |
| } while (r4 > r3);
| label_14:
0x000132a0 ldr r3, [sp, 8] | r3 = var_8h;
0x000132a2 ldr r2, [sp, 0x14] | r2 = var_14h;
0x000132a4 cmp r3, r2 |
| if (r3 < r2) {
0x000132a6 bls 0x132e6 | goto label_15;
| }
0x000132a8 mov r3, sl | r3 = sl;
0x000132aa ldr.w sl, [sp, 0x18] | sl = var_18h;
0x000132ae str r3, [sp, 0x18] | var_18h = r3;
0x000132b0 b 0x131dc | goto label_1;
| label_8:
0x000132b2 add sp, 0x2c |
0x000132b4 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_12:
0x000132b8 ldr r7, [sp, 4] | r7 = var_4h_2;
| label_13:
0x000132ba cmp r8, r7 |
| if (r8 < r7) {
0x000132bc bls 0x13264 | goto label_2;
| }
0x000132be add.w r3, sl, r7, lsl 2 | r3 = sl + (r7 << 2);
0x000132c2 add.w r5, sl, r8, lsl 2 | r5 = sl + (r8 << 2);
0x000132c6 subs r1, r4, 4 | r1 = r4 - 4;
| do {
0x000132c8 ldr r2, [r3], 4 | r2 = *(r3);
| r3 += 4;
0x000132cc cmp r3, r5 |
0x000132ce str r2, [r1, 4]! | *((r1 += 4)) = r2;
0x000132d0 cmp r7, 4 |
0x000132d2 bne 0x132c8 |
| } while (r7 != 4);
0x000132d4 sub.w r7, r8, r7 | r7 = r8 - r7;
0x000132d8 add.w r4, r4, r7, lsl 2 | r4 += (r7 << 2);
0x000132dc b 0x13264 | goto label_2;
| label_11:
0x000132de ldr r6, [sp, 4] | r6 = var_4h_2;
0x000132e0 b 0x13242 | goto label_3;
| label_9:
0x000132e2 str.w sl, [sp, 0x18] | __asm ("str.w sl, [var_18h]");
| label_15:
0x000132e6 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x000132e8 ldr r2, [sp, 0x18] | r2 = var_18h;
0x000132ea ldr r3, [r3, 8] | r3 = *((r3 + 8));
0x000132ec adds r7, r2, 4 | r7 = r2 + 4;
0x000132ee add.w sb, r2, r3, lsl 2 | sb = r2 + (r3 << 2);
0x000132f2 cmp sb, r7 |
| if (sb < r7) {
0x000132f4 bls 0x133f6 | goto label_16;
| }
0x000132f6 mov sl, r2 | sl = r2;
0x000132f8 str.w sb, [sp, 4] | __asm ("str.w sb, [var_4h_2]");
| do {
0x000132fc mov r4, r7 | r4 = r7;
0x000132fe ldr.w r3, [sl] | r3 = *(sl);
0x00013302 ldr r6, [r4], 4 | r6 = *(r4);
| r4 += 4;
0x00013306 ldr.w fp, [r3, 8] | fp = *((r3 + 8));
0x0001330a ldr r2, [r6, 8] | r2 = *((r6 + 8));
0x0001330c cmp r2, fp |
| if (r2 == fp) {
0x0001330e beq 0x1331c | goto label_17;
| }
| label_4:
0x00013310 ldr r3, [sp, 4] | r3 = var_4h_2;
0x00013312 mov sl, r7 | sl = r7;
0x00013314 cmp r3, r4 |
| if (r3 < r4) {
0x00013316 bls 0x133b6 | goto label_18;
| }
| label_5:
0x00013318 mov r7, r4 | r7 = r4;
0x0001331a b 0x132fc |
| } while (1);
| label_17:
0x0001331c ldr.w sb, [r3] | sb = *(r3);
0x00013320 ldr r0, [r6] | r0 = *(r6);
0x00013322 str r3, [sp, 8] | var_8h = r3;
0x00013324 mov r1, sb | r1 = sb;
0x00013326 blx 0x9f94 | fcn_00009f94 ();
0x00013328 vadd.f64 d9, d6, d2 | __asm ("vadd.f64 d9, d6, d2");
0x0001332c cmp r0, 0 |
| if (r0 != 0) {
0x0001332e bne 0x13310 | goto label_4;
| }
0x00013330 ldr r2, [sp, 4] | r2 = var_4h_2;
0x00013332 cmp r2, r4 |
| if (r2 < r4) {
0x00013334 bls.w 0x1347a | goto label_19;
| }
0x00013338 mov r8, r3 | r8 = r3;
0x0001333a mov r3, r6 | r3 = r6;
0x0001333c mov r5, r4 | r5 = r4;
0x0001333e mov r6, sb | r6 = sb;
0x00013340 strd r7, r4, [sp, 8] | __asm ("strd r7, r4, [sp, 8]");
0x00013344 mov sb, r3 | sb = r3;
0x00013346 mov r4, r2 | r4 = r2;
0x00013348 b 0x13358 |
| while (fp == r0) {
0x0001334a ldr r0, [r3] | r0 = *(r3);
0x0001334c blx 0x9f94 | fcn_00009f94 ();
0x00013350 mov r1, r5 | r1 = r5;
| if (r0 != 0) {
0x00013352 cbnz r0, 0x13366 | goto label_20;
| }
0x00013354 cmp r4, r5 |
| if (r4 < r5) {
0x00013356 bls 0x13402 | goto label_21;
| }
0x00013358 ldr r3, [r5] | r3 = *(r5);
0x0001335a mov r7, r5 | r7 = r5;
0x0001335c mov r1, r6 | r1 = r6;
0x0001335e adds r5, 4 | r5 += 4;
0x00013360 ldr r0, [r3, 8] | r0 = *((r3 + 8));
0x00013362 cmp fp, r0 |
0x00013364 beq 0x1334a |
| }
| label_20:
0x00013366 mov r3, r8 | r3 = r8;
0x00013368 ldr r4, [sp, 0xc] | r4 = var_ch;
0x0001336a mov r8, r7 | r8 = r7;
0x0001336c ldr r7, [sp, 8] | r7 = var_8h;
0x0001336e mov r1, r8 | r1 = r8;
0x00013370 mov r6, sb | r6 = sb;
0x00013372 sub.w r8, r8, 4 | r8 -= 4;
| label_6:
0x00013376 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00013378 cmp r2, 1 |
| if (r2 == 1) {
0x0001337a beq 0x1340e | goto label_22;
| }
0x0001337c ldr r2, [r1, -0x4] | r2 = *((r1 - 0x4));
0x00013380 ldr r2, [r2, 4] | r2 = *((r2 + 4));
0x00013382 str r2, [r3, 4] | *((r3 + 4)) = r2;
0x00013384 b 0x1338a |
| while (r4 < r8) {
0x00013386 ldr r6, [r4], 4 | r6 = *(r4);
| r4 += 4;
| label_7:
0x0001338a cmp r4, r8 |
0x0001338c mov.w r3, 0 | r3 = 0;
0x00013390 str r3, [r6] | *(r6) = r3;
0x00013392 bls 0x13386 |
| }
0x00013394 sub.w r4, r8, r7 | r4 = r8 - r7;
0x00013398 adds r3, r7, 1 | r3 = r7 + 1;
0x0001339a bic r4, r4, 3 | r4 = BIT_MASK (r4, 3);
0x0001339e add.w r8, r8, 1 | r8++;
0x000133a2 adds r4, 4 | r4 += 4;
0x000133a4 cmp r8, r3 |
0x000133a6 it lo |
| if (r8 >= r3) {
0x000133a8 movlo r4, 4 | r4 = 4;
| }
0x000133aa movs r3, 1 | r3 = 1;
0x000133ac str r3, [sp, 0x20] | var_20h = r3;
0x000133ae add r4, r7 | r4 += r7;
0x000133b0 ldr r3, [sp, 4] | r3 = var_4h_2;
0x000133b2 cmp r3, r4 |
| if (r3 > r4) {
0x000133b4 bhi 0x13318 | goto label_5;
| }
| label_18:
0x000133b6 ldr r3, [sp, 0x20] | r3 = var_20h;
| if (r3 == 0) {
0x000133b8 cbz r3, 0x133f6 | goto label_16;
| }
0x000133ba ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x000133bc ldr r7, [r3, 8] | r7 = *((r3 + 8));
0x000133be ldr r4, [r3, 0x10] | r4 = *((r3 + 0x10));
0x000133c0 add.w r5, r7, r7, lsl 1 | r5 = r7 + (r7 << 1);
0x000133c4 add.w r3, r4, 0xc | r3 = r4 + 0xc;
0x000133c8 add.w r5, r4, r5, lsl 2 | r5 = r4 + (r5 << 2);
| do {
0x000133cc ldr r2, [r3, -0xc] | r2 = *((r3 - 0xc));
0x000133d0 mov r6, r3 | r6 = r3;
| if (r2 != 0) {
0x000133d2 cbz r2, 0x133de |
0x000133d4 ldmdb r3, {r0, r1, r2} | __asm ("ldmdb r3, {r0, r1, r2}");
0x000133d8 stm.w r4, {r0, r1, r2} | *(r4) = r0;
| *((r4 + 4)) = r1;
| *((r4 + 8)) = r2;
0x000133dc adds r4, 0xc | r4 += 0xc;
| }
0x000133de cmp r5, r6 |
0x000133e0 add.w r3, r3, 0xc | r3 += 0xc;
0x000133e4 bhi 0x133cc |
| } while (r5 > r6);
0x000133e6 subs r3, r5, r4 | r3 = r5 - r4;
0x000133e8 mov.w r2, 0x55555555 | r2 = 0x55555555;
0x000133ec asrs r3, r3, 2 | r3 >>= 2;
0x000133ee mla r7, r2, r3, r7 | __asm ("mla r7, r2, r3, r7");
0x000133f2 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x000133f4 str r7, [r3, 8] | *((r3 + 8)) = r7;
| label_16:
0x000133f6 ldr r0, [sp, 0x1c] | r0 = var_1ch;
0x000133f8 add sp, 0x2c |
0x000133fa pop.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000133fe b.w 0x1249c | void (*0x1249c)() ();
| label_21:
0x00013402 mov r3, r8 | r3 = r8;
0x00013404 ldr r4, [sp, 0xc] | r4 = var_ch;
0x00013406 mov r8, r7 | r8 = r7;
0x00013408 mov r6, sb | r6 = sb;
0x0001340a ldr r7, [sp, 8] | r7 = var_8h;
0x0001340c b 0x13376 | goto label_6;
| label_22:
0x0001340e add.w r6, sl, 4 | r6 = sl + 4;
0x00013412 movs r5, 0 | r5 = 0;
0x00013414 b 0x1341a |
| while (r6 < r8) {
0x00013416 ldr r3, [r6], 4 | r3 = *(r6);
| r6 += 4;
0x0001341a ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x0001341c blx 0xa40c | fcn_0000a40c ();
0x00013420 cmp r6, r8 |
0x00013422 add.w r3, r0, 2 | r3 = r0 + 2;
0x00013426 add r5, r3 | r5 += r3;
0x00013428 bls 0x13416 |
| }
0x0001342a ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x0001342c mov r1, r5 | r1 = r5;
0x0001342e mov fp, sl |
0x00013430 ldr r0, [r3] | r0 = *(r3);
0x00013432 blx 0xa0d0 | r0 = fcn_0000a0d0 ();
0x00013436 mov r5, r0 | r5 = r0;
0x00013438 mov r6, r0 | r6 = r0;
0x0001343a b 0x13446 |
| while (fp < r8) {
0x0001343c mov.w r0, 0x2c | r0 = 0x2c;
0x00013440 strb r0, [r6, r3] | *((r6 + r3)) = r0;
0x00013442 adds r6, r1, 2 | r6 = r1 + 2;
0x00013444 strb r2, [r1, 1] | *((r1 + 1)) = r2;
0x00013446 ldr.w r3, [fp] | r3 = *(fp);
0x0001344a mov r0, r6 | r0 = r6;
0x0001344c ldr r1, [r3, 4] | r1 = *((r3 + 4));
0x0001344e blx 0xa12c | fcn_0000a12c ();
0x00013452 ldr r3, [fp], 4 | r3 = *(fp);
| fp += 4;
0x00013456 ldr r0, [r3, 4] | r0 = *((r3 + 4));
0x00013458 blx 0xa40c | fcn_0000a40c ();
0x0001345c cmp fp, r8 |
0x0001345e mov r3, r0 | r3 = r0;
0x00013460 add.w r1, r6, r0 | r1 = r6 + r0;
0x00013464 mov.w r2, 0x20 | r2 = 0x20;
0x00013468 bls 0x1343c |
| }
0x0001346a mov.w r3, 0 | r3 = 0;
0x0001346e strb r3, [r1] | *(r1) = r3;
0x00013470 ldr.w r3, [sl] | r3 = *(sl);
0x00013474 ldr r6, [r7] | r6 = *(r7);
0x00013476 str r5, [r3, 4] | *((r3 + 4)) = r5;
0x00013478 b 0x1338a | goto label_7;
| label_19:
0x0001347a mov r8, r7 | r8 = r7;
0x0001347c mov r1, r4 | r1 = r4;
0x0001347e b 0x13376 | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1284c */
| #include <stdint.h>
|
; (fcn) sym.apr_table_copy () | void apr_table_copy (int16_t arg1, int16_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x0001284c push {r3, r4, r5, r6, r7, lr} |
0x0001284e mov r5, r1 | r5 = r1;
0x00012850 mov.w r1, 0x118 | r1 = 0x118;
0x00012854 mov r7, r0 | r7 = r0;
0x00012856 blx 0xa0d0 | fcn_0000a0d0 ();
0x0001285a ldr r6, [r5, 0xc] | r6 = *((r5 + 0xc));
0x0001285c mov r4, r0 | r4 = r0;
0x0001285e mov r0, r7 | r0 = r7;
0x00012860 cmp r6, 1 |
0x00012862 it lt |
| if (r6 >= 1) {
0x00012864 movlt r6, 1 | r6 = 1;
| }
0x00012866 add.w r1, r6, r6, lsl 1 | r1 = r6 + (r6 << 1);
0x0001286a lsls r1, r1, 2 | r1 <<= 2;
0x0001286c blx 0xa0d0 | fcn_0000a0d0 ();
0x00012870 movs r3, 0xc | r3 = 0xc;
0x00012872 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
0x00012874 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00012876 movs r3, 0 | r3 = 0;
0x00012878 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x0001287a ldr r2, [r5, 8] | r2 = *((r5 + 8));
0x0001287c ldr r1, [r5, 0x10] | r1 = *((r5 + 0x10));
0x0001287e str r6, [r4, 0xc] | *((r4 + 0xc)) = r6;
0x00012880 movs r6, 0x80 | r6 = 0x80;
0x00012882 str r7, [r4] | *(r4) = r7;
0x00012884 add.w r2, r2, r2, lsl 1 | r2 += (r2 << 1);
0x00012888 lsls r2, r2, 2 | r2 <<= 2;
0x0001288a blx 0x9cf8 | fcn_00009cf8 ();
0x0001288e ldr r3, [r5, 8] | r3 = *((r5 + 8));
0x00012890 mov r2, r6 | r2 = r6;
0x00012892 add.w r1, r5, 0x18 | r1 = r5 + 0x18;
0x00012896 add.w r0, r4, 0x18 | r0 = r4 + 0x18;
0x0001289a str r3, [r4, 8] | *((r4 + 8)) = r3;
0x0001289c blx 0x9cf8 | fcn_00009cf8 ();
0x000128a0 mov r2, r6 | r2 = r6;
0x000128a2 add.w r1, r5, 0x98 | r1 = r5 + 0x98;
0x000128a6 add.w r0, r4, 0x98 | r0 = r4 + 0x98;
0x000128aa blx 0x9cf8 | fcn_00009cf8 ();
0x000128ae ldr r3, [r5, 0x14] | r3 = *((r5 + 0x14));
0x000128b0 mov r0, r4 | r0 = r4;
0x000128b2 str r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
0x000128b4 pop {r3, r4, r5, r6, r7, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x12938 */
| #include <stdint.h>
|
| #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \
| ((n & 0x0000ff00) << 8) | \
| ((n & 0x00ff0000) >> 8) | \
| ((n & 0xff000000) >> 24)))
|
; (fcn) sym.apr_table_set () | void apr_table_set (int16_t arg_0h, int16_t arg_4h, int16_t arg_8h, int16_t arg_ch, int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_0h;
| int16_t var_4h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00012938 svcmi 0xf0e92d | __asm ("svcmi aav.0x000000ff");
0x0001293c mov sl, r1 | sl = r1;
0x0001293e ldrb r1, [r1] | r1 = *(r1);
0x00012940 sub sp, 0xc |
0x00012942 mov r7, r0 | r7 = r0;
0x00012944 mov sb, r2 | sb = r2;
0x00012946 mov r4, r1 | r4 = r1;
| if (r1 != 0) {
0x00012948 cbz r1, 0x12970 |
0x0001294a ldrh.w r2, [sl] | r2 = *(sl);
0x0001294e ldrb.w r0, [sl, 1] | r0 = *((sl + 1));
0x00012952 rev16 r2, r2 | __asm ("rev16 r2, r2");
0x00012954 uxth r2, r2 | r2 = (int16_t) r2;
0x00012956 cmp r0, 0 |
| if (r0 == 0) {
0x00012958 beq.w 0x12a90 | goto label_6;
| }
0x0001295c ldrb.w r0, [sl, 2] | r0 = *((sl + 2));
0x00012960 cmp r0, 0 |
| if (r0 == 0) {
0x00012962 beq.w 0x12a90 | goto label_6;
| }
0x00012966 ldr.w r4, [sl] | r4 = *(sl);
0x0001296a rev r4, r4 | r4 = SWAP32 (r4);
0x0001296c and r4, r4, 0xdfdfdfdf | r4 &= 0xdfdfdfdf;
| }
| label_3:
0x00012970 and r8, r1, 0x1f | r8 = r1 & 0x1f;
0x00012974 movs r2, 1 | r2 = 1;
0x00012976 ldr r1, [r7, 0x14] | r1 = *((r7 + 0x14));
0x00012978 lsl.w r2, r2, r8 | r2 <<= r8;
0x0001297c ldr r3, [r7, 8] | r3 = *((r7 + 8));
0x0001297e tst r1, r2 |
0x00012980 str r3, [sp] | *(sp) = r3;
| if ((r1 & r2) == 0) {
0x00012982 beq 0x12a36 | goto label_7;
| }
0x00012984 add.w r1, r7, r8, lsl 2 | r1 = r7 + (r8 << 2);
0x00012988 ldr r3, [r7, 0x10] | r3 = *((r7 + 0x10));
0x0001298a ldr r2, [r1, 0x18] | r2 = *((r1 + 0x18));
0x0001298c ldr.w r5, [r1, 0x98] | r5 = *((r1 + 0x98));
0x00012990 str r3, [sp, 4] | var_4h = r3;
0x00012992 add.w r2, r2, r2, lsl 1 | r2 += (r2 << 1);
0x00012996 add.w r5, r5, r5, lsl 1 | r5 += (r5 << 1);
0x0001299a add.w fp, r3, r2, lsl 2 |
0x0001299e add.w r5, r3, r5, lsl 2 | r5 = r3 + (r5 << 2);
0x000129a2 cmp fp, r5 |
| if (fp < r5) {
0x000129a4 bls 0x129b0 | goto label_8;
| }
0x000129a6 b 0x12a42 | goto label_9;
| do {
| label_0:
0x000129a8 add.w fp, fp, 0xc |
0x000129ac cmp r5, fp |
| if (r5 <= fp) {
0x000129ae blo 0x12a42 | goto label_9;
| }
| label_8:
0x000129b0 ldr.w r1, [fp, 8] | r1 = *(arg_8h);
0x000129b4 cmp r1, r4 |
0x000129b6 bne 0x129a8 |
| } while (r1 != r4);
0x000129b8 ldr.w r0, [fp] | r0 = *(fp);
0x000129bc mov r1, sl | r1 = sl;
0x000129be blx 0x9f94 | r0 = fcn_00009f94 ();
0x000129c2 mov r6, r0 | r6 = r0;
0x000129c4 cmp r0, 0 |
| if (r0 != 0) {
0x000129c6 bne 0x129a8 | goto label_0;
| }
0x000129c8 ldr r0, [r7] | r0 = *(r7);
0x000129ca mov r1, sb | r1 = sb;
0x000129cc add.w r8, fp, 0xc | r8 += arg_ch;
0x000129d0 blx 0xa41c | fcn_0000a41c ();
0x000129d4 cmp r5, r8 |
0x000129d6 str.w r0, [fp, 4] | __asm ("str.w r0, [arg_4h]");
| if (r5 <= r8) {
0x000129da blo 0x12a6c | goto label_4;
| }
0x000129dc mov sb, r6 | sb = r6;
| do {
0x000129de ldr.w r2, [r8, 8] | r2 = *((r8 + 8));
0x000129e2 cmp r2, r4 |
| if (r2 == r4) {
0x000129e4 beq 0x12a72 | goto label_10;
| }
| label_1:
0x000129e6 cmp.w sb, 0 |
| if (sb != 0) {
0x000129ea beq 0x129fa |
0x000129ec ldm.w r8, {r0, r1, r2} | r0 = *(r8);
| r1 = *((r8 + 4));
| r2 = *((r8 + 8));
0x000129f0 movs r6, 1 | r6 = 1;
0x000129f2 stm.w sb, {r0, r1, r2} | *(sb) = r0;
| *((sb + 4)) = r1;
| *((sb + 8)) = r2;
0x000129f6 add.w sb, sb, 0xc | sb += 0xc;
| }
| label_2:
0x000129fa add.w r8, r8, 0xc | r8 += 0xc;
0x000129fe cmp r5, r8 |
0x00012a00 bhs 0x129de |
| } while (r5 >= r8);
0x00012a02 cmp.w sb, 0 |
| if (sb == 0) {
0x00012a06 beq 0x12a98 | goto label_11;
| }
0x00012a08 ldr r3, [sp] | r3 = *(sp);
0x00012a0a add.w fp, r3, r3, lsl 1 |
0x00012a0e ldr r3, [sp, 4] | r3 = var_4h;
0x00012a10 add.w sl, r3, fp, lsl 2 | sl = r3 + (fp << 2);
0x00012a14 cmp sl, r8 |
| if (sl < r8) {
0x00012a16 bls 0x12a2c | goto label_5;
| }
| do {
0x00012a18 ldm.w r8, {r0, r1, r2} | r0 = *(r8);
| r1 = *((r8 + 4));
| r2 = *((r8 + 8));
0x00012a1c add.w r8, r8, 0xc | r8 += 0xc;
0x00012a20 cmp sl, r8 |
0x00012a22 add.w sb, sb, 0xc | sb += 0xc;
0x00012a26 stmdb sb, {r0, r1, r2} | __asm ("stmdb sb, {r0, r1, r2}");
0x00012a2a bhi 0x12a18 |
| } while (sl > r8);
| label_5:
0x00012a2c mov r0, r7 | r0 = r7;
0x00012a2e add sp, 0xc |
0x00012a30 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012a34 b 0x1249c | void (*0x1249c)() ();
| label_7:
0x00012a36 orrs r1, r2 | r1 |= r2;
0x00012a38 add.w r2, r8, 6 | r2 = r8 + 6;
0x00012a3c str.w r3, [r7, r2, lsl 2] | __asm ("str.w r3, [r7, r2, lsl 2]");
0x00012a40 str r1, [r7, 0x14] | *((r7 + 0x14)) = r1;
| label_9:
0x00012a42 ldr r3, [sp] | r3 = *(sp);
0x00012a44 add.w r8, r8, 0x26 | r8 += 0x26;
0x00012a48 mov r0, r7 | r0 = r7;
0x00012a4a str.w r3, [r7, r8, lsl 2] | __asm ("str.w r3, [r7, r8, lsl 2]");
0x00012a4e bl 0x124ec | fcn_000124ec (r0, r1);
0x00012a52 mov r1, sl | r1 = sl;
0x00012a54 mov r5, r0 | r5 = r0;
0x00012a56 ldr r0, [r7] | r0 = *(r7);
0x00012a58 blx 0xa41c | r0 = fcn_0000a41c ();
0x00012a5c mov r3, r0 | r3 = r0;
0x00012a5e mov r1, sb | r1 = sb;
0x00012a60 ldr r0, [r7] | r0 = *(r7);
0x00012a62 str r3, [r5] | *(r5) = r3;
0x00012a64 blx 0xa41c | fcn_0000a41c ();
0x00012a68 strd r0, r4, [r5, 4] | __asm ("strd r0, r4, [r5, 4]");
| label_4:
0x00012a6c add sp, 0xc |
0x00012a6e pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x00012a72 ldr.w r0, [r8] | r0 = *(r8);
0x00012a76 mov r1, sl | r1 = sl;
0x00012a78 blx 0x9f94 | r0 = fcn_00009f94 ();
0x00012a7c cmp r0, 0 |
| if (r0 != 0) {
0x00012a7e bne 0x129e6 | goto label_1;
| }
0x00012a80 ldr r2, [r7, 8] | r2 = *((r7 + 8));
0x00012a82 cmp.w sb, 0 |
0x00012a86 it eq |
| if (sb != 0) {
0x00012a88 moveq sb, r8 | sb = r8;
| }
0x00012a8a subs r2, 1 | r2--;
0x00012a8c str r2, [r7, 8] | *((r7 + 8)) = r2;
0x00012a8e b 0x129fa | goto label_2;
| label_6:
0x00012a90 lsls r2, r2, 0x10 | r2 <<= 0x10;
0x00012a92 and r4, r2, 0xdfdfdfdf | r4 = r2 & 0xdfdfdfdf;
0x00012a96 b 0x12970 | goto label_3;
| label_11:
0x00012a98 cmp r6, 0 |
| if (r6 == 0) {
0x00012a9a beq 0x12a6c | goto label_4;
| }
0x00012a9c b 0x12a2c | goto label_5;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x12aa0 */
| #include <stdint.h>
|
| #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \
| ((n & 0x0000ff00) << 8) | \
| ((n & 0x00ff0000) >> 8) | \
| ((n & 0xff000000) >> 24)))
|
; (fcn) sym.apr_table_setn () | void apr_table_setn (int16_t arg_8h, int16_t arg_10h, int16_t arg_14h, int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00012aa0 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012aa4 mov r7, r1 | r7 = r1;
0x00012aa6 ldrb r1, [r1] | r1 = *(r1);
0x00012aa8 sub sp, 0x14 |
0x00012aaa mov fp, r0 |
0x00012aac str r2, [sp, 4] | var_4h = r2;
0x00012aae mov r4, r1 | r4 = r1;
| if (r1 != 0) {
0x00012ab0 cbz r1, 0x12ad0 |
0x00012ab2 ldrh r2, [r7] | r2 = *(r7);
0x00012ab4 ldrb r0, [r7, 1] | r0 = *((r7 + 1));
0x00012ab6 rev16 r2, r2 | __asm ("rev16 r2, r2");
0x00012ab8 uxth r2, r2 | r2 = (int16_t) r2;
0x00012aba cmp r0, 0 |
| if (r0 == 0) {
0x00012abc beq.w 0x12be2 | goto label_6;
| }
0x00012ac0 ldrb r0, [r7, 2] | r0 = *((r7 + 2));
0x00012ac2 cmp r0, 0 |
| if (r0 == 0) {
0x00012ac4 beq.w 0x12be2 | goto label_6;
| }
0x00012ac8 ldr r4, [r7] | r4 = *(r7);
0x00012aca rev r4, r4 | r4 = SWAP32 (r4);
0x00012acc and r4, r4, 0xdfdfdfdf | r4 &= 0xdfdfdfdf;
| }
| label_3:
0x00012ad0 and r8, r1, 0x1f | r8 = r1 & 0x1f;
0x00012ad4 movs r2, 1 | r2 = 1;
0x00012ad6 ldr.w r1, [fp, 0x14] | r1 = *(arg_14h);
0x00012ada lsl.w r2, r2, r8 | r2 <<= r8;
0x00012ade ldr.w sl, [fp, 8] | sl = *(arg_8h);
0x00012ae2 tst r1, r2 |
0x00012ae4 str.w sl, [sp, 8] | __asm ("str.w sl, [var_8h]");
| if ((r1 & r2) == 0) {
0x00012ae8 beq 0x12b98 | goto label_7;
| }
0x00012aea add.w r1, fp, r8, lsl 2 | r1 = fp + (r8 << 2);
0x00012aee ldr.w r3, [fp, 0x10] | r3 = *(arg_10h);
0x00012af2 ldr r2, [r1, 0x18] | r2 = *((r1 + 0x18));
0x00012af4 ldr.w r5, [r1, 0x98] | r5 = *((r1 + 0x98));
0x00012af8 str r3, [sp, 0xc] | var_ch = r3;
0x00012afa add.w r2, r2, r2, lsl 1 | r2 += (r2 << 1);
0x00012afc lsls r2, r0, 9 | r2 = r0 << 9;
0x00012afe add.w r5, r5, r5, lsl 1 | r5 += (r5 << 1);
0x00012b02 add.w sb, r3, r2, lsl 2 | sb = r3 + (r2 << 2);
0x00012b06 add.w r5, r3, r5, lsl 2 | r5 = r3 + (r5 << 2);
0x00012b0a cmp sb, r5 |
| if (sb < r5) {
0x00012b0c bls 0x12b18 | goto label_8;
| }
0x00012b0e b 0x12ba6 | goto label_9;
| do {
| label_0:
0x00012b10 add.w sb, sb, 0xc | sb += 0xc;
0x00012b14 cmp r5, sb |
| if (r5 <= sb) {
0x00012b16 blo 0x12ba6 | goto label_9;
| }
| label_8:
0x00012b18 ldr.w r1, [sb, 8] | r1 = *((sb + 8));
0x00012b1c cmp r1, r4 |
0x00012b1e bne 0x12b10 |
| } while (r1 != r4);
0x00012b20 ldr.w r0, [sb] | r0 = *(sb);
0x00012b24 mov r1, r7 | r1 = r7;
0x00012b26 blx 0x9f94 | r0 = fcn_00009f94 ();
0x00012b2a mov r6, r0 | r6 = r0;
0x00012b2c cmp r0, 0 |
| if (r0 != 0) {
0x00012b2e bne 0x12b10 | goto label_0;
| }
0x00012b30 ldr r3, [sp, 4] | r3 = var_4h;
0x00012b32 add.w r8, sb, 0xc | r8 = sb + 0xc;
0x00012b36 cmp r5, r8 |
0x00012b38 str.w r3, [sb, 4] | __asm ("str.w r3, [sb, 4]");
| if (r5 <= r8) {
0x00012b3c blo 0x12bbc | goto label_4;
| }
0x00012b3e mov sb, r0 | sb = r0;
| do {
0x00012b40 ldr.w r2, [r8, 8] | r2 = *((r8 + 8));
0x00012b44 cmp r2, r4 |
| if (r2 == r4) {
0x00012b46 beq 0x12bc2 | goto label_10;
| }
| label_1:
0x00012b48 cmp.w sb, 0 |
| if (sb != 0) {
0x00012b4c beq 0x12b5c |
0x00012b4e ldm.w r8, {r0, r1, r2} | r0 = *(r8);
| r1 = *((r8 + 4));
| r2 = *((r8 + 8));
0x00012b52 movs r6, 1 | r6 = 1;
0x00012b54 stm.w sb, {r0, r1, r2} | *(sb) = r0;
| *((sb + 4)) = r1;
| *((sb + 8)) = r2;
0x00012b58 add.w sb, sb, 0xc | sb += 0xc;
| }
| label_2:
0x00012b5c add.w r8, r8, 0xc | r8 += 0xc;
0x00012b60 cmp r5, r8 |
0x00012b62 bhs 0x12b40 |
| } while (r5 >= r8);
0x00012b64 cmp.w sb, 0 |
| if (sb == 0) {
0x00012b68 beq 0x12bea | goto label_11;
| }
0x00012b6a ldr r3, [sp, 8] | r3 = var_8h;
0x00012b6c add.w r2, r3, r3, lsl 1 | r2 = r3 + (r3 << 1);
0x00012b70 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012b72 add.w r3, r3, r2, lsl 2 | r3 += (r2 << 2);
0x00012b76 cmp r3, r8 |
| if (r3 < r8) {
0x00012b78 bls 0x12b8e | goto label_5;
| }
| do {
0x00012b7a ldm.w r8, {r0, r1, r2} | r0 = *(r8);
| r1 = *((r8 + 4));
| r2 = *((r8 + 8));
0x00012b7e add.w r8, r8, 0xc | r8 += 0xc;
0x00012b82 cmp r3, r8 |
0x00012b84 add.w sb, sb, 0xc | sb += 0xc;
0x00012b88 stmdb sb, {r0, r1, r2} | __asm ("stmdb sb, {r0, r1, r2}");
0x00012b8c bhi 0x12b7a |
| } while (r3 > r8);
| label_5:
0x00012b8e mov r0, fp | r0 = fp;
0x00012b90 add sp, 0x14 |
0x00012b92 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012b96 b 0x1249c | void (*0x1249c)() ();
| label_7:
0x00012b98 orrs r1, r2 | r1 |= r2;
0x00012b9a add.w r2, r8, 6 | r2 = r8 + 6;
0x00012b9e str.w sl, [fp, r2, lsl 2] | __asm ("str.w sl, [fp, r2, lsl 2]");
0x00012ba2 str.w r1, [fp, 0x14] | __asm ("str.w r1, [arg_14h]");
| label_9:
0x00012ba6 add.w r8, r8, 0x26 | r8 += 0x26;
0x00012baa mov r0, fp | r0 = fp;
0x00012bac str.w sl, [fp, r8, lsl 2] | __asm ("str.w sl, [fp, r8, lsl 2]");
0x00012bb0 bl 0x124ec | fcn_000124ec (r0, r1);
0x00012bb4 ldr r3, [sp, 4] | r3 = var_4h;
0x00012bb6 str r7, [r0] | *(r0) = r7;
0x00012bb8 strd r3, r4, [r0, 4] | __asm ("strd r3, r4, [r0, 4]");
| label_4:
0x00012bbc add sp, 0x14 |
0x00012bbe pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x00012bc2 ldr.w r0, [r8] | r0 = *(r8);
0x00012bc6 mov r1, r7 | r1 = r7;
0x00012bc8 blx 0x9f94 | r0 = fcn_00009f94 ();
0x00012bcc cmp r0, 0 |
| if (r0 != 0) {
0x00012bce bne 0x12b48 | goto label_1;
| }
0x00012bd0 add.w sl, sl, -1 | sl += -1;
0x00012bd4 cmp.w sb, 0 |
0x00012bd8 it eq |
| if (sb != 0) {
0x00012bda moveq sb, r8 | sb = r8;
| }
0x00012bdc str.w sl, [fp, 8] | __asm ("str.w sl, [arg_8h]");
0x00012be0 b 0x12b5c | goto label_2;
| label_6:
0x00012be2 lsls r2, r2, 0x10 | r2 <<= 0x10;
0x00012be4 and r4, r2, 0xdfdfdfdf | r4 = r2 & 0xdfdfdfdf;
0x00012be8 b 0x12ad0 | goto label_3;
| label_11:
0x00012bea cmp r6, 0 |
| if (r6 == 0) {
0x00012bec beq 0x12bbc | goto label_4;
| }
0x00012bee b 0x12b8e | goto label_5;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x12aa0 */
| #include <stdint.h>
|
| #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \
| ((n & 0x0000ff00) << 8) | \
| ((n & 0x00ff0000) >> 8) | \
| ((n & 0xff000000) >> 24)))
|
; (fcn) sym.apr_table_setn () | void apr_table_setn (int16_t arg_8h, int16_t arg_10h, int16_t arg_14h, int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00012aa0 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012aa4 mov r7, r1 | r7 = r1;
0x00012aa6 ldrb r1, [r1] | r1 = *(r1);
0x00012aa8 sub sp, 0x14 |
0x00012aaa mov fp, r0 |
0x00012aac str r2, [sp, 4] | var_4h = r2;
0x00012aae mov r4, r1 | r4 = r1;
| if (r1 != 0) {
0x00012ab0 cbz r1, 0x12ad0 |
0x00012ab2 ldrh r2, [r7] | r2 = *(r7);
0x00012ab4 ldrb r0, [r7, 1] | r0 = *((r7 + 1));
0x00012ab6 rev16 r2, r2 | __asm ("rev16 r2, r2");
0x00012ab8 uxth r2, r2 | r2 = (int16_t) r2;
0x00012aba cmp r0, 0 |
| if (r0 == 0) {
0x00012abc beq.w 0x12be2 | goto label_6;
| }
0x00012ac0 ldrb r0, [r7, 2] | r0 = *((r7 + 2));
0x00012ac2 cmp r0, 0 |
| if (r0 == 0) {
0x00012ac4 beq.w 0x12be2 | goto label_6;
| }
0x00012ac8 ldr r4, [r7] | r4 = *(r7);
0x00012aca rev r4, r4 | r4 = SWAP32 (r4);
0x00012acc and r4, r4, 0xdfdfdfdf | r4 &= 0xdfdfdfdf;
| }
| label_3:
0x00012ad0 and r8, r1, 0x1f | r8 = r1 & 0x1f;
0x00012ad4 movs r2, 1 | r2 = 1;
0x00012ad6 ldr.w r1, [fp, 0x14] | r1 = *(arg_14h);
0x00012ada lsl.w r2, r2, r8 | r2 <<= r8;
0x00012ade ldr.w sl, [fp, 8] | sl = *(arg_8h);
0x00012ae2 tst r1, r2 |
0x00012ae4 str.w sl, [sp, 8] | __asm ("str.w sl, [var_8h]");
| if ((r1 & r2) == 0) {
0x00012ae8 beq 0x12b98 | goto label_7;
| }
0x00012aea add.w r1, fp, r8, lsl 2 | r1 = fp + (r8 << 2);
0x00012aee ldr.w r3, [fp, 0x10] | r3 = *(arg_10h);
0x00012af2 ldr r2, [r1, 0x18] | r2 = *((r1 + 0x18));
0x00012af4 ldr.w r5, [r1, 0x98] | r5 = *((r1 + 0x98));
0x00012af8 str r3, [sp, 0xc] | var_ch = r3;
0x00012afa add.w r2, r2, r2, lsl 1 | r2 += (r2 << 1);
0x00012afc lsls r2, r0, 9 | r2 = r0 << 9;
0x00012afe add.w r5, r5, r5, lsl 1 | r5 += (r5 << 1);
0x00012b02 add.w sb, r3, r2, lsl 2 | sb = r3 + (r2 << 2);
0x00012b06 add.w r5, r3, r5, lsl 2 | r5 = r3 + (r5 << 2);
0x00012b0a cmp sb, r5 |
| if (sb < r5) {
0x00012b0c bls 0x12b18 | goto label_8;
| }
0x00012b0e b 0x12ba6 | goto label_9;
| do {
| label_0:
0x00012b10 add.w sb, sb, 0xc | sb += 0xc;
0x00012b14 cmp r5, sb |
| if (r5 <= sb) {
0x00012b16 blo 0x12ba6 | goto label_9;
| }
| label_8:
0x00012b18 ldr.w r1, [sb, 8] | r1 = *((sb + 8));
0x00012b1c cmp r1, r4 |
0x00012b1e bne 0x12b10 |
| } while (r1 != r4);
0x00012b20 ldr.w r0, [sb] | r0 = *(sb);
0x00012b24 mov r1, r7 | r1 = r7;
0x00012b26 blx 0x9f94 | r0 = fcn_00009f94 ();
0x00012b2a mov r6, r0 | r6 = r0;
0x00012b2c cmp r0, 0 |
| if (r0 != 0) {
0x00012b2e bne 0x12b10 | goto label_0;
| }
0x00012b30 ldr r3, [sp, 4] | r3 = var_4h;
0x00012b32 add.w r8, sb, 0xc | r8 = sb + 0xc;
0x00012b36 cmp r5, r8 |
0x00012b38 str.w r3, [sb, 4] | __asm ("str.w r3, [sb, 4]");
| if (r5 <= r8) {
0x00012b3c blo 0x12bbc | goto label_4;
| }
0x00012b3e mov sb, r0 | sb = r0;
| do {
0x00012b40 ldr.w r2, [r8, 8] | r2 = *((r8 + 8));
0x00012b44 cmp r2, r4 |
| if (r2 == r4) {
0x00012b46 beq 0x12bc2 | goto label_10;
| }
| label_1:
0x00012b48 cmp.w sb, 0 |
| if (sb != 0) {
0x00012b4c beq 0x12b5c |
0x00012b4e ldm.w r8, {r0, r1, r2} | r0 = *(r8);
| r1 = *((r8 + 4));
| r2 = *((r8 + 8));
0x00012b52 movs r6, 1 | r6 = 1;
0x00012b54 stm.w sb, {r0, r1, r2} | *(sb) = r0;
| *((sb + 4)) = r1;
| *((sb + 8)) = r2;
0x00012b58 add.w sb, sb, 0xc | sb += 0xc;
| }
| label_2:
0x00012b5c add.w r8, r8, 0xc | r8 += 0xc;
0x00012b60 cmp r5, r8 |
0x00012b62 bhs 0x12b40 |
| } while (r5 >= r8);
0x00012b64 cmp.w sb, 0 |
| if (sb == 0) {
0x00012b68 beq 0x12bea | goto label_11;
| }
0x00012b6a ldr r3, [sp, 8] | r3 = var_8h;
0x00012b6c add.w r2, r3, r3, lsl 1 | r2 = r3 + (r3 << 1);
0x00012b70 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012b72 add.w r3, r3, r2, lsl 2 | r3 += (r2 << 2);
0x00012b76 cmp r3, r8 |
| if (r3 < r8) {
0x00012b78 bls 0x12b8e | goto label_5;
| }
| do {
0x00012b7a ldm.w r8, {r0, r1, r2} | r0 = *(r8);
| r1 = *((r8 + 4));
| r2 = *((r8 + 8));
0x00012b7e add.w r8, r8, 0xc | r8 += 0xc;
0x00012b82 cmp r3, r8 |
0x00012b84 add.w sb, sb, 0xc | sb += 0xc;
0x00012b88 stmdb sb, {r0, r1, r2} | __asm ("stmdb sb, {r0, r1, r2}");
0x00012b8c bhi 0x12b7a |
| } while (r3 > r8);
| label_5:
0x00012b8e mov r0, fp | r0 = fp;
0x00012b90 add sp, 0x14 |
0x00012b92 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012b96 b 0x1249c | void (*0x1249c)() ();
| label_7:
0x00012b98 orrs r1, r2 | r1 |= r2;
0x00012b9a add.w r2, r8, 6 | r2 = r8 + 6;
0x00012b9e str.w sl, [fp, r2, lsl 2] | __asm ("str.w sl, [fp, r2, lsl 2]");
0x00012ba2 str.w r1, [fp, 0x14] | __asm ("str.w r1, [arg_14h]");
| label_9:
0x00012ba6 add.w r8, r8, 0x26 | r8 += 0x26;
0x00012baa mov r0, fp | r0 = fp;
0x00012bac str.w sl, [fp, r8, lsl 2] | __asm ("str.w sl, [fp, r8, lsl 2]");
0x00012bb0 bl 0x124ec | fcn_000124ec (r0, r1);
0x00012bb4 ldr r3, [sp, 4] | r3 = var_4h;
0x00012bb6 str r7, [r0] | *(r0) = r7;
0x00012bb8 strd r3, r4, [r0, 4] | __asm ("strd r3, r4, [r0, 4]");
| label_4:
0x00012bbc add sp, 0x14 |
0x00012bbe pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x00012bc2 ldr.w r0, [r8] | r0 = *(r8);
0x00012bc6 mov r1, r7 | r1 = r7;
0x00012bc8 blx 0x9f94 | r0 = fcn_00009f94 ();
0x00012bcc cmp r0, 0 |
| if (r0 != 0) {
0x00012bce bne 0x12b48 | goto label_1;
| }
0x00012bd0 add.w sl, sl, -1 | sl += -1;
0x00012bd4 cmp.w sb, 0 |
0x00012bd8 it eq |
| if (sb != 0) {
0x00012bda moveq sb, r8 | sb = r8;
| }
0x00012bdc str.w sl, [fp, 8] | __asm ("str.w sl, [arg_8h]");
0x00012be0 b 0x12b5c | goto label_2;
| label_6:
0x00012be2 lsls r2, r2, 0x10 | r2 <<= 0x10;
0x00012be4 and r4, r2, 0xdfdfdfdf | r4 = r2 & 0xdfdfdfdf;
0x00012be8 b 0x12ad0 | goto label_3;
| label_11:
0x00012bea cmp r6, 0 |
| if (r6 == 0) {
0x00012bec beq 0x12bbc | goto label_4;
| }
0x00012bee b 0x12b8e | goto label_5;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x12ffc */
| #include <stdint.h>
|
| #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \
| ((n & 0x0000ff00) << 8) | \
| ((n & 0x00ff0000) >> 8) | \
| ((n & 0xff000000) >> 24)))
|
; (fcn) sym.apr_table_vdo () | void apr_table_vdo (int16_t arg_8h, int16_t arg_14h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x00012ffc push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013000 mov sl, r3 | sl = r3;
0x00013002 ldr r5, [sl], 4 | r5 = *(sl);
| sl += 4;
0x00013006 sub sp, 0x1c |
0x00013008 mov fp, r2 |
0x0001300a mov r8, r1 | r8 = r1;
0x0001300c ldr r3, [r2, 0x10] | r3 = *((r2 + 0x10));
0x0001300e str r0, [sp, 4] | var_4h = r0;
0x00013010 str r3, [sp, 0x10] | var_10h = r3;
0x00013012 movs r3, 1 | r3 = 1;
0x00013014 str r3, [sp, 8] | var_8h = r3;
0x00013016 cmp r5, 0 |
| if (r5 == 0) {
0x00013018 beq 0x130b6 | goto label_5;
| }
0x0001301a str r1, [sp, 0xc] | var_ch = r1;
0x0001301c b 0x13026 |
| while ((r0 & r1) == 0) {
| label_2:
0x0001301e ldr r5, [sl], 4 | r5 = *(sl);
| sl += 4;
0x00013022 cmp r5, 0 |
| if (r5 == 0) {
0x00013024 beq 0x130de | goto label_6;
| }
0x00013026 ldrb r2, [r5] | r2 = *(r5);
0x00013028 movs r3, 1 | r3 = 1;
0x0001302a ldr.w r1, [fp, 0x14] | r1 = *(arg_14h);
0x0001302e and r8, r2, 0x1f | r8 = r2 & 0x1f;
0x00013032 lsl.w r0, r3, r8 | r0 = r3 << r8;
0x00013036 tst r0, r1 |
0x00013038 beq 0x1301e |
| }
0x0001303a mov sb, r2 | sb = r2;
| if (r2 != 0) {
0x0001303c cbz r2, 0x1305c |
0x0001303e ldrh r2, [r5] | r2 = *(r5);
0x00013040 ldrb r1, [r5, 1] | r1 = *((r5 + 1));
0x00013042 rev16 r2, r2 | __asm ("rev16 r2, r2");
0x00013044 uxth r2, r2 | r2 = (int16_t) r2;
0x00013046 cmp r1, 0 |
| if (r1 == 0) {
0x00013048 beq 0x130ec | goto label_7;
| }
0x0001304a ldrb r1, [r5, 2] | r1 = *((r5 + 2));
0x0001304c cmp r1, 0 |
| if (r1 == 0) {
0x0001304e beq 0x130ec | goto label_7;
| }
0x00013050 ldr.w sb, [r5] | sb = *(r5);
0x00013054 rev.w sb, sb | sb = SWAP32 (sb);
0x00013058 and sb, sb, 0xdfdfdfdf | sb &= 0xdfdfdfdf;
| }
| label_4:
0x0001305c add.w r3, fp, r8, lsl 2 | r3 = fp + (r8 << 2);
0x00013060 ldr r6, [r3, 0x18] | r6 = *((r3 + 0x18));
0x00013062 ldr.w r8, [r3, 0x98] | r8 = *((r3 + 0x98));
0x00013066 str r3, [sp, 0x14] | var_14h = r3;
0x00013068 ldr r3, [sp, 0x10] | r3 = var_10h;
0x0001306a add.w r4, r6, r6, lsl 1 | r4 = r6 + (r6 << 1);
0x0001306e add.w r4, r3, r4, lsl 2 | r4 = r3 + (r4 << 2);
0x00013072 b 0x13078 |
| while (r7 == 0) {
| label_0:
0x00013074 adds r6, 1 | r6++;
0x00013076 adds r4, 0xc | r4 += 0xc;
0x00013078 cmp r8, r6 |
| if (r8 < r6) {
0x0001307a blt 0x130b0 | goto label_8;
| }
| label_1:
0x0001307c ldr r7, [r4] | r7 = *(r4);
0x0001307e cmp r7, 0 |
0x00013080 beq 0x13074 |
| }
0x00013082 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00013084 cmp r3, sb |
| if (r3 != sb) {
0x00013086 bne 0x13074 | goto label_0;
| }
0x00013088 mov r1, r5 | r1 = r5;
0x0001308a mov r0, r7 | r0 = r7;
0x0001308c blx 0x9f94 | r0 = fcn_00009f94 ();
0x00013090 mov r3, r0 | r3 = r0;
0x00013092 mov r1, r7 | r1 = r7;
0x00013094 ldr r0, [sp, 0xc] | r0 = var_ch;
0x00013096 cmp r3, 0 |
| if (r3 != 0) {
0x00013098 bne 0x13074 | goto label_0;
| }
0x0001309a ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x0001309c adds r6, 1 | r6++;
0x0001309e ldr r3, [sp, 4] | r3 = var_4h;
0x000130a0 adds r4, 0xc | r4 += 0xc;
0x000130a2 blx r3 | r0 = uint32_t (*r3)(uint32_t, uint32_t) (r2, r3);
| if (r0 == 0) {
0x000130a4 cbz r0, 0x130b2 | goto label_9;
| }
0x000130a6 ldr r3, [sp, 0x14] | r3 = var_14h;
0x000130a8 ldr.w r8, [r3, 0x98] | r8 = *((r3 + 0x98));
0x000130ac cmp r8, r6 |
| if (r8 >= r6) {
0x000130ae bge 0x1307c | goto label_1;
| }
| label_8:
0x000130b0 ldr r0, [sp, 8] | r0 = var_8h;
| label_9:
0x000130b2 str r0, [sp, 8] | var_8h = r0;
0x000130b4 b 0x1301e | goto label_2;
| label_5:
0x000130b6 ldr r2, [r2, 8] | r2 = *((r2 + 8));
0x000130b8 ldr r4, [sp, 0x10] | r4 = var_10h;
| label_3:
0x000130ba cmp r2, r5 |
0x000130bc mov r0, r8 | r0 = r8;
| if (r2 <= r5) {
0x000130be ble 0x130da | goto label_10;
| }
| do {
0x000130c0 ldr r1, [r4] | r1 = *(r4);
| if (r1 == 0) {
0x000130c2 cbz r1, 0x130e6 | goto label_11;
| }
0x000130c4 ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x000130c6 adds r5, 1 | r5++;
0x000130c8 ldr r3, [sp, 4] | r3 = var_4h;
0x000130ca adds r4, 0xc | r4 += 0xc;
0x000130cc blx r3 | r0 = uint32_t (*r3)(uint32_t, uint32_t) (r2, r3);
| if (r0 == 0) {
0x000130ce cbz r0, 0x130dc | goto label_12;
| }
0x000130d0 ldr.w r2, [fp, 8] | r2 = *(arg_8h);
0x000130d4 mov r0, r8 | r0 = r8;
0x000130d6 cmp r2, r5 |
0x000130d8 bgt 0x130c0 |
| } while (r2 > r5);
| label_10:
0x000130da movs r0, 1 | r0 = 1;
| label_12:
0x000130dc str r0, [sp, 8] | var_8h = r0;
| label_6:
0x000130de ldr r0, [sp, 8] | r0 = var_8h;
0x000130e0 add sp, 0x1c |
0x000130e2 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_11:
0x000130e6 adds r5, 1 | r5++;
0x000130e8 adds r4, 0xc | r4 += 0xc;
0x000130ea b 0x130ba | goto label_3;
| label_7:
0x000130ec lsls r2, r2, 0x10 | r2 <<= 0x10;
0x000130ee and sb, r2, 0xdfdfdfdf | sb = r2 & 0xdfdfdfdf;
0x000130f0 subs r1, 0xdf | r1 -= 0xdf;
0x000130f2 b 0x1305c | goto label_4;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0x1eb7c */
| #include <stdint.h>
|
; (fcn) sym.apr_time_exp_get () | void apr_time_exp_get (int16_t arg1, int16_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x0001eb7c push.w {r4, r5, r6, r7, r8, lr} |
0x0001eb80 ldrd r7, r6, [r1, 0x14] | __asm ("ldrd r7, r6, [r1, 0x14]");
0x0001eb84 cmp r7, 0xb |
| if (r7 > 0xb) {
0x0001eb86 bhi.w 0x1ecf8 | goto label_0;
| }
0x0001eb8a cmp r7, 1 |
0x0001eb8c asr.w r8, r6, 0x1f | r8 = r6 >> 0x1f;
0x0001eb90 mov r4, r1 | r4 = r1;
0x0001eb92 mov r5, r0 | r5 = r0;
0x0001eb94 ble.w 0x1ecf0 |
| while (1) {
0x0001eb98 mov r0, r6 | r0 = r6;
0x0001eb9a mov r1, r8 | r1 = r8;
0x0001eb9c mvn r2, 0x63 | r2 = ~0x63;
0x0001eba0 mov.w r3, -1 | r3 = -1;
0x0001eba4 bl 0x1f700 | fcn_0001f700 (r0, r1, r2, r3, r4, r5);
0x0001eba8 lsl.w r3, r8, 3 | r3 = r8 << 3;
0x0001ebac lsl.w ip, r6, 3 |
0x0001ebb0 orr.w r3, r3, r6, lsr 29 | r3 |= (r6 >> 29);
0x0001ebb4 adds.w ip, ip, r6 |
0x0001ebb8 adc.w r3, r8, r3 | __asm ("adc.w r3, r8, r3");
0x0001ebbc lsls r3, r3, 3 | r3 <<= 3;
0x0001ebbe orr.w r3, r3, ip, lsr 29 | r3 |= (ip >> 29);
0x0001ebc2 lsl.w ip, ip, 3 |
0x0001ebc6 adds.w ip, ip, r6 |
0x0001ebca adc.w r3, r8, r3 | __asm ("adc.w r3, r8, r3");
0x0001ebce lsl.w r2, ip, 2 | r2 = ip << 2;
0x0001ebd2 lsl.w lr, r3, 2 | lr = r3 << 2;
0x0001ebd6 adds.w r2, ip, r2 | r2 = ip + r2;
0x0001ebda orr.w lr, lr, ip, lsr 30 | lr |= (ip >> 30);
0x0001ebde asr.w ip, r8, 0x1f |
0x0001ebe2 and ip, ip, 3 |
0x0001ebe6 adc.w r3, r3, lr | __asm ("adc.w r3, r3, lr");
0x0001ebea adds.w r6, ip, r6 | r6 = ip + r6;
0x0001ebee lsr.w r6, r6, 2 | r6 >>= 2;
0x0001ebf2 adc r8, r8, 0 | __asm ("adc r8, r8, 0");
0x0001ebf6 orr.w r6, r6, r8, lsl 30 | r6 |= (r8 << 30);
0x0001ebfa adds r2, r2, r6 | r2 += r6;
0x0001ebfc adc.w r3, r3, r8, asr 2 | __asm ("adc.w r3, r3, r8, asr 2");
0x0001ec00 adds r2, r2, r0 | r2 += r0;
0x0001ec02 adc.w r3, r3, r1 | __asm ("adc.w r3, r3, r1");
0x0001ec06 rsbs.w ip, r0, 3 |
0x0001ec0a sbc.w r6, r1, r1, lsl 1 | __asm ("sbc.w r6, r1, r1, lsl 1");
0x0001ec0e ldr r1, [pc, 0xf0] |
0x0001ec10 asrs r0, r6, 0x1f | r0 = r6 >> 0x1f;
0x0001ec12 and r0, r0, 3 | r0 &= 3;
0x0001ec16 add r1, pc |
0x0001ec18 adds.w r0, r0, ip | r0 += ip;
0x0001ec1c ldr.w r1, [r1, r7, lsl 2] | r1 = *(0x3d91c);
0x0001ec20 lsr.w r0, r0, 2 | r0 >>= 2;
0x0001ec24 adc r6, r6, 0 | __asm ("adc r6, r6, 0");
0x0001ec28 orr.w r0, r0, r6, lsl 30 | r0 |= (r6 << 30);
0x0001ec2c adds r2, r2, r0 | r2 += r0;
0x0001ec2e ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001ec30 adc.w r3, r3, r6, asr 2 | __asm ("adc.w r3, r3, r6, asr 2");
0x0001ec34 add r1, r0 | r1 += r0;
0x0001ec36 subs r1, 1 | r1--;
0x0001ec38 adds r2, r1, r2 | r2 = r1 + r2;
0x0001ec3a adc.w r3, r3, r1, asr 31 | __asm ("adc.w r3, r3, r1, asr 31");
0x0001ec3e movw r1, 0x9c5c |
0x0001ec42 movt r1, 0xffff | r1 = 0xffff9c5c;
0x0001ec46 adds r2, r2, r1 | r2 += r1;
0x0001ec48 sbc r3, r3, 0 | __asm ("sbc r3, r3, 0");
0x0001ec4c adds r1, r2, r2 | r1 = r2 + r2;
0x0001ec4e adc.w r0, r3, r3 | __asm ("adc.w r0, r3, r3");
0x0001ec52 adds r2, r1, r2 | r2 = r1 + r2;
0x0001ec54 adc.w r3, r3, r0 | __asm ("adc.w r3, r3, r0");
0x0001ec58 lsls r1, r2, 3 | r1 = r2 << 3;
0x0001ec5a lsls r3, r3, 3 | r3 <<= 3;
0x0001ec5c orr.w r3, r3, r2, lsr 29 | r3 |= (r2 >> 29);
0x0001ec60 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
0x0001ec62 adds r1, r1, r2 | r1 += r2;
0x0001ec64 adc.w r3, r3, r2, asr 31 | __asm ("adc.w r3, r3, r2, asr 31");
0x0001ec68 lsls r0, r1, 4 | r0 = r1 << 4;
0x0001ec6a lsls r2, r3, 4 | r2 = r3 << 4;
0x0001ec6c subs r0, r0, r1 | r0 -= r1;
0x0001ec6e orr.w r2, r2, r1, lsr 28 | r2 |= (r1 >> 28);
0x0001ec72 lsl.w r1, r0, 2 | r1 = r0 << 2;
0x0001ec76 sbc.w r3, r2, r3 | __asm ("sbc.w r3, r2, r3");
0x0001ec7a ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x0001ec7c lsls r3, r3, 2 | r3 <<= 2;
0x0001ec7e orr.w r3, r3, r0, lsr 30 | r3 |= (r0 >> 30);
0x0001ec82 adds r1, r1, r2 | r1 += r2;
0x0001ec84 lsl.w r0, r1, 4 | r0 = r1 << 4;
0x0001ec88 adc.w r3, r3, r2, asr 31 | __asm ("adc.w r3, r3, r2, asr 31");
0x0001ec8c lsls r2, r3, 4 | r2 = r3 << 4;
0x0001ec8e orr.w r2, r2, r1, lsr 28 | r2 |= (r1 >> 28);
0x0001ec92 subs r1, r0, r1 | r1 = r0 - r1;
0x0001ec94 lsl.w r6, r1, 2 | r6 = r1 << 2;
0x0001ec98 sbc.w r3, r2, r3 | __asm ("sbc.w r3, r2, r3");
0x0001ec9c ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x0001ec9e lsls r3, r3, 2 | r3 <<= 2;
0x0001eca0 orr.w r3, r3, r1, lsr 30 | r3 |= (r1 >> 30);
0x0001eca4 adds r6, r2, r6 | r6 = r2 + r6;
0x0001eca6 adc.w r3, r3, r2, asr 31 | __asm ("adc.w r3, r3, r2, asr 31");
0x0001ecaa cmp r3, 0 |
| if (r3 < 0) {
0x0001ecac blt 0x1ecf8 | goto label_0;
| }
0x0001ecae lsls r1, r3, 5 | r1 = r3 << 5;
0x0001ecb0 lsls r2, r6, 5 | r2 = r6 << 5;
0x0001ecb2 ldr r4, [r4] | r4 = *(r4);
0x0001ecb4 orr.w r1, r1, r6, lsr 27 | r1 |= (r6 >> 27);
0x0001ecb8 subs r2, r2, r6 | r2 -= r6;
0x0001ecba sbc.w r1, r1, r3 | __asm ("sbc.w r1, r1, r3");
0x0001ecbe lsls r1, r1, 9 | r1 <<= 9;
0x0001ecc0 orr.w r1, r1, r2, lsr 23 | r1 |= (r2 >> 23);
0x0001ecc4 lsls r2, r2, 9 | r2 <<= 9;
0x0001ecc6 adds r2, r2, r6 | r2 += r6;
0x0001ecc8 adc.w r0, r3, r1 | __asm ("adc.w r0, r3, r1");
0x0001eccc lsls r1, r2, 6 | r1 = r2 << 6;
0x0001ecce lsls r7, r0, 6 | r7 = r0 << 6;
0x0001ecd0 subs r1, r1, r2 | r1 -= r2;
0x0001ecd2 orr.w r7, r7, r2, lsr 26 | r7 |= (r2 >> 26);
0x0001ecd6 sbc.w r7, r7, r0 | __asm ("sbc.w r7, r7, r0");
0x0001ecda adds r2, r1, r6 | r2 = r1 + r6;
0x0001ecdc adc.w r3, r3, r7 | __asm ("adc.w r3, r3, r7");
0x0001ece0 adds r2, r2, r4 | r2 += r4;
0x0001ece2 adc.w r3, r3, r4, asr 31 | __asm ("adc.w r3, r3, r4, asr 31");
0x0001ece6 movs r0, 0 | r0 = 0;
0x0001ece8 strd r2, r3, [r5] | __asm ("strd r2, r3, [r5]");
0x0001ecec pop.w {r4, r5, r6, r7, r8, pc} |
0x0001ecf0 subs r6, 1 | r6--;
0x0001ecf2 sbc r8, r8, 0 | __asm ("sbc r8, r8, 0");
0x0001ecf6 b 0x1eb98 |
| }
| label_0:
0x0001ecf8 movw r0, 0x4e24 | r0 = 0x4e24;
0x0001ecfc pop.w {r4, r5, r6, r7, r8, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xe110 */
| #include <stdint.h>
|
; (fcn) sym.apr_tokenize_to_argv () | void apr_tokenize_to_argv (uint32_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_4h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x0000e110 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000e114 mov r4, r0 | r4 = r0;
0x0000e116 ldrb r0, [r0] | r0 = *(r0);
0x0000e118 sub sp, 0xc |
0x0000e11a mov r6, r1 | r6 = r1;
0x0000e11c str r2, [sp, 4] | var_4h = r2;
0x0000e11e cmp r0, 9 |
0x0000e120 it ne |
| if (r0 != 9) {
0x0000e122 cmpne r0, 0x20 | __asm ("cmpne r0, 0x20");
| }
| if (r0 != 9) {
0x0000e124 bne 0xe132 | goto label_11;
| }
| do {
0x0000e126 ldrb r0, [r4, 1]! | r0 = *((r4 += 1));
0x0000e12a cmp r0, 9 |
0x0000e12c it ne |
| if (r0 != 9) {
0x0000e12e cmpne r0, 0x20 | __asm ("cmpne r0, 0x20");
| }
0x0000e130 beq 0xe126 |
| } while (r0 == 9);
| label_11:
0x0000e132 cmp r0, 0 |
| if (r0 == 0) {
0x0000e134 beq.w 0xe2e2 | goto label_12;
| }
0x0000e138 mov r5, r4 | r5 = r4;
0x0000e13a mov.w sb, 2 | sb = 2;
| label_4:
0x0000e13e cmp r0, 0x22 |
0x0000e140 itt eq |
| if (r0 != 0x22) {
0x0000e142 addeq r1, r5, 1 | r1 = r5 + 1;
| }
| if (r0 != 0x22) {
0x0000e144 moveq r7, 1 | r7 = 1;
| }
| if (r0 != 0x22) {
0x0000e146 beq 0xe156 |
0x0000e148 cmp r0, 0x27 |
0x0000e14a itt eq |
| if (r0 != 0x27) {
0x0000e14c addeq r1, r5, 1 | r1 = r5 + 1;
| }
| if (r0 != 0x27) {
0x0000e14e moveq r7, 2 | r7 = 2;
| }
| if (r0 == 0x27) {
0x0000e150 beq 0xe156 | goto label_13;
| }
0x0000e152 mov r1, r5 | r1 = r5;
0x0000e154 movs r7, 0 | r7 = 0;
| }
| label_13:
0x0000e156 ldrb r2, [r1] | r2 = *(r1);
| if (r2 == 0) {
0x0000e158 cbz r2, 0xe17c | goto label_14;
| }
| do {
0x0000e15a mov r3, r1 | r3 = r1;
0x0000e15c cmp r2, 0x5c |
0x0000e15e ldrb r0, [r3, 1]! | r0 = *((r3 += 1));
0x0000e162 mov r5, r3 | r5 = r3;
| if (r2 == 0x5c) {
0x0000e164 beq.w 0xe29a | goto label_15;
| }
0x0000e168 cmp r7, 0 |
| if (r7 != 0) {
0x0000e16a bne 0xe262 | goto label_16;
| }
0x0000e16c cmp r2, 9 |
0x0000e16e it ne |
| if (r2 != 9) {
0x0000e170 cmpne r2, 0x20 | __asm ("cmpne r2, 0x20");
| }
| if (r2 == 9) {
0x0000e172 beq 0xe26a | goto label_10;
| }
| label_3:
0x0000e174 mov r2, r0 | r2 = r0;
| label_9:
0x0000e176 mov r1, r3 | r1 = r3;
0x0000e178 cmp r2, 0 |
0x0000e17a bne 0xe15a |
| } while (r2 != 0);
| label_14:
0x0000e17c mov r8, sb | r8 = sb;
| label_5:
0x0000e17e lsl.w r1, r8, 2 | r1 = r8 << 2;
0x0000e182 ldr r0, [sp, 4] | r0 = var_4h;
0x0000e184 mov.w sl, 0 | sl = 0;
0x0000e188 blx 0xa0d0 | fcn_0000a0d0 ();
0x0000e18c add.w r8, r8, -1 | r8 += -1;
0x0000e190 mov fp, r0 |
0x0000e192 mov r7, sl | r7 = sl;
0x0000e194 str r0, [r6] | *(r6) = r0;
| label_2:
0x0000e196 ldrb r3, [r4] | r3 = *(r4);
0x0000e198 cmp r3, 9 |
0x0000e19a it ne |
| if (r3 != 9) {
0x0000e19c cmpne r3, 0x20 | __asm ("cmpne r3, 0x20");
| }
| if (r3 != 9) {
0x0000e19e bne 0xe1ac | goto label_17;
| }
| do {
0x0000e1a0 ldrb r3, [r4, 1]! | r3 = *((r4 += 1));
0x0000e1a4 cmp r3, 9 |
0x0000e1a6 it ne |
| if (r3 != 9) {
0x0000e1a8 cmpne r3, 0x20 | __asm ("cmpne r3, 0x20");
| }
0x0000e1aa beq 0xe1a0 |
| } while (r3 == 9);
| label_17:
0x0000e1ac cmp r3, 0x22 |
0x0000e1ae add.w r5, r4, 1 | r5 = r4 + 1;
0x0000e1b2 it eq |
| if (r3 != 0x22) {
0x0000e1b4 moveq r0, 1 | r0 = 1;
| }
| if (r3 != 0x22) {
0x0000e1b6 beq 0xe1c2 |
0x0000e1b8 cmp r3, 0x27 |
0x0000e1ba itet ne |
| if (r3 == 0x27) {
0x0000e1bc movne r0, 0 | r0 = 0;
| }
| if (r3 != 0x27) {
0x0000e1be moveq r0, 2 | r0 = 2;
| }
| if (r3 != 0x27) {
0x0000e1c0 movne r5, r4 | r5 = r4;
| goto label_18;
| }
| }
| label_18:
0x0000e1c2 ldrb r2, [r5] | r2 = *(r5);
0x0000e1c4 mov r3, r5 | r3 = r5;
| if (r2 != 0) {
0x0000e1c6 cbnz r2, 0xe1dc | goto label_0;
| }
0x0000e1c8 b 0xe208 | goto label_7;
| do {
0x0000e1ca cmp r0, 0 |
| if (r0 != 0) {
0x0000e1cc bne 0xe290 | goto label_19;
| }
0x0000e1ce cmp r2, 9 |
0x0000e1d0 it ne |
| if (r2 != 9) {
0x0000e1d2 cmpne r2, 0x20 | __asm ("cmpne r2, 0x20");
| }
| if (r2 == 9) {
0x0000e1d4 beq 0xe208 | goto label_7;
| }
| label_6:
0x0000e1d6 ldrb r2, [r3, 1] | r2 = *((r3 + 1));
0x0000e1d8 adds r3, 1 | r3++;
| if (r2 == 0) {
0x0000e1da cbz r2, 0xe208 | goto label_7;
| }
| label_0:
0x0000e1dc cmp r2, 0x5c |
0x0000e1de bne 0xe1ca |
| } while (r2 != 0x5c);
0x0000e1e0 ldrb r1, [r3, 1] | r1 = *((r3 + 1));
0x0000e1e2 cmp r1, 0x27 |
0x0000e1e4 it ne |
| if (r1 != 0x27) {
0x0000e1e6 cmpne r1, 9 | __asm ("cmpne r1, 9");
| }
0x0000e1e8 and r1, r1, 0xfd | r1 &= 0xfd;
0x0000e1ec ite eq |
| if (r1 != 0x27) {
0x0000e1ee moveq r4, 1 | r4 = 1;
| }
| if (r1 == 0x27) {
0x0000e1f0 movne r4, 0 | r4 = 0;
| }
0x0000e1f2 cmp r1, 0x20 |
0x0000e1f4 it eq |
| if (r1 != 0x20) {
0x0000e1f6 orreq r4, r4, 1 | r4 |= 1;
| }
0x0000e1fa cmp r4, 0 |
| if (r4 == 0) {
0x0000e1fc beq 0xe28c | goto label_20;
| }
0x0000e1fe ldrb r2, [r3, 2] | r2 = *((r3 + 2));
0x0000e200 adds r3, 1 | r3++;
0x0000e202 adds r3, 1 | r3++;
0x0000e204 cmp r2, 0 |
| if (r2 != 0) {
0x0000e206 bne 0xe1dc | goto label_0;
| }
| label_7:
0x0000e208 adds r4, r3, 1 | r4 = r3 + 1;
0x0000e20a ldr r0, [sp, 4] | r0 = var_4h;
0x0000e20c sub.w sb, r4, r5 | sb = r4 - r5;
0x0000e210 mov r1, sb | r1 = sb;
0x0000e212 blx 0xa0d0 | fcn_0000a0d0 ();
0x0000e216 ldr r3, [r6] | r3 = *(r6);
0x0000e218 mov r1, r5 | r1 = r5;
0x0000e21a str.w r0, [fp, sl, lsl 2] | __asm ("str.w r0, [fp, sl, lsl 2]");
0x0000e21e mov r2, sb | r2 = sb;
0x0000e220 ldr.w r0, [r3, sl, lsl 2] | offset_0 = sl << 2;
| r0 = *((r3 + offset_0));
0x0000e224 blx 0x9c08 | fcn_00009c08 ();
0x0000e228 ldr r3, [r6] | r3 = *(r6);
0x0000e22a ldr.w r1, [r3, sl, lsl 2] | offset_1 = sl << 2;
| r1 = *((r3 + offset_1));
0x0000e22e ldrb r3, [r1] | r3 = *(r1);
0x0000e230 mov r0, r1 | r0 = r1;
| if (r3 != 0) {
0x0000e232 cbnz r3, 0xe240 | goto label_21;
| }
0x0000e234 b 0xe24e | goto label_22;
| do {
| label_1:
0x0000e236 strb r3, [r0], 1 | *(r0) = r3;
| r0++;
0x0000e23a adds r1, r2, 1 | r1 = r2 + 1;
0x0000e23c ldrb r3, [r2, 1] | r3 = *((r2 + 1));
| if (r3 == 0) {
0x0000e23e cbz r3, 0xe24e | goto label_22;
| }
| label_21:
0x0000e240 cmp r3, 0x5c |
0x0000e242 mov r2, r1 | r2 = r1;
0x0000e244 bne 0xe236 |
| } while (r3 != 0x5c);
0x0000e246 ldrb r3, [r1, 1] | r3 = *((r1 + 1));
0x0000e248 adds r2, r1, 1 | r2 = r1 + 1;
0x0000e24a cmp r3, 0 |
| if (r3 != 0) {
0x0000e24c bne 0xe236 | goto label_1;
| }
| label_22:
0x0000e24e add.w sl, sl, 1 | sl++;
0x0000e252 strb r7, [r0] | *(r0) = r7;
0x0000e254 cmp r8, sl |
| if (r8 == sl) {
0x0000e256 beq 0xe2d2 | goto label_23;
| }
0x0000e258 ldr.w fp, [r6] | fp = *(r6);
0x0000e25c b 0xe196 | goto label_2;
| label_8:
0x0000e25e cmp r7, 0 |
| if (r7 == 0) {
0x0000e260 beq 0xe174 | goto label_3;
| }
| label_16:
0x0000e262 cmp r7, 1 |
| if (r7 != 1) {
0x0000e264 bne 0xe2ca | goto label_24;
| }
0x0000e266 cmp r2, 0x22 |
| if (r2 != 0x22) {
0x0000e268 bne 0xe174 | goto label_3;
| }
| label_10:
0x0000e26a cmp r0, 0x20 |
0x0000e26c it ne |
| if (r0 != 0x20) {
0x0000e26e cmpne r0, 9 | __asm ("cmpne r0, 9");
| }
0x0000e270 mov r8, sb | r8 = sb;
| if (r0 != 0x20) {
0x0000e272 bne 0xe280 | goto label_25;
| }
| do {
0x0000e274 ldrb r0, [r5, 1]! | r0 = *((r5 += 1));
0x0000e278 cmp r0, 9 |
0x0000e27a it ne |
| if (r0 != 9) {
0x0000e27c cmpne r0, 0x20 | __asm ("cmpne r0, 0x20");
| }
0x0000e27e beq 0xe274 |
| } while (r0 == 9);
| label_25:
0x0000e280 add.w sb, sb, 1 | sb++;
0x0000e284 cmp r0, 0 |
| if (r0 != 0) {
0x0000e286 bne.w 0xe13e | goto label_4;
| }
0x0000e28a b 0xe17e | goto label_5;
| label_20:
0x0000e28c cmp r0, 0 |
| if (r0 == 0) {
0x0000e28e beq 0xe1d6 | goto label_6;
| }
| label_19:
0x0000e290 cmp r0, 1 |
| if (r0 != 1) {
0x0000e292 bne 0xe2c4 | goto label_26;
| }
0x0000e294 cmp r2, 0x22 |
| if (r2 != 0x22) {
0x0000e296 bne 0xe1d6 | goto label_6;
| }
0x0000e298 b 0xe208 | goto label_7;
| label_15:
0x0000e29a cmp r0, 0x27 |
0x0000e29c it ne |
| if (r0 != 0x27) {
0x0000e29e cmpne r0, 9 | __asm ("cmpne r0, 9");
| }
0x0000e2a0 and r8, r0, 0xfd | r8 = r0 & 0xfd;
0x0000e2a4 ite eq |
| if (r0 != 0x27) {
0x0000e2a6 moveq ip, 1 |
| }
| if (r0 != 0x27) {
0x0000e2aa mov.w ip, 0 |
| }
0x0000e2ae cmp.w r8, 0x20 |
0x0000e2b2 it eq |
| if (r8 != 0x20) {
0x0000e2b4 orreq ip, ip, 1 |
| }
0x0000e2b8 cmp.w ip, 0 |
| if (ip == 0) {
0x0000e2bc beq 0xe25e | goto label_8;
| }
0x0000e2be ldrb r2, [r1, 2] | r2 = *((r1 + 2));
0x0000e2c0 adds r3, 1 | r3++;
0x0000e2c2 b 0xe176 | goto label_9;
| label_26:
0x0000e2c4 cmp r2, 0x27 |
| if (r2 != 0x27) {
0x0000e2c6 bne 0xe1d6 | goto label_6;
| }
0x0000e2c8 b 0xe208 | goto label_7;
| label_24:
0x0000e2ca cmp r2, 0x27 |
| if (r2 != 0x27) {
0x0000e2cc bne.w 0xe174 | goto label_3;
| }
0x0000e2d0 b 0xe26a | goto label_10;
| label_23:
0x0000e2d2 ldr r3, [r6] | r3 = *(r6);
0x0000e2d4 movs r0, 0 | r0 = 0;
0x0000e2d6 add.w r3, r3, r8, lsl 2 | r3 += (r8 << 2);
0x0000e2da str r0, [r3] | *(r3) = r0;
0x0000e2dc add sp, 0xc |
0x0000e2de pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_12:
0x0000e2e2 ldr r0, [sp, 4] | r0 = var_4h;
0x0000e2e4 movs r1, 4 | r1 = 4;
0x0000e2e6 blx 0xa0d0 | r0 = fcn_0000a0d0 ();
0x0000e2ea mov r3, r0 | r3 = r0;
0x0000e2ec str r0, [r6] | *(r6) = r0;
0x0000e2ee movs r0, 0 | r0 = 0;
0x0000e2f0 str r0, [r3] | *(r3) = r0;
0x0000e2f2 add sp, 0xc |
0x0000e2f4 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xd598 */
| #include <stdint.h>
|
; (fcn) sym.apr_unescape_entity () | void apr_unescape_entity (int16_t arg_1h, int16_t arg1, uint32_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000d598 svcmi 0xf0e92d | __asm ("svcmi aav.0x000000ff");
0x0000d59c sub sp, 0x1c |
0x0000d59e str r3, [sp, 4] | var_4h = r3;
0x0000d5a0 cmp r1, 0 |
| if (r1 == 0) {
0x0000d5a2 beq.w 0xd718 | goto label_8;
| }
0x0000d5a6 mov r5, r2 | r5 = r2;
0x0000d5a8 mov r7, r0 | r7 = r0;
0x0000d5aa ldrb r3, [r1] | r3 = *(r1);
0x0000d5ac mov r4, r1 | r4 = r1;
0x0000d5ae cmp r3, 0 |
0x0000d5b0 it ne |
| if (r3 != 0) {
0x0000d5b2 cmpne r2, 0 | __asm ("cmpne r2, 0");
| }
0x0000d5b4 ite ne |
| if (r3 == 0) {
0x0000d5b6 movne r2, 1 | r2 = 1;
| }
| if (r3 != 0) {
0x0000d5b8 moveq r2, 0 | r2 = 0;
| }
0x0000d5ba cmp r0, 0 |
| if (r0 == 0) {
0x0000d5bc beq 0xd642 | goto label_9;
| }
0x0000d5be cmp r2, 0 |
| if (r2 == 0) {
0x0000d5c0 beq.w 0xd72e | goto label_10;
| }
0x0000d5c4 ldr r2, [pc, 0x32c] |
0x0000d5c6 movs r6, 1 | r6 = 1;
0x0000d5c8 add r2, pc | r2 = 0x1aec0;
0x0000d5ca str r2, [sp, 0xc] | var_ch = r2;
0x0000d5cc movs r2, 0 | r2 = 0;
0x0000d5ce str r2, [sp, 8] | var_8h = r2;
0x0000d5d0 b 0xd5fa |
| while (r3 != 0x26) {
0x0000d5d2 mov sb, r4 | sb = r4;
0x0000d5d4 adds r6, 1 | r6++;
0x0000d5d6 mov r4, r8 | r4 = r8;
0x0000d5d8 mov r1, r7 | r1 = r7;
0x0000d5da strb r3, [r7], 1 | *(r7) = r3;
| r7++;
| label_0:
0x0000d5de ldrb.w r3, [sb, 1] | r3 = *((sb + 1));
0x0000d5e2 subs r5, 1 | r5--;
0x0000d5e4 ite ne |
| if (r5 == 1) {
0x0000d5e6 movne r2, 1 | r2 = 1;
| }
| if (r5 != 1) {
0x0000d5e8 moveq r2, 0 | r2 = 0;
| }
0x0000d5ea cmp r3, 0 |
0x0000d5ec ite eq |
| if (r3 != 0) {
0x0000d5ee moveq r2, 0 | r2 = 0;
| }
| if (r3 == 0) {
0x0000d5f0 andne r2, r2, 1 | r2 &= 1;
| }
0x0000d5f4 cmp r2, 0 |
| if (r2 == 0) {
0x0000d5f6 beq.w 0xd704 | goto label_11;
| }
0x0000d5fa cmp r3, 0x26 |
0x0000d5fc add.w r8, r4, 1 | r8 = r4 + 1;
0x0000d600 bne 0xd5d2 |
| }
0x0000d602 ldrb r2, [r4, 1] | r2 = *((r4 + 1));
0x0000d604 cmp r2, 0 |
0x0000d606 it ne |
| if (r2 != 0) {
0x0000d608 cmpne r2, 0x3b | __asm ("cmpne r2, 0x3b");
| }
| if (r2 == 0) {
0x0000d60a beq.w 0xd774 | goto label_12;
| }
0x0000d60e cmp r5, 1 |
| if (r5 == 1) {
0x0000d610 beq 0xd630 | goto label_5;
| }
0x0000d612 adds r1, r4, 2 | r1 = r4 + 2;
0x0000d614 mov.w fp, 1 |
| do {
0x0000d618 mov sb, r1 | sb = r1;
0x0000d61a ldrb r0, [r1], 1 | r0 = *(r1);
| r1++;
0x0000d61e add.w fp, fp, 1 |
0x0000d622 cmp r0, 0x3b |
0x0000d624 it ne |
| if (r0 != 0x3b) {
0x0000d626 cmpne r0, 0 | __asm ("cmpne r0, 0");
| }
| if (r0 == 0x3b) {
0x0000d628 beq.w 0xd7fa | goto label_13;
| }
0x0000d62c cmp fp, r5 |
0x0000d62e bne 0xd618 |
| } while (fp != r5);
| label_5:
0x0000d630 mov.w r3, 0x26 | r3 = 0x26;
0x0000d634 mov sb, r4 | sb = r4;
0x0000d636 mov r1, r7 | r1 = r7;
0x0000d638 adds r6, 1 | r6++;
0x0000d63a mov r4, r8 | r4 = r8;
0x0000d63c strb r3, [r7], 1 | *(r7) = r3;
| r7++;
0x0000d640 b 0xd5de | goto label_0;
| label_9:
0x0000d642 cmp r2, 0 |
| if (r2 == 0) {
0x0000d644 beq 0xd730 | goto label_14;
| }
0x0000d646 ldr r2, [pc, 0x2b0] |
0x0000d648 movs r6, 1 | r6 = 1;
0x0000d64a str r0, [sp, 8] | var_8h = r0;
0x0000d64c add r2, pc | r2 = 0x1af4a;
0x0000d64e str r2, [sp, 0x10] | var_10h = r2;
0x0000d650 b 0xd666 |
| while (r3 != 0x26) {
| label_1:
0x0000d652 adds r6, 1 | r6++;
0x0000d654 mov r4, sb | r4 = sb;
0x0000d656 mov r3, r8 | r3 = r8;
| label_2:
0x0000d658 subs r5, 1 | r5--;
0x0000d65a and r7, r7, 1 | r7 &= 1;
0x0000d65e it eq |
| if (r5 != 1) {
0x0000d660 moveq r7, 0 | r7 = 0;
| }
0x0000d662 cmp r7, 0 |
| if (r7 == 0) {
0x0000d664 beq 0xd706 | goto label_15;
| }
0x0000d666 ldrb.w r8, [r4, 1] | r8 = *((r4 + 1));
0x0000d66a add.w sb, r4, 1 | sb = r4 + 1;
0x0000d66e subs.w r7, r8, 0 | r7 = r8 - 0;
0x0000d672 it ne |
| if (r7 == r8) {
0x0000d674 movne r7, 1 | r7 = 1;
| }
0x0000d676 cmp r3, 0x26 |
0x0000d678 bne 0xd652 |
| }
0x0000d67a cmp.w r8, 0x3b |
0x0000d67e ite eq |
| if (r8 != 0x3b) {
0x0000d680 moveq r3, 0 | r3 = 0;
| }
| if (r8 == 0x3b) {
0x0000d682 andne r3, r7, 1 | r3 = r7 & 1;
| }
0x0000d686 cmp r5, 1 |
0x0000d688 ite eq |
| if (r5 != 1) {
0x0000d68a moveq r3, 0 | r3 = 0;
| }
| if (r5 == 1) {
0x0000d68c andne r3, r3, 1 | r3 &= 1;
| }
0x0000d690 cmp r3, 0 |
| if (r3 != 0) {
0x0000d692 bne 0xd73e | goto label_16;
| }
0x0000d694 mov.w fp, 1 |
0x0000d698 mov r2, r8 | r2 = r8;
0x0000d69a mov sl, fp | sl = fp;
0x0000d69c str.w sb, [sp, 0xc] | __asm ("str.w sb, [var_ch]");
| label_4:
0x0000d6a0 cmp r2, 0 |
0x0000d6a2 it ne |
| if (r2 != 0) {
0x0000d6a4 cmpne fp, r5 | __asm ("cmpne fp, r5");
| }
0x0000d6a6 ite eq |
| if (r2 != 0) {
0x0000d6a8 moveq r4, 1 | r4 = 1;
| }
| if (r2 != 0) {
0x0000d6aa movne r4, 0 | r4 = 0;
| goto label_17;
| }
| if (r2 == 0) {
| label_17:
0x0000d6ac beq 0xd652 | goto label_1;
| }
0x0000d6ae cmp.w r8, 0x23 |
| if (r8 == 0x23) {
0x0000d6b2 beq.w 0xd80c | goto label_18;
| }
0x0000d6b6 add.w r2, fp, -1 | r2 = fp + -1;
0x0000d6ba adds r6, 1 | r6++;
0x0000d6bc cmp r2, 6 |
| if (r2 > 6) {
0x0000d6be bgt 0xd76e | goto label_19;
| }
0x0000d6c0 ldr r3, [sp, 0x10] | r3 = var_10h;
0x0000d6c2 ldr.w r4, [r3, r2, lsl 2] | offset_0 = r2 << 2;
| r4 = *((r3 + offset_0));
0x0000d6c6 cmp r4, 0 |
| if (r4 == 0) {
0x0000d6c8 beq 0xd76e | goto label_19;
| }
0x0000d6ca ldrb r1, [r4] | r1 = *(r4);
0x0000d6cc cmp r1, 0 |
| if (r1 == 0) {
0x0000d6ce beq 0xd76e | goto label_19;
| }
0x0000d6d0 str r7, [sp, 0x14] | var_14h = r7;
0x0000d6d2 mov r7, r2 | r7 = r2;
0x0000d6d4 b 0xd6de |
| while (r0 != 0) {
0x0000d6d6 ldrb r3, [r4] | r3 = *(r4);
0x0000d6d8 cmp r3, 0 |
| if (r3 == 0) {
0x0000d6da beq.w 0xd804 | goto label_20;
| }
0x0000d6de mov r1, r4 | r1 = r4;
0x0000d6e0 mov r2, r7 | r2 = r7;
0x0000d6e2 mov r0, sb | r0 = sb;
0x0000d6e4 add r4, sl | r4 += sl;
0x0000d6e6 blx 0xac10 | r0 = fcn_0000ac10 ();
0x0000d6ea cmp r0, 0 |
0x0000d6ec bne 0xd6d6 |
| }
0x0000d6ee ldr r4, [sp, 0xc] | r4 = var_ch;
0x0000d6f0 movs r2, 1 | r2 = 1;
0x0000d6f2 sub.w r5, r5, fp | r5 -= fp;
0x0000d6f6 str r2, [sp, 8] | var_8h = r2;
0x0000d6f8 ldrb r3, [r4, 1]! | r3 = *((r4 += 1));
0x0000d6fc subs r7, r3, 0 | r7 = r3 - 0;
0x0000d6fe it ne |
| if (r7 == r3) {
0x0000d700 movne r7, 1 | r7 = 1;
| }
0x0000d702 b 0xd658 | goto label_2;
| label_11:
0x0000d704 strb r2, [r1, 1] | *((r1 + 1)) = r2;
| label_15:
0x0000d706 ldr r3, [sp, 4] | r3 = var_4h;
| if (r3 != 0) {
0x0000d708 cbz r3, 0xd70c |
0x0000d70a str r6, [r3] | *(r3) = r6;
| }
0x0000d70c ldr r3, [sp, 8] | r3 = var_8h;
| if (r3 == 0) {
0x0000d70e cbz r3, 0xd720 | goto label_3;
| }
0x0000d710 movs r0, 0 | r0 = 0;
0x0000d712 add sp, 0x1c |
0x0000d714 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_8:
0x0000d718 ldr r2, [sp, 4] | r2 = var_4h;
| if (r2 == 0) {
0x0000d71a cbz r2, 0xd720 | goto label_3;
| }
0x0000d71c movs r3, 1 | r3 = 1;
0x0000d71e str r3, [r2] | *(r2) = r3;
| do {
| label_3:
0x0000d720 movw r0, 0x117f |
0x0000d724 movt r0, 1 | r0 = 0x1117f;
0x0000d728 add sp, 0x1c |
0x0000d72a pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x0000d72e strb r2, [r0] | *(r0) = r2;
| label_14:
0x0000d730 ldr r3, [sp, 4] | r3 = var_4h;
0x0000d732 cmp r3, 0 |
0x0000d734 beq 0xd720 |
| } while (r3 == 0);
0x0000d736 ldr r2, [sp, 4] | r2 = var_4h;
0x0000d738 movs r3, 1 | r3 = 1;
0x0000d73a str r3, [r2] | *(r2) = r3;
0x0000d73c b 0xd720 | goto label_3;
| label_16:
0x0000d73e adds r3, r4, 2 | r3 = r4 + 2;
0x0000d740 mov.w fp, 1 |
| do {
0x0000d744 mov r0, r3 | r0 = r3;
0x0000d746 ldrb r2, [r3], 1 | r2 = *(r3);
| r3++;
0x0000d74a add.w fp, fp, 1 |
0x0000d74e mov sl, fp | sl = fp;
0x0000d750 cmp r2, 0x3b |
0x0000d752 it ne |
| if (r2 != 0x3b) {
0x0000d754 cmpne r2, 0 | __asm ("cmpne r2, 0");
| }
0x0000d756 ite ne |
| if (r2 == 0x3b) {
0x0000d758 movne r1, 1 | r1 = 1;
| }
| if (r2 != 0x3b) {
0x0000d75a moveq r1, 0 | r1 = 0;
| }
0x0000d75c cmp fp, r5 |
0x0000d75e ite eq |
| if (fp != r5) {
0x0000d760 moveq r1, 0 | r1 = 0;
| }
| if (fp == r5) {
0x0000d762 andne r1, r1, 1 | r1 &= 1;
| }
0x0000d766 cmp r1, 0 |
0x0000d768 bne 0xd744 |
| } while (r1 != 0);
0x0000d76a str r0, [sp, 0xc] | var_ch = r0;
0x0000d76c b 0xd6a0 | goto label_4;
| label_19:
0x0000d76e mov r4, sb | r4 = sb;
0x0000d770 mov r3, r8 | r3 = r8;
0x0000d772 b 0xd658 | goto label_2;
| label_12:
0x0000d774 mov r0, r2 | r0 = r2;
0x0000d776 mov.w fp, 1 |
0x0000d77a mov sb, r8 | sb = r8;
0x0000d77c mov ip, fp |
0x0000d77e cmp r0, 0 |
| if (r0 == 0) {
0x0000d780 beq.w 0xd630 | goto label_5;
| }
| label_6:
0x0000d784 cmp r5, fp |
| if (r5 == fp) {
0x0000d786 beq.w 0xd630 | goto label_5;
| }
0x0000d78a cmp r2, 0x23 |
| if (r2 == 0x23) {
0x0000d78c beq 0xd874 | goto label_21;
| }
0x0000d78e add.w r2, fp, -1 | r2 = fp + -1;
0x0000d792 cmp r2, 6 |
| if (r2 > 6) {
0x0000d794 bgt.w 0xd630 | goto label_5;
| }
0x0000d798 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000d79a ldr.w r1, [r3, r2, lsl 2] | offset_1 = r2 << 2;
| r1 = *((r3 + offset_1));
0x0000d79e cmp r1, 0 |
| if (r1 == 0) {
0x0000d7a0 beq.w 0xd630 | goto label_5;
| }
0x0000d7a4 ldrb r0, [r1] | r0 = *(r1);
0x0000d7a6 cmp r0, 0 |
| if (r0 == 0) {
0x0000d7a8 beq.w 0xd630 | goto label_5;
| }
0x0000d7ac str.w sb, [sp, 0x10] | __asm ("str.w sb, [var_10h]");
0x0000d7b0 mov sl, r2 | sl = r2;
0x0000d7b2 str r4, [sp, 0x14] | var_14h = r4;
0x0000d7b4 mov sb, r1 | sb = r1;
0x0000d7b6 mov r4, ip | r4 = ip;
0x0000d7b8 b 0xd7c2 |
| while (r0 != 0) {
0x0000d7ba add sb, r4 | sb += r4;
0x0000d7bc ldrb.w r3, [sb] | r3 = *(sb);
| if (r3 == 0) {
0x0000d7c0 cbz r3, 0xd7f6 | goto label_22;
| }
0x0000d7c2 mov r1, sb | r1 = sb;
0x0000d7c4 mov r2, sl | r2 = sl;
0x0000d7c6 mov r0, r8 | r0 = r8;
0x0000d7c8 blx 0xac10 | r0 = fcn_0000ac10 ();
0x0000d7cc cmp r0, 0 |
0x0000d7ce bne 0xd7ba |
| }
0x0000d7d0 mov r2, sl | r2 = sl;
0x0000d7d2 mov sl, sb | sl = sb;
0x0000d7d4 ldr.w sb, [sp, 0x10] | sb = var_10h;
0x0000d7d8 sub.w r5, r5, fp | r5 -= fp;
0x0000d7dc ldrb.w r2, [sl, r2] | r2 = *((sl + r2));
0x0000d7e0 adds r6, 1 | r6++;
0x0000d7e2 mov r3, r7 | r3 = r7;
0x0000d7e4 strb r2, [r3], 1 | *(r3) = r2;
| r3++;
| label_7:
0x0000d7e8 mov r1, r7 | r1 = r7;
0x0000d7ea mov r7, r3 | r7 = r3;
0x0000d7ec movs r3, 1 | r3 = 1;
0x0000d7ee add.w r4, sb, 1 | r4 = sb + 1;
0x0000d7f2 str r3, [sp, 8] | var_8h = r3;
0x0000d7f4 b 0xd5de | goto label_0;
| label_22:
0x0000d7f6 ldr r4, [sp, 0x14] | r4 = var_14h;
0x0000d7f8 b 0xd630 | goto label_5;
| label_13:
0x0000d7fa mov ip, fp |
0x0000d7fc cmp r0, 0 |
| if (r0 == 0) {
0x0000d7fe beq.w 0xd630 | goto label_5;
| }
0x0000d802 b 0xd784 | goto label_6;
| label_20:
0x0000d804 ldr r7, [sp, 0x14] | r7 = var_14h;
0x0000d806 mov r4, sb | r4 = sb;
0x0000d808 mov r3, r8 | r3 = r8;
0x0000d80a b 0xd658 | goto label_2;
| label_18:
0x0000d80c cmp.w fp, 2 |
| if (fp <= 2) {
0x0000d810 ble 0xd866 | goto label_23;
| }
0x0000d812 blx 0xa3a8 | fcn_0000a3a8 ();
0x0000d816 mov r2, r4 | r2 = r4;
0x0000d818 ldr r7, [r0] | r7 = *(r0);
0x0000d81a movs r0, 2 | r0 = 2;
0x0000d81c b 0xd828 |
| while ((r4 & 0x800) != 0) {
0x0000d81e adds r0, 1 | r0++;
0x0000d820 sub.w r2, r3, 0x30 | r2 = r3 - 0x30;
0x0000d824 cmp r0, fp |
| if (r0 == fp) {
0x0000d826 beq 0xd83e | goto label_24;
| }
0x0000d828 ldrb r3, [sb, 1]! | r3 = *((sb += 1));
0x0000d82c add.w r1, r2, r2, lsl 2 | r1 = r2 + (r2 << 2);
0x0000d830 ldrh.w r4, [r7, r3, lsl 1] | offset_2 = r3 << 1;
| r4 = *((r7 + offset_2));
0x0000d834 add.w r3, r3, r1, lsl 1 | r3 += (r1 << 1);
0x0000d838 tst.w r4, 0x800 |
0x0000d83c bne 0xd81e |
| }
| label_24:
0x0000d83e cmp r0, fp |
0x0000d840 it ge |
| if (r0 >= fp) {
0x0000d842 cmpge r2, 8 | __asm ("cmpge r2, 8");
| }
| if (r0 > fp) {
0x0000d844 ble 0xd866 |
0x0000d846 sub.w r3, r2, 0xb | r3 = r2 - 0xb;
0x0000d84a cmp r3, 0x14 |
| if (r3 < 0x14) {
0x0000d84c bls 0xd866 | goto label_23;
| }
0x0000d84e cmp r2, 0xff |
0x0000d850 sub.w r3, r2, 0x7f | r3 = r2 - 0x7f;
0x0000d854 ite le |
| if (r2 > 0xff) {
0x0000d856 movle r2, 0 | r2 = 0;
| }
| if (r2 <= 0xff) {
0x0000d858 movgt r2, 1 | r2 = 1;
| }
0x0000d85a cmp r3, 0x21 |
0x0000d85c it ls |
| if (r3 > 0x21) {
0x0000d85e orrls r2, r2, 1 | r2 |= 1;
| }
0x0000d862 cmp r2, 0 |
| if (r2 == 0) {
0x0000d864 beq 0xd8de | goto label_25;
| }
| }
| label_23:
0x0000d866 ldr r4, [sp, 0xc] | r4 = var_ch;
0x0000d868 ldrb r3, [r4, 1]! | r3 = *((r4 += 1));
0x0000d86c subs r7, r3, 0 | r7 = r3 - 0;
0x0000d86e it ne |
| if (r7 == r3) {
0x0000d870 movne r7, 1 | r7 = 1;
| }
0x0000d872 b 0xd658 | goto label_2;
| label_21:
0x0000d874 cmp.w fp, 2 |
| if (fp <= 2) {
0x0000d878 ble 0xd8cc | goto label_26;
| }
0x0000d87a blx 0xa3a8 | fcn_0000a3a8 ();
0x0000d87e movs r4, 2 | r4 = 2;
0x0000d880 ldr r3, [r0] | r3 = *(r0);
0x0000d882 movs r0, 0 | r0 = 0;
0x0000d884 b 0xd890 |
| while ((ip & 0x800) != 0) {
0x0000d886 adds r4, 1 | r4++;
0x0000d888 sub.w r0, r2, 0x30 | r0 = r2 - 0x30;
0x0000d88c cmp r4, fp |
| if (r4 == fp) {
0x0000d88e beq 0xd8a6 | goto label_27;
| }
0x0000d890 ldrb r2, [r8, 1]! | r2 = *((r8 += 1));
0x0000d894 add.w r1, r0, r0, lsl 2 | r1 = r0 + (r0 << 2);
0x0000d898 ldrh.w ip, [r3, r2, lsl 1] | offset_3 = r2 << 1;
| ip = *((r3 + offset_3));
0x0000d89c add.w r2, r2, r1, lsl 1 | r2 += (r1 << 1);
0x0000d8a0 tst.w ip, 0x800 |
0x0000d8a4 bne 0xd886 |
| }
| label_27:
0x0000d8a6 cmp r4, fp |
0x0000d8a8 it ge |
| if (r4 >= fp) {
0x0000d8aa cmpge r0, 8 | __asm ("cmpge r0, 8");
| }
| if (r4 > fp) {
0x0000d8ac ble 0xd8cc |
0x0000d8ae sub.w r3, r0, 0xb | r3 = r0 - 0xb;
0x0000d8b2 cmp r3, 0x14 |
| if (r3 < 0x14) {
0x0000d8b4 bls 0xd8cc | goto label_26;
| }
0x0000d8b6 cmp r0, 0xff |
0x0000d8b8 sub.w r2, r0, 0x7f | r2 = r0 - 0x7f;
0x0000d8bc ite le |
| if (r0 > 0xff) {
0x0000d8be movle r3, 0 | r3 = 0;
| }
| if (r0 <= 0xff) {
0x0000d8c0 movgt r3, 1 | r3 = 1;
| }
0x0000d8c2 cmp r2, 0x21 |
0x0000d8c4 it ls |
| if (r2 > 0x21) {
0x0000d8c6 orrls r3, r3, 1 | r3 |= 1;
| }
| if (r3 == 0) {
0x0000d8ca cbz r3, 0xd8d4 | goto label_28;
| }
| }
| label_26:
0x0000d8cc subs r1, r7, 1 | r1 = r7 - 1;
0x0000d8ce add.w r4, sb, 1 | r4 = sb + 1;
0x0000d8d2 b 0xd5de | goto label_0;
| label_28:
0x0000d8d4 mov r3, r7 | r3 = r7;
0x0000d8d6 adds r6, 1 | r6++;
0x0000d8d8 strb r0, [r3], 1 | *(r3) = r0;
| r3++;
0x0000d8dc b 0xd7e8 | goto label_7;
| label_25:
0x0000d8de ldr r2, [sp, 0xc] | r2 = var_ch;
0x0000d8e0 adds r6, 1 | r6++;
0x0000d8e2 ldrb r3, [r2, 1] | r3 = *((r2 + 1));
0x0000d8e4 adds r4, r2, 1 | r4 = r2 + 1;
0x0000d8e6 movs r2, 1 | r2 = 1;
0x0000d8e8 str r2, [sp, 8] | var_8h = r2;
0x0000d8ea subs r7, r3, 0 | r7 = r3 - 0;
0x0000d8ec it ne |
| if (r7 == r3) {
0x0000d8ee movne r7, 1 | r7 = 1;
| }
0x0000d8f0 b 0xd658 | goto label_2;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libapr-1.so.0.7.0 @ 0xdcec */
| #include <stdint.h>
|
; (fcn) sym.apr_unescape_hex () | void apr_unescape_hex (int16_t arg1, uint32_t arg2, uint32_t arg3, int16_t arg4) {
| int16_t var_4h;
| int16_t var_0h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0000dcec push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000dcf0 sub sp, 0xc |
0x0000dcf2 str r3, [sp, 4] | var_4h = r3;
0x0000dcf4 cmp r1, 0 |
| if (r1 == 0) {
0x0000dcf6 beq.w 0xde64 | goto label_9;
| }
0x0000dcfa mov sl, r0 | sl = r0;
0x0000dcfc ldrb r5, [r1] | r5 = *(r1);
0x0000dcfe cmp r5, 0 |
0x0000dd00 it ne |
| if (r5 != 0) {
0x0000dd02 cmpne r2, 0 | __asm ("cmpne r2, 0");
| }
0x0000dd04 mov r4, r5 | r4 = r5;
0x0000dd06 ite ne |
| if (r5 == 0) {
0x0000dd08 movne r3, 1 | r3 = 1;
| }
| if (r5 != 0) {
0x0000dd0a moveq r3, 0 | r3 = 0;
| }
0x0000dd0c cmp r0, 0 |
| if (r0 == 0) {
0x0000dd0e beq 0xdd90 | goto label_10;
| }
0x0000dd10 cmp r3, 0 |
| if (r3 == 0) {
0x0000dd12 beq.w 0xde8e | goto label_11;
| }
0x0000dd16 mov.w fp, 0 |
0x0000dd1a subs r6, r2, 1 | r6 = r2 - 1;
0x0000dd1c add.w r8, r1, 1 | r8 = r1 + 1;
0x0000dd20 mov r7, fp | r7 = fp;
0x0000dd22 mov sb, fp | sb = fp;
| if (r7 == 0) {
| do {
0x0000dd24 cbnz r7, 0xdd3c |
0x0000dd26 ldr r2, [sp, 4] | r2 = var_4h;
0x0000dd28 mov fp, r7 |
0x0000dd2a subs r2, 0 |
0x0000dd2c it ne |
| if (r2 == 0) {
0x0000dd2e movne r2, 1 | r2 = 1;
| }
0x0000dd30 cmp r5, 0x3a |
0x0000dd32 it ne |
| if (r5 == 0x3a) {
0x0000dd34 movne r2, 0 | r2 = 0;
| }
0x0000dd36 cmp r2, 0 |
| if (r2 != 0) {
0x0000dd38 bne.w 0xde5e | goto label_12;
| }
| }
0x0000dd3c blx 0xa3a8 | r0 = fcn_0000a3a8 ();
0x0000dd40 ldr r2, [r0] | r2 = *(r0);
0x0000dd42 ldrh.w r2, [r2, r5, lsl 1] | offset_0 = r5 << 1;
| r2 = *((r2 + offset_0));
0x0000dd46 lsls r3, r2, 0x14 | r3 = r2 << 0x14;
| if (r3 >= r2) {
0x0000dd48 bpl 0xde1c | goto label_13;
| }
0x0000dd4a subs r4, 0x30 | r4 -= 0x30;
0x0000dd4c orr.w r4, fp, r4 | r4 = fp | r4;
0x0000dd50 uxtb.w fp, r4 | fp = (int8_t) r4;
| label_3:
0x0000dd54 cmp r7, 0 |
| if (r7 == 0) {
0x0000dd56 beq 0xde52 | goto label_14;
| }
| label_4:
0x0000dd58 add.w r0, sl, 1 | r0 = sl + 1;
0x0000dd5c add.w sb, sb, 1 | sb++;
| label_5:
0x0000dd60 strb.w fp, [sl] | *(sl) = fp;
0x0000dd64 eor r7, r7, 1 | r7 ^= 1;
0x0000dd68 mov r2, r6 | r2 = r6;
0x0000dd6a mov sl, r0 | sl = r0;
| label_6:
0x0000dd6c ldrb r4, [r8], 1 | r4 = *(r8);
| r8++;
0x0000dd70 subs r6, 1 | r6--;
0x0000dd72 cmp r2, 0 |
0x0000dd74 it ne |
| if (r2 != 0) {
0x0000dd76 cmpne r4, 0 | __asm ("cmpne r4, 0");
| }
0x0000dd78 mov r5, r4 | r5 = r4;
0x0000dd7a bne 0xdd24 |
| } while (r2 != 0);
| do {
| label_8:
0x0000dd7c ldr r3, [sp, 0x30] | r3 = var_0h;
0x0000dd7e mov r0, r3 | r0 = r3;
| if (r3 != 0) {
0x0000dd80 cbz r3, 0xdd8a |
0x0000dd82 ldr r3, [sp, 0x30] | r3 = var_0h;
0x0000dd84 movs r0, 0 | r0 = 0;
0x0000dd86 str.w sb, [r3] | __asm ("str.w sb, [r3]");
| }
| label_7:
0x0000dd8a add sp, 0xc |
0x0000dd8c pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x0000dd90 cmp r3, 0 |
| if (r3 == 0) {
0x0000dd92 beq 0xde8e | goto label_11;
| }
0x0000dd94 ldr r3, [sp, 4] | r3 = var_4h;
0x0000dd96 subs r6, r2, 1 | r6 = r2 - 1;
0x0000dd98 adds r4, r1, 1 | r4 = r1 + 1;
0x0000dd9a mov sb, r0 | sb = r0;
0x0000dd9c subs.w r8, r3, 0 | r8 = r3 - 0;
0x0000dda0 it ne |
| if (r8 == r3) {
0x0000dda2 movne r8, 1 | r8 = 1;
| }
0x0000dda6 b 0xdddc | goto label_15;
| label_0:
0x0000dda8 cmp.w sl, 0 |
| if (sl != 0) {
0x0000ddac beq 0xddcc |
0x0000ddae blx 0xa3a8 | r0 = fcn_0000a3a8 ();
0x0000ddb2 ldr r3, [r0] | r3 = *(r0);
0x0000ddb4 ldrh.w r3, [r3, 0x74] | r3 = *((r3 + 0x74));
0x0000ddb8 lsls r1, r3, 0x14 | r1 = r3 << 0x14;
| if (r1 >= r3) {
0x0000ddba bmi 0xddc4 |
0x0000ddbc lsls r2, r3, 0x17 | r2 = r3 << 0x17;
| if (r2 < r3) {
0x0000ddbe bmi 0xddc4 | goto label_2;
| }
0x0000ddc0 lsls r3, r3, 0x16 | r3 <<= 0x16;
| if (r3 >= r3) {
0x0000ddc2 bpl 0xde7a | goto label_16;
| }
| }
| label_2:
0x0000ddc4 add.w sb, sb, 1 | sb++;
| label_1:
0x0000ddc8 eor sl, sl, 1 | sl ^= 1;
| }
0x0000ddcc ldrb r5, [r4], 1 | r5 = *(r4);
| r4++;
0x0000ddd0 mov r3, r6 | r3 = r6;
0x0000ddd2 subs r6, 1 | r6--;
0x0000ddd4 cmp r5, 0 |
0x0000ddd6 it ne |
| if (r5 != 0) {
0x0000ddd8 cmpne r3, 0 | __asm ("cmpne r3, 0");
| }
0x0000ddda beq 0xdd7c |
| } while (r5 == 0);
| label_15:
0x0000dddc cmp r5, 0x3a |
0x0000ddde ite ne |
| if (r5 == 0x3a) {
0x0000dde0 movne r3, 0 | r3 = 0;
| }
| if (r5 != 0x3a) {
0x0000dde2 andeq r3, r8, 1 | r3 = r8 & 1;
| }
0x0000dde6 cmp r3, 0 |
| if (r3 != 0) {
0x0000dde8 bne 0xdda8 | goto label_0;
| }
0x0000ddea blx 0xa3a8 | r0 = fcn_0000a3a8 ();
0x0000ddee ldr r3, [r0] | r3 = *(r0);
0x0000ddf0 ldrh.w r3, [r3, r5, lsl 1] | offset_1 = r5 << 1;
| r3 = *((r3 + offset_1));
0x0000ddf4 lsls r0, r3, 0x14 | r0 = r3 << 0x14;
| if (r0 >= r3) {
0x0000ddf6 bmi 0xde14 |
0x0000ddf8 cmp r5, 0x46 |
0x0000ddfa ite hi |
| if (r5 <= 0x46) {
0x0000ddfc movhi r2, 0 | r2 = 0;
| }
| if (r5 > 0x46) {
0x0000ddfe movls r2, 1 | r2 = 1;
| }
0x0000de00 ands.w r2, r2, r3, lsr 8 | r2 &= (r3 >> 8);
| if (r2 != r2) {
0x0000de04 bne 0xde14 | goto label_17;
| }
0x0000de06 cmp r5, 0x66 |
0x0000de08 ite hi |
| if (r5 <= 0x66) {
0x0000de0a movhi r5, 0 | r5 = 0;
| }
| if (r5 > 0x66) {
0x0000de0c movls r5, 1 | r5 = 1;
| }
0x0000de0e ands.w r5, r5, r3, lsr 9 | r5 &= (r3 >> 9);
| if (r5 == r5) {
0x0000de12 beq 0xde7a | goto label_16;
| }
| }
| label_17:
0x0000de14 cmp.w sl, 0 |
| if (sl == 0) {
0x0000de18 beq 0xddc8 | goto label_1;
| }
0x0000de1a b 0xddc4 | goto label_2;
| label_13:
0x0000de1c cmp r5, 0x46 |
0x0000de1e ite hi |
| if (r5 <= 0x46) {
0x0000de20 movhi r0, 0 | r0 = 0;
| }
| if (r5 > 0x46) {
0x0000de22 movls r0, 1 | r0 = 1;
| }
0x0000de24 ands.w r0, r0, r2, lsr 8 | r0 &= (r2 >> 8);
0x0000de28 ittt ne |
| if (r0 == r0) {
0x0000de2a subne r4, 0x37 | r4 -= 0x37;
| }
| if (r0 == r0) {
0x0000de2c orrne r4, fp, r4 | r4 = fp | r4;
| }
| if (r0 == r0) {
0x0000de30 uxtb.w fp, r4 | fp = (int8_t) r4;
| goto label_18;
| }
| if (r0 != r0) {
| label_18:
0x0000de34 bne 0xdd54 | goto label_3;
| }
0x0000de36 cmp r5, 0x66 |
0x0000de38 ite hi |
| if (r5 <= 0x66) {
0x0000de3a movhi r5, 0 | r5 = 0;
| }
| if (r5 > 0x66) {
0x0000de3c movls r5, 1 | r5 = 1;
| }
0x0000de3e ands.w r5, r5, r2, lsr 9 | r5 &= (r2 >> 9);
| if (r5 == r5) {
0x0000de42 beq 0xde7a | goto label_16;
| }
0x0000de44 subs r4, 0x57 | r4 -= 0x57;
0x0000de46 orr.w r4, fp, r4 | r4 = fp | r4;
0x0000de4a uxtb.w fp, r4 | fp = (int8_t) r4;
0x0000de4e cmp r7, 0 |
| if (r7 != 0) {
0x0000de50 bne 0xdd58 | goto label_4;
| }
| label_14:
0x0000de52 lsl.w fp, fp, 4 |
0x0000de56 mov r0, sl | r0 = sl;
0x0000de58 uxtb.w fp, fp | fp = (int8_t) fp;
0x0000de5c b 0xdd60 | goto label_5;
| label_12:
0x0000de5e mov r2, r6 | r2 = r6;
0x0000de60 mov fp, r7 |
0x0000de62 b 0xdd6c | goto label_6;
| label_9:
0x0000de64 ldr r3, [sp, 0x30] | r3 = var_0h;
0x0000de66 movw r0, 0x117f | r0 = 0x117f;
| if (r3 != 0) {
0x0000de6a cbz r3, 0xde88 |
0x0000de6c ldr r3, [sp, 0x30] | r3 = var_0h;
0x0000de6e movt r0, 1 | r0 = (r0 & 0xFFFF) | 0x10000;
0x0000de72 str r1, [r3] | *(r3) = r1;
0x0000de74 add sp, 0xc |
0x0000de76 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_16:
0x0000de7a movw r0, 0x117c |
0x0000de7e movt r0, 1 | r0 = 0x1117c;
0x0000de82 add sp, 0xc |
0x0000de84 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x0000de88 movt r0, 1 | r0 = (r0 & 0xFFFF) | 0x10000;
0x0000de8c b 0xdd8a | goto label_7;
| label_11:
0x0000de8e mov sb, r3 | sb = r3;
0x0000de90 b 0xdd7c | goto label_8;
| }
[*] Function fprintf used 1 times libapr-1.so.0.7.0