[*] Binary protection state of filefrag
Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of filefrag
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/filefrag @ 0x16bc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000016bc () | void fcn_000016bc (int16_t arg_0h, int16_t arg_1h, int16_t arg_10h, int16_t arg_14h, int16_t arg_1ch, int16_t arg_20h, int16_t fildes, int16_t arg_28h, int16_t arg_2ch, int16_t arg_30h, int16_t arg_34h, int16_t arg_38h, int16_t arg_3ch, int16_t arg_40h, int16_t arg_44h, int16_t arg_48h, int16_t arg_4ch, int16_t arg_50h, int16_t arg_54h, int16_t arg_58h, int16_t arg_5ch, int16_t arg_60h, int16_t arg_64h, int16_t arg_68h, int16_t arg_6ch, int16_t arg_70h, int16_t arg_74h, int16_t arg_78h, int16_t arg_7ch, uint32_t request, uint32_t arg_84h, int16_t arg_8ch, int16_t arg_90h, void * s, int16_t arg_130h, int16_t arg_26ch, int16_t arg3) {
| int16_t var_0h;
| int16_t var_4h;
| r2 = arg3;
| label_2:
0x00000a9e ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x00000aa0 movs r3, 1 | r3 = 1;
0x00000aa2 ldr r0, [sp, 0x30] | r0 = *(arg_30h);
0x00000aa4 movs r1, 0 | r1 = 0;
0x00000aa6 str r3, [r2] | *(r2) = r3;
0x00000aa8 blx 0x870 | open64 ();
0x00000aac ldr r3, [sp, 0x48] | r3 = *(arg_48h);
0x00000aae clz r3, r3 | r3 &= r3;
0x00000ab2 lsrs r3, r3, 5 | r3 >>= 5;
0x00000ab4 str r3, [sp, 0x3c] | *(arg_3ch) = r3;
0x00000ab6 subs r3, r0, 0 | r3 = r0 - 0;
0x00000ab8 str r3, [sp, 0x24] | *(fildes) = r3;
| if (r3 < r0) {
0x00000aba blt.w 0x10be | goto label_25;
| }
0x00000abe add.w sb, sp, 0x90 | sb += arg_90h;
0x00000ac2 mov r1, sb | r1 = sb;
0x00000ac4 blx 0x930 | r0 = fstat64 ();
0x00000ac8 cmp r0, 0 |
| if (r0 < 0) {
0x00000aca blt.w 0x136a | goto label_26;
| }
0x00000ace ldr r4, [sp, 0x70] | r4 = *(arg_70h);
0x00000ad0 ldrd r2, r1, [sb] | __asm ("ldrd r2, r1, [sb]");
0x00000ad4 ldrd r3, r0, [r4, 0x28] | __asm ("ldrd r3, r0, [r4, 0x28]");
0x00000ad8 cmp r0, r1 |
0x00000ada it eq |
| if (r0 == r1) {
0x00000adc cmpeq r3, r2 | __asm ("cmpeq r3, r2");
| }
0x00000ade ite ne |
| if (r0 == r1) {
0x00000ae0 movne r3, 1 | r3 = 1;
| }
| if (r0 != r1) {
0x00000ae2 moveq r3, 0 | r3 = 0;
| }
0x00000ae4 orrs r2, r1 | r2 |= r1;
0x00000ae6 it eq |
| if (r2 != r1) {
0x00000ae8 orreq r3, r3, 1 | r3 |= 1;
| }
| if (r3 != 0) {
0x00000aec cbz r3, 0xb2e |
0x00000aee ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00000af0 add.w r1, r4, 0x30 | r1 = r4 + 0x30;
0x00000af4 blx 0x900 | r0 = fstatfs ();
0x00000af8 cmp r0, 0 |
| if (r0 < 0) {
0x00000afa blt.w 0x125e | goto label_27;
| }
0x00000afe ldr r4, [sp, 0x70] | r4 = *(arg_70h);
0x00000b00 movs r1, 2 | r1 = 2;
0x00000b02 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00000b04 add.w r2, r4, 0x70 | r2 = r4 + 0x70;
0x00000b08 blx 0x864 | r0 = ioctl (r0, r1);
0x00000b0c cmp r0, 0 |
| if (r0 >= 0) {
0x00000b0e blt 0xb14 |
0x00000b10 ldr r3, [r4, 0x70] | r3 = *((r4 + 0x70));
| if (r3 != 0) {
0x00000b12 cbnz r3, 0xb1e | goto label_28;
| }
| }
0x00000b14 ldr.w r3, [pc, 0x9e0] | r3 = *(0x000014f8);
0x00000b18 add r3, pc | r3 += pc;
0x00000b1a ldr r2, [r3, 0x34] | r2 = *((r3 + 0x34));
0x00000b1c str r2, [r3, 0x70] | *((r3 + 0x70)) = r2;
| label_28:
0x00000b1e ldr.w r3, [pc, 0x9dc] | r3 = *(0x000014fc);
0x00000b22 add r3, pc | r3 += pc;
0x00000b24 ldr r1, [r3, 0x14] | r1 = *((r3 + 0x14));
0x00000b26 ldr r2, [r3, 0x30] | r2 = *((r3 + 0x30));
0x00000b28 cmp r1, 0 |
| if (r1 != 0) {
0x00000b2a bne.w 0x1284 | goto label_29;
| }
| }
| label_12:
0x00000b2e ldr.w r4, [pc, 0x9d0] | r4 = *(0x00001500);
0x00000b32 add r4, pc | r4 += pc;
0x00000b34 ldr r3, [r4, 0x30] | r3 = *((r4 + 0x30));
0x00000b36 ldr r5, [r4, 0x70] | r5 = *((r4 + 0x70));
0x00000b38 sub.w r3, r3, 0xef00 | r3 -= 0xef00;
0x00000b3c subs r3, 0x51 | r3 -= 0x51;
0x00000b3e str.w r5, [sb, 0x38] | __asm ("str.w r5, [sb, 0x38]");
0x00000b42 cmp r3, 2 |
0x00000b44 itt hi |
| if (r3 <= 2) {
0x00000b46 movhi r3, 0 | r3 = 0;
| }
| if (r3 <= 2) {
0x00000b48 strhi r3, [sp, 0x38] | *(arg_38h) = r3;
| }
| if (r3 < 2) {
0x00000b4a bls.w 0x11aa | goto label_30;
| }
| label_8:
0x00000b4e movs r3, 1 | r3 = 1;
0x00000b50 str r3, [sp, 0x78] | *(arg_78h) = r3;
| label_9:
0x00000b52 ldr.w r1, [pc, 0x9b0] | r1 = *(0x00001504);
0x00000b56 movw r0, 0xcccd |
0x00000b5a movt r0, 0xcccc | r0 = 0xcccccccd;
0x00000b5e mov.w r7, -0x33333334 | r7 = -0x33333334;
0x00000b62 ldrd sl, fp, [sp, 0x90] | __asm ("ldrd sl, fp, [arg_90h]");
0x00000b66 add r1, pc | r1 += pc;
0x00000b68 ldr r2, [r1, 0x38] | r2 = *((r1 + 0x38));
0x00000b6a strd sl, fp, [r1, 0x28] | __asm ("strd sl, fp, [r1, 0x28]");
0x00000b6e adds r3, r2, 0 | r3 = r2 + 0;
0x00000b70 umull r4, r6, r0, r3 | r4:r6 = r0 * r3;
0x00000b74 bic r4, r6, 3 | r4 = BIT_MASK (r6, 3);
0x00000b78 add.w r4, r4, r6, lsr 2 | r4 += (r6 >> 2);
0x00000b7c sub.w ip, r3, r4 |
0x00000b80 subs.w ip, r2, ip |
0x00000b84 mul r3, r7, ip | r3 = r7 * ip;
0x00000b88 sbc.w r6, r6, r6 | __asm ("sbc.w r6, r6, r6");
0x00000b8c cmp r2, 9 |
0x00000b8e umull ip, r4, ip, r0 | ip:r4 = ip * r0;
0x00000b92 mla r3, r0, r6, r3 | __asm ("mla r3, r0, r6, r3");
0x00000b96 lsr.w ip, ip, 1 |
0x00000b9a add r3, r4 | r3 += r4;
0x00000b9c mov.w r4, 0 | r4 = 0;
0x00000ba0 orr.w ip, ip, r3, lsl 31 |
0x00000ba4 lsr.w r3, r3, 1 | r3 >>= 1;
| if (r2 < 9) {
0x00000ba8 bls 0xbf6 | goto label_31;
| }
0x00000baa mov r6, r0 | r6 = r0;
0x00000bac mov r2, r3 | r2 = r3;
| do {
0x00000bae adds.w r3, ip, r2 | r3 = ip + r2;
0x00000bb2 mov lr, ip | lr = ip;
0x00000bb4 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00000bb8 adds r4, 1 | r4++;
0x00000bba umull r1, ip, r0, r3 | r1:ip = r0 * r3;
0x00000bbe mov r1, r2 | r1 = r2;
0x00000bc0 bic r2, ip, 3 | r2 = BIT_MASK (ip, 3);
0x00000bc4 add.w r2, r2, ip, lsr 2 | r2 += (ip >> 2);
0x00000bc8 subs r3, r3, r2 | r3 -= r2;
0x00000bca subs.w r3, lr, r3 | r3 = lr - r3;
0x00000bce mul r2, r7, r3 | r2 = r7 * r3;
0x00000bd2 sbc ip, r1, 0 | __asm ("sbc ip, r1, 0");
0x00000bd6 cmp.w lr, 0xa |
0x00000bda sbcs r1, r1, 0 | __asm ("sbcs r1, r1, 0");
0x00000bde mla r2, r0, ip, r2 | __asm ("mla r2, r0, ip, r2");
0x00000be2 umull r3, ip, r3, r6 | r3:ip = r3 * r6;
0x00000be4 subs r4, 6 | r4 -= 6;
0x00000be6 lsr.w r3, r3, 1 | r3 >>= 1;
0x00000bea add r2, ip | r2 += ip;
0x00000bec orr.w ip, r3, r2, lsl 31 |
0x00000bf0 lsr.w r2, r2, 1 | r2 >>= 1;
0x00000bf4 bhs 0xbae |
| } while (r4 >= 6);
| label_31:
0x00000bf6 ldr.w r3, [pc, 0x910] | r3 = *(0x00001508);
0x00000bfa ldr.w r1, [sb, 0x30] | r1 = *((sb + 0x30));
0x00000bfe add r3, pc | r3 += pc;
0x00000c00 ldr r2, [r3] | r2 = *(r3);
0x00000c02 str r1, [sp, 0x20] | *(arg_20h) = r1;
0x00000c04 cmp r2, r4 |
0x00000c06 mov r2, r5 | r2 = r5;
0x00000c08 it lt |
| if (r2 >= r4) {
0x00000c0a strlt r4, [r3] | *(r3) = r4;
| }
0x00000c0c adds r0, r1, r5 | r0 = r1 + r5;
0x00000c0e ldr.w r4, [sb, 0x34] | r4 = *((sb + 0x34));
0x00000c12 mov.w r3, 0 | r3 = 0;
0x00000c16 adc r1, r4, 0 | __asm ("adc r1, r4, 0");
0x00000c1a subs r0, 1 | r0--;
0x00000c1c sbc r1, r1, 0 | __asm ("sbc r1, r1, 0");
0x00000c20 str r4, [sp, 0x28] | *(arg_28h) = r4;
0x00000c22 bl 0x24a8 | fcn_000024a8 (r0, r1, r2, r3);
0x00000c26 ldr.w r3, [pc, 0x8e4] | r3 = *(0x0000150c);
0x00000c2a mov fp, r0 |
0x00000c2c str r0, [sp, 0x1c] | *(arg_1ch) = r0;
0x00000c2e add r3, pc | r3 += pc;
0x00000c30 ldr r2, [r3, 0x1c] | r2 = *((r3 + 0x1c));
0x00000c32 mov r3, r1 | r3 = r1;
0x00000c34 cmp r2, 0 |
| if (r2 == 0) {
0x00000c36 beq.w 0x1122 | goto label_32;
| }
0x00000c3a lsrs r2, r2, 1 | r2 >>= 1;
| if (r2 == r2) {
0x00000c3c beq.w 0x15fa | goto label_33;
| }
0x00000c40 mov.w sl, 0 | sl = 0;
| do {
0x00000c44 lsrs r2, r2, 1 | r2 >>= 1;
0x00000c46 add.w sl, sl, 1 | sl++;
0x00000c4a bne 0xc44 |
| } while (r2 != r2);
| label_4:
0x00000c4c ldr.w r2, [pc, 0x8c0] | r2 = *(0x00001510);
0x00000c50 add r2, pc | r2 += pc;
0x00000c52 ldr r2, [r2, 0xc] | r2 = *((r2 + 0xc));
0x00000c54 cmp r2, 0 |
| if (r2 != 0) {
0x00000c56 bne.w 0x111e | goto label_34;
| }
0x00000c5a ldr r7, [sp, 0x1c] | r7 = *(arg_1ch);
0x00000c5c movw r6, 0xcccd |
0x00000c60 movt r6, 0xcccc | r6 = 0xcccccccd;
0x00000c64 mov.w ip, -0x33333334 |
0x00000c68 adds r3, r7, r3 | r3 = r7 + r3;
0x00000c6a adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00000c6e umull r0, r4, r6, r3 | r0:r4 = r6 * r3;
0x00000c72 bic r0, r4, 3 | r0 = BIT_MASK (r4, 3);
0x00000c76 add.w r0, r0, r4, lsr 2 | r0 += (r4 >> 2);
0x00000c7a sub.w lr, r3, r0 | lr = r3 - r0;
0x00000c7e subs.w lr, r7, lr | lr = r7 - lr;
0x00000c82 mul r3, ip, lr | r3 = ip * lr;
0x00000c86 sbc r4, r1, 0 | __asm ("sbc r4, r1, 0");
0x00000c8a cmp.w fp, 0xa |
0x00000c8e umull lr, r0, lr, r6 | lr:r0 = lr * r6;
0x00000c92 mla r3, r6, r4, r3 | __asm ("mla r3, r6, r4, r3");
0x00000c96 lsr.w lr, lr, 1 | lr >>= 1;
0x00000c9a add r3, r0 | r3 += r0;
0x00000c9c sbcs r0, r1, 0 | __asm ("sbcs r0, r1, 0");
0x00000ca0 orr.w lr, lr, r3, lsl 31 | lr |= (r3 << 31);
0x00000ca4 lsr.w r3, r3, 1 | r3 >>= 1;
| if (fp <= 0xa) {
0x00000ca8 blo 0xcf6 | goto label_3;
| }
0x00000caa mov r7, r6 | r7 = r6;
0x00000cac mov r0, r3 | r0 = r3;
| do {
0x00000cae adds.w r3, lr, r0 | r3 = lr + r0;
0x00000cb2 mov r8, lr | r8 = lr;
0x00000cb4 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00000cb8 adds r2, 1 | r2++;
0x00000cba umull r4, lr, r6, r3 | r4:lr = r6 * r3;
0x00000cbe mov r4, r0 | r4 = r0;
0x00000cc0 bic r0, lr, 3 | r0 = BIT_MASK (lr, 3);
0x00000cc4 add.w r0, r0, lr, lsr 2 | r0 += (lr >> 2);
0x00000cc8 subs r3, r3, r0 | r3 -= r0;
0x00000cca subs.w r3, r8, r3 | r3 = r8 - r3;
0x00000cce mul lr, ip, r3 | lr = ip * r3;
0x00000cd2 sbc r0, r4, 0 | __asm ("sbc r0, r4, 0");
0x00000cd6 cmp.w r8, 0xa |
0x00000cda sbcs r4, r4, 0 | __asm ("sbcs r4, r4, 0");
0x00000cdc lsls r0, r0, 0x10 | r0 <<= 0x10;
0x00000cde mla lr, r6, r0, lr | __asm ("mla lr, r6, r0, lr");
0x00000ce2 umull r0, r3, r3, r7 | r0:r3 = r3 * r7;
0x00000ce6 lsr.w r0, r0, 1 | r0 >>= 1;
0x00000cea add r3, lr | r3 += lr;
0x00000cec orr.w lr, r0, r3, lsl 31 | lr = r0 | (r3 << 31);
0x00000cf0 lsr.w r0, r3, 1 | r0 = r3 >> 1;
0x00000cf4 bhs 0xcae |
| } while (r0 >= r0);
| label_3:
0x00000cf6 ldr.w r0, [pc, 0x81c] | r0 = *(0x00001514);
0x00000cfa add r0, pc | r0 += pc;
0x00000cfc ldr r3, [r0, 4] | r3 = *((r0 + 4));
0x00000cfe cmp r3, r2 |
0x00000d00 ldr.w r3, [pc, 0x814] | r3 = *(0x00001518);
0x00000d04 it lt |
| if (r3 >= r2) {
0x00000d06 strlt r2, [r0, 4] | *((r0 + 4)) = r2;
| }
0x00000d08 add r3, pc | r3 += pc;
0x00000d0a ldr r3, [r3, 0x14] | r3 = *((r3 + 0x14));
0x00000d0c cmp r3, 0 |
| if (r3 != 0) {
0x00000d0e beq 0xd88 |
0x00000d10 ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00000d12 rsb.w r0, sl, 0x20 | r0 = 0x20 - sl;
0x00000d16 umull r3, r2, r5, r3 | r3:r2 = r5 * r3;
0x00000d1a mla r2, r5, r1, r2 | __asm ("mla r2, r5, r1, r2");
0x00000d1e lsr.w r3, r3, sl | r3 >>= sl;
0x00000d22 lsl.w r0, r2, r0 | r0 = r2 << r0;
0x00000d26 orrs r3, r0 | r3 |= r0;
0x00000d28 sub.w r0, sl, 0x20 | r0 = sl - 0x20;
0x00000d2c lsr.w r0, r2, r0 | r0 = r2 >> r0;
0x00000d30 lsr.w r2, r2, sl | r2 >>= sl;
0x00000d34 orrs r3, r0 | r3 |= r0;
0x00000d36 add.w r0, fp, -1 | r0 = fp + -1;
0x00000d3a orrs r0, r1 | r0 |= r1;
| if (r0 == r1) {
0x00000d3c beq.w 0x13d0 | goto label_35;
| }
0x00000d40 ldr.w r1, [pc, 0x7d8] |
0x00000d44 add r1, pc | r1 = 0x2264;
| label_18:
0x00000d46 strd r3, r2, [sp, 8] | __asm ("strd r3, r2, [sp, 8]");
0x00000d4a movs r4, 1 | r4 = 1;
0x00000d4c ldr r3, [sp, 0x20] | r3 = *(arg_20h);
0x00000d4e mov r0, r4 | r0 = r4;
0x00000d50 str r1, [sp, 0x10] | *(arg_10h) = r1;
0x00000d52 ldr.w r1, [pc, 0x7cc] |
0x00000d56 str r3, [sp] | *(sp) = r3;
0x00000d58 ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00000d5a ldr r2, [sp, 0x30] | r2 = *(arg_30h);
0x00000d5c add r1, pc | r1 = 0x2282;
0x00000d5e str r3, [sp, 4] | var_4h = r3;
0x00000d60 lsl.w r3, r4, sl | r3 = r4 << sl;
0x00000d64 str r3, [sp, 0x14] | *(arg_14h) = r3;
0x00000d66 blx 0x8f4 | printf_chk ();
0x00000d6a ldr.w r3, [pc, 0x7b8] | r3 = *(0x00001524);
0x00000d6e add r3, pc | r3 += pc;
0x00000d70 ldr r3, [r3, 0xc] | r3 = *((r3 + 0xc));
0x00000d72 cmp r3, 0 |
| if (r3 != 0) {
0x00000d74 bne.w 0x13d6 | goto label_36;
| }
| label_19:
0x00000d78 ldr.w r3, [pc, 0x7ac] | r3 = *(0x1528);
0x00000d7c ldr r2, [sp, 0x5c] | r2 = *(arg_5ch);
0x00000d7e ldr r5, [r2, r3] | r5 = *((r2 + r3));
| label_20:
0x00000d80 ldr r1, [r5] | r1 = *(r5);
0x00000d82 movs r0, 0xa | r0 = 0xa;
0x00000d84 blx 0x924 | fputc (r0, r1);
| }
0x00000d88 ldr.w r5, [pc, 0x7a0] | r5 = *(0x0000152c);
0x00000d8c add r5, pc | r5 += pc;
0x00000d8e ldr r3, [r5, 0x18] | r3 = *((r5 + 0x18));
0x00000d90 cmp r3, 0 |
| if (r3 == 0) {
0x00000d92 beq.w 0x121a | goto label_37;
| }
| label_10:
0x00000d96 add r3, sp, 0x130 | r3 += arg_130h;
0x00000d98 add r4, sp, 0xf8 | r4 += s;
0x00000d9a mov r6, r3 | r6 = r3;
0x00000d9c movs r2, 0x38 | r2 = 0x38;
0x00000d9e movs r1, 0 | r1 = 0;
0x00000da0 mov r0, r4 | r0 = r4;
0x00000da2 str r3, [sp, 0x74] | *(arg_74h) = r3;
0x00000da4 ldr.w r5, [sb, 0x38] | r5 = *((sb + 0x38));
0x00000da8 blx 0x8e8 | memset (r0, r1, r2);
0x00000dac movs r2, 0x38 | r2 = 0x38;
0x00000dae movs r1, 0 | r1 = 0;
0x00000db0 mov r0, r6 | r0 = r6;
0x00000db2 blx 0x8e8 | memset (r0, r1, r2);
0x00000db6 ldr.w r3, [pc, 0x778] | r3 = *(0x00001530);
0x00000dba add r3, pc | r3 += pc;
0x00000dbc ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
| if (r3 != 0) {
0x00000dbe cbz r3, 0xdc6 |
0x00000dc0 mov.w r3, 0x1000 | r3 = 0x1000;
0x00000dc4 str r3, [r4, 0x28] | *((r4 + 0x28)) = r3;
| }
0x00000dc6 ldr.w r3, [pc, 0x76c] | r3 = *(0x00001534);
0x00000dca add r3, pc | r3 += pc;
0x00000dcc ldr r3, [r3] | r3 = *(r3);
0x00000dce cmp r3, 0 |
| if (r3 != 0) {
0x00000dd0 bne.w 0x13ae | goto label_38;
| }
| label_16:
0x00000dd4 ldr r3, [sp, 0x44] | r3 = *(arg_44h);
0x00000dd6 movs r2, 0 | r2 = 0;
0x00000dd8 str.w fp, [sp, 0x54] | __asm ("str.w fp, [arg_54h]");
0x00000ddc str r2, [r3] | *(r3) = r2;
0x00000dde mov r3, fp | r3 = fp;
0x00000de0 cmp r3, 0 |
| if (r3 == 0) {
0x00000de2 beq.w 0x12f2 | goto label_39;
| }
0x00000de6 adds r3, r5, 3 | r3 = r5 + 3;
0x00000de8 mvn r2, 0xb | r2 = ~0xb;
0x00000dec ands.w r3, r3, r5, asr 32 | r3 &= (r5 >> 32);
0x00000df0 it lo |
| if (r3 >= r3) {
0x00000df2 movlo r3, r5 | r3 = r5;
| }
0x00000df4 str.w sl, [sp, 0x7c] | __asm ("str.w sl, [arg_7ch]");
0x00000df8 asrs r1, r3, 2 | r1 = r3 >> 2;
0x00000dfa asrs r3, r3, 0x1f | r3 >>= 0x1f;
0x00000dfc str.w sb, [sp, 0x34] | __asm ("str.w sb, [arg_34h]");
0x00000e00 mul r5, r1, r1 | r5 = r1 * r1;
0x00000e04 mov r0, r1 | r0 = r1;
0x00000e06 str r1, [sp, 0x28] | *(arg_28h) = r1;
0x00000e08 mov.w fp, 0 |
0x00000e0c ldr.w sb, [sp, 0x44] | sb = *(arg_44h);
0x00000e10 add.w r8, sp, 0x8c | r8 += arg_8ch;
0x00000e14 ldr.w sl, [sp, 0x74] | sl = *(arg_74h);
0x00000e16 adr r0, 0x1d0 | r0 = 0x1d0;
0x00000e18 mov r6, fp | r6 = fp;
0x00000e1a subs r2, r2, r5 | r2 -= r5;
0x00000e1c mul r3, r5, r3 | r3 = r5 * r3;
0x00000e20 str r2, [sp, 0x64] | *(arg_64h) = r2;
0x00000e22 smull r1, r2, r0, r0 | r1:r2 = r0 * r0;
0x00000e26 str.w fp, [sp, 0x4c] | __asm ("str.w fp, [arg_4ch]");
0x00000e2a str r5, [sp, 0x60] | *(arg_60h) = r5;
0x00000e2c str.w fp, [sp, 0x50] | __asm ("str.w fp, [arg_50h]");
0x00000e30 strd fp, fp, [sp, 0x1c] | __asm ("strd fp, fp, [arg_0hx1c]");
0x00000e34 mla r3, r0, r2, r3 | __asm ("mla r3, r0, r2, r3");
0x00000e38 umull r1, r2, r5, r0 | r1:r2 = r5 * r0;
0x00000e3c mov r5, fp | r5 = fp;
0x00000e3e mov fp, r8 |
0x00000e40 add r3, r2 | r3 += r2;
0x00000e42 str r1, [sp, 0x68] | *(arg_68h) = r1;
0x00000e44 str r3, [sp, 0x6c] | *(arg_6ch) = r3;
| do {
0x00000e46 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00000e48 mov r2, fp | r2 = fp;
0x00000e4a movs r1, 1 | r1 = 1;
0x00000e4c str.w r5, [fp] | __asm ("str.w r5, [fp]");
0x00000e50 blx 0x864 | r0 = ioctl (r0, r1);
0x00000e54 cmp r0, 0 |
| if (r0 < 0) {
0x00000e56 blt.w 0x106e | goto label_40;
| }
0x00000e5a ldr.w r7, [fp] | r7 = *(fp);
0x00000e5e cmp r7, 0 |
| if (r7 == 0) {
0x00000e60 beq.w 0x107a | goto label_41;
| }
0x00000e64 ldr.w r1, [sb] | r1 = *(sb);
0x00000e68 cmp r1, 0 |
| if (r1 == 0) {
0x00000e6a beq.w 0x1084 | goto label_42;
| }
0x00000e6e adds r6, 1 | r6++;
0x00000e70 cmp r6, r7 |
| if (r6 == r7) {
0x00000e72 beq.w 0x1134 | goto label_43;
| }
| label_5:
0x00000e76 ldrd r3, r2, [sl, 0x10] | __asm ("ldrd r3, r2, [sl, 0x10]");
0x00000e7a orrs r3, r2 | r3 |= r2;
| if (r3 != r2) {
0x00000e7c beq 0xeb0 |
0x00000e7e ldr r2, [r4] | r2 = *(r4);
0x00000e80 ldr.w r3, [sl, 8] | r3 = *((sl + 8));
0x00000e84 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00000e86 adds r3, r3, r2 | r3 += r2;
0x00000e88 ldr.w r2, [sl, 0xc] | r2 = *((sl + 0xc));
0x00000e8c adc.w r2, r2, r0 | __asm ("adc.w r2, r2, r0");
0x00000e90 ldr.w r0, [sl] | r0 = *(sl);
0x00000e94 subs r0, r3, r0 | r0 = r3 - r0;
0x00000e96 ldr.w r3, [sl, 4] | r3 = *((sl + 4));
0x00000e9a str r0, [sp, 0x4c] | *(arg_4ch) = r0;
0x00000e9c sbc.w r6, r2, r3 | __asm ("sbc.w r6, r2, r3");
0x00000ea0 ldrd r2, r3, [r4, 8] | __asm ("ldrd r2, r3, [r4, 8]");
0x00000ea4 str r6, [sp, 0x50] | *(arg_50h) = r6;
0x00000ea6 cmp r6, r3 |
0x00000ea8 it eq |
| if (r6 == r3) {
0x00000eaa cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| }
| if (r6 == r3) {
0x00000eac beq.w 0x138a | goto label_44;
| }
| }
0x00000eb0 ldr.w r3, [pc, 0x684] | r3 = *(0x00001538);
0x00000eb4 add r3, pc | r3 += pc;
0x00000eb6 ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x00000eb8 cmp r3, 0 |
| if (r3 != 0) {
0x00000eba bne.w 0x10a8 | goto label_21;
| }
| label_1:
0x00000ebe ldr.w r3, [pc, 0x67c] | r3 = *(0x0000153c);
0x00000ec2 add r3, pc | r3 += pc;
0x00000ec4 ldr r2, [r3, 0x14] | r2 = *((r3 + 0x14));
0x00000ec6 ldrd r3, r1, [sp, 0x4c] | __asm ("ldrd r3, r1, [arg_4ch]");
0x00000eca orrs r3, r1 | r3 |= r1;
0x00000ecc cmp r2, 0 |
0x00000ece it ne |
| if (r2 != 0) {
0x00000ed0 cmpne r3, 0 | __asm ("cmpne r3, 0");
| }
| if (r2 != 0) {
0x00000ed2 bne.w 0x1162 | goto label_45;
| }
| label_7:
0x00000ed6 ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x00000ed8 mov ip, r4 |
0x00000eda mov r6, sl | r6 = sl;
0x00000edc mov.w r8, 0 | r8 = 0;
0x00000ee0 str.w r8, [sp, 0x2c] | __asm ("str.w r8, [arg_2ch]");
0x00000ee4 ldr.w lr, [r3, 0x38] |
0x00000ee8 ldr.w r3, [sb] | r3 = *(sb);
0x00000eec adds r3, 1 | r3++;
0x00000eee str.w r3, [sb] | __asm ("str.w r3, [sb]");
0x00000ef2 mul r3, r7, lr | r3 = r7 * lr;
0x00000ef6 str r3, [sp, 0x40] | *(arg_40h) = r3;
0x00000ef8 ldm.w ip!, {r0, r1, r2, r3} | r0 = *(ip!);
| r1 = *((ip! + 4));
| r2 = *((ip! + 8));
| r3 = *((ip! + 12));
0x00000efc stm r6!, {r0, r1, r2, r3} | *(r6!) = r0;
| *((r6! + 4)) = r1;
| *((r6! + 8)) = r2;
| *((r6! + 12)) = r3;
0x00000efe ldr r3, [sp, 0x40] | r3 = *(arg_40h);
0x00000f00 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x00000f02 ldm.w ip!, {r0, r1, r2, r3} | r0 = *(ip!);
| r1 = *((ip! + 4));
| r2 = *((ip! + 8));
| r3 = *((ip! + 12));
0x00000f06 stm r6!, {r0, r1, r2, r3} | *(r6!) = r0;
| *((r6! + 4)) = r1;
| *((r6! + 8)) = r2;
| *((r6! + 12)) = r3;
0x00000f08 ldm.w ip!, {r0, r1, r2, r3} | r0 = *(ip!);
| r1 = *((ip! + 4));
| r2 = *((ip! + 8));
| r3 = *((ip! + 12));
0x00000f0c stm r6!, {r0, r1, r2, r3} | *(r6!) = r0;
| *((r6! + 4)) = r1;
| *((r6! + 8)) = r2;
| *((r6! + 12)) = r3;
0x00000f0e ldm.w ip, {r0, r1} | r0 = *(ip);
| r1 = *((ip + 4));
0x00000f12 ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00000f14 stm.w r6, {r0, r1} | *(r6) = r0;
| *((r6 + 4)) = r1;
0x00000f16 movs r3, r0 | r3 = r0;
0x00000f18 str.w r8, [r4, 0xc] | __asm ("str.w r8, [r4, 0xc]");
0x00000f1c str r3, [r4] | *(r4) = r3;
0x00000f1e ldr r3, [sp, 0x20] | r3 = *(arg_20h);
0x00000f20 str r3, [r4, 4] | *((r4 + 4)) = r3;
| label_6:
0x00000f22 adds.w r3, lr, r8 | r3 = lr + r8;
0x00000f26 asr.w r2, lr, 0x1f | r2 = lr >> 0x1f;
0x00000f2a str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00000f2c mov r6, r7 | r6 = r7;
0x00000f2e ldr r3, [sp, 0x2c] | r3 = *(arg_2ch);
0x00000f30 adc.w r3, r3, r2 | __asm ("adc.w r3, r3, r2");
0x00000f34 str r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
| label_0:
0x00000f36 ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00000f38 add.w r8, r5, 1 | r8 = r5 + 1;
0x00000f3c adds.w lr, r3, lr | lr = r3 + lr;
0x00000f40 ldr r3, [sp, 0x20] | r3 = *(arg_20h);
0x00000f42 adc.w r3, r2, r3 | __asm ("adc.w r3, r2, r3");
0x00000f46 ldr r2, [sp, 0x54] | r2 = *(arg_54h);
0x00000f48 strd lr, r3, [sp, 0x1c] | __asm ("strd lr, r3, [sp, 0x1c]");
0x00000f4c ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x00000f4e cmp r2, r8 |
0x00000f50 and r7, r3, 1 | r7 = r3 & 1;
0x00000f54 mov r3, r7 | r3 = r7;
| if (r2 == r8) {
0x00000f56 beq.w 0x1290 | goto label_46;
| }
0x00000f5a cmp r6, 0 |
0x00000f5c ite eq |
| if (r6 != 0) {
0x00000f5e moveq r3, 0 | r3 = 0;
| }
| if (r6 == 0) {
0x00000f60 andne r3, r3, 1 | r3 &= 1;
| }
| if (r3 != 0) {
0x00000f64 cbz r3, 0xf9e |
0x00000f66 ldr r1, [sp, 0x28] | r1 = *(arg_28h);
0x00000f68 sub.w r0, r5, 0xb | r0 = r5 - 0xb;
0x00000f6c bl 0x21dc | fcn_000021dc (r0);
| if (r1 == 0) {
0x00000f70 cbnz r1, 0xf74 |
0x00000f72 adds r6, 1 | r6++;
| }
0x00000f74 ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00000f76 ldr r1, [sp, 0x60] | r1 = *(arg_60h);
0x00000f78 sub.w r0, r8, r3 | r0 = r8 - r3;
0x00000f7a movs r3, r0 | r3 = r0;
0x00000f7c subs r0, 0xc | r0 -= 0xc;
0x00000f7e bl 0x21dc | fcn_000021dc (r0);
| if (r1 == 0) {
0x00000f82 cbnz r1, 0xf86 |
0x00000f84 adds r6, 1 | r6++;
| }
0x00000f86 ldr r3, [sp, 0x64] | r3 = *(arg_64h);
0x00000f88 movs r1, 0 | r1 = 0;
0x00000f8a ldr r2, [sp, 0x28] | r2 = *(arg_28h);
0x00000f8c subs r0, r3, r2 | r0 = r3 - r2;
0x00000f8e ldrd r2, r3, [sp, 0x68] | __asm ("ldrd r2, r3, [arg_68h]");
0x00000f92 add r0, r8 | r0 += r8;
0x00000f94 bl 0x2548 | fcn_00002548 (r0, r1, r2, r3, r4, r5);
0x00000f98 orrs r2, r3 | r2 |= r3;
0x00000f9a it eq |
| if (r2 == r3) {
0x00000f9c addeq r6, 1 | r6++;
| goto label_47;
| }
| }
| label_47:
0x00000f9e mov r5, r8 | r5 = r8;
0x00000fa0 b 0xe46 |
| } while (1);
| label_40:
0x0000106e blx 0x8c4 | r0 = errno_location ();
0x00001072 ldr r3, [r0] | r3 = *(r0);
0x00001074 cmp r3, 0 |
| if (r3 > 0) {
0x00001076 bgt.w 0x1476 | goto label_48;
| }
| label_41:
0x0000107a ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x0000107c ldr r3, [r3, 0x38] | r3 = *((r3 + 0x38));
0x0000107e mov lr, r3 | lr = r3;
0x00001080 asrs r2, r3, 0x1f | r2 = r3 >> 0x1f;
0x00001082 b 0xf36 | goto label_0;
| label_42:
0x00001084 ldr.w r6, [pc, 0x4d4] | r6 = *(0x0000155c);
0x00001088 add r6, pc | r6 += pc;
0x0000108a ldr r3, [r6, 0x20] | r3 = *((r6 + 0x20));
0x0000108c cmp r3, 0 |
| if (r3 == 0) {
0x0000108e beq.w 0xebe | goto label_1;
| }
0x00001092 bl 0x17b8 | fcn_000017b8 ();
0x00001096 ldr r3, [r6, 0x20] | r3 = *((r6 + 0x20));
0x00001098 cmp r3, 0 |
| if (r3 == 0) {
0x0000109a beq.w 0xebe | goto label_1;
| }
0x0000109e ldr.w r1, [sb] | r1 = *(sb);
0x000010a2 cmp r1, 0 |
| if (r1 == 0) {
0x000010a4 beq.w 0xebe | goto label_1;
| }
| label_21:
0x000010a8 ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x000010aa subs r1, 1 | r1--;
0x000010ac mov r0, r4 | r0 = r4;
0x000010ae str r3, [sp, 4] | var_4h = r3;
0x000010b0 ldr r3, [sp, 0x7c] | r3 = *(arg_7ch);
0x000010b2 str r3, [sp] | *(sp) = r3;
0x000010b4 ldrd r2, r3, [sp, 0x4c] | __asm ("ldrd r2, r3, [arg_4ch]");
0x000010b8 bl 0x1a6c | fcn_00001a6c (r0, r1, r2, r3, r4, r5);
0x000010bc b 0xebe | goto label_1;
| label_25:
0x000010be blx 0x8c4 | errno_location ();
0x000010c2 ldr r3, [sp, 0x3c] | r3 = *(arg_3ch);
0x000010c4 ldr r4, [r0] | r4 = *(r0);
0x000010c6 ldr.w r0, [pc, 0x498] |
0x000010ca cmp r4, 0 |
0x000010cc ite le |
| if (r4 > 0) {
0x000010ce movle r3, 0 | r3 = 0;
| }
| if (r4 <= 0) {
0x000010d0 andgt r3, r3, 1 | r3 &= 1;
| }
0x000010d4 rsbs r4, r4, 0 | r4 -= ;
0x000010d6 add r0, pc | r0 = 0x263c;
0x000010d8 str r3, [sp, 0x3c] | *(arg_3ch) = r3;
0x000010da blx 0x840 | perror (r0);
| label_11:
0x000010de ldr r3, [sp, 0x48] | r3 = *(arg_48h);
0x000010e0 ldr r2, [sp, 0x3c] | r2 = *(arg_3ch);
0x000010e2 cmp r2, 0 |
0x000010e4 it ne |
| if (r2 == 0) {
0x000010e6 movne r3, r4 | r3 = r4;
| }
0x000010e8 str r3, [sp, 0x48] | *(arg_48h) = r3;
| label_13:
0x000010ea ldr r3, [sp, 0x58] | r3 = *(arg_58h);
0x000010ec ldr r2, [r3, 4]! | r2 = *((r3 += 4));
0x000010f0 str r2, [sp, 0x30] | *(arg_30h) = r2;
0x000010f2 str r3, [sp, 0x58] | *(arg_58h) = r3;
0x000010f4 cmp r2, 0 |
| if (r2 != 0) {
0x000010f6 bne.w 0xa9e | goto label_2;
| }
0x000010fa ldr r3, [sp, 0x48] | r3 = *(arg_48h);
0x000010fc ldr.w r2, [pc, 0x464] | r2 = *(0x00001564);
0x00001100 rsbs r0, r3, 0 | r0 = r3 - ;
0x00001102 ldr r3, [pc, 0x3d4] | r3 = *(0x14da);
0x00001104 add r2, pc | r2 += pc;
0x00001106 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x00001108 ldr r2, [r3] | r2 = *(0x14da);
0x0000110a ldr r3, [sp, 0x26c] | r3 = *(arg_26ch);
0x0000110c eors r2, r3 | r2 ^= r3;
0x0000110e mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x00001112 bne.w 0x1664 | goto label_49;
| }
0x00001116 add.w sp, sp, 0x274 |
0x0000111a pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_34:
0x0000111e movs r2, 0xa | r2 = 0xa;
0x00001120 b 0xcf6 | goto label_3;
| label_32:
0x00001122 lsrs r0, r5, 1 | r0 = r5 >> 1;
| if (r0 == r5) {
0x00001124 beq.w 0x1600 | goto label_50;
| }
0x00001128 mov sl, r2 | sl = r2;
| do {
0x0000112a lsrs r0, r0, 1 | r0 >>= 1;
0x0000112c add.w sl, sl, 1 | sl++;
0x00001130 bne 0x112a |
| } while (r0 != r0);
0x00001132 b 0xc4c | goto label_4;
| label_43:
0x00001134 ldr r2, [r4, 0x14] | r2 = *((r4 + 0x14));
0x00001136 ldr.w r8, [r4, 0x10] | r8 = *((r4 + 0x10));
0x0000113a ldr r3, [r4] | r3 = *(r4);
0x0000113c mov r0, r2 | r0 = r2;
0x0000113e str r2, [sp, 0x2c] | *(arg_2ch) = r2;
0x00001140 ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x00001142 adds.w r3, r8, r3 | r3 = r8 + r3;
0x00001146 adc.w r2, r0, r2 | __asm ("adc.w r2, r0, r2");
0x0000114a ldrd r0, r6, [sp, 0x1c] | __asm ("ldrd r0, r6, [arg_1ch]");
0x0000114e cmp r2, r6 |
0x00001150 it eq |
| if (r2 == r6) {
0x00001152 cmpeq r3, r0 | __asm ("cmpeq r3, r0");
| }
0x00001154 itt eq |
| if (r2 != r6) {
0x00001156 ldreq r3, [sp, 0x34] | r3 = *(arg_34h);
| }
| if (r2 == r6) {
0x00001158 ldreq lr, [r3, 0x38] | goto label_51;
| }
| if (r2 != r6) {
| label_51:
0x0000115c bne.w 0xe76 | goto label_5;
| }
0x00001160 b 0xf22 | goto label_6;
| label_45:
0x00001162 ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x00001164 ldrd r0, r1, [r4] | __asm ("ldrd r0, r1, [r4]");
0x00001168 ldr r6, [r3, 0x38] | r6 = *((r3 + 0x38));
0x0000116a mov r2, r6 | r2 = r6;
0x0000116c asr.w r8, r6, 0x1f | r8 = r6 >> 0x1f;
0x00001170 mov r3, r8 | r3 = r8;
0x00001172 bl 0x2548 | fcn_00002548 (r0, r1, r2, r3, r4, r5);
0x00001176 mov r2, r6 | r2 = r6;
0x00001178 mov r3, r8 | r3 = r8;
0x0000117a str r0, [sp, 0x2c] | *(arg_2ch) = r0;
0x0000117c str r1, [sp, 0x40] | *(arg_40h) = r1;
0x0000117e ldrd r0, r1, [sp, 0x4c] | __asm ("ldrd r0, r1, [arg_4ch]");
0x00001182 bl 0x2548 | fcn_00002548 (r0, r1, r2, r3, r4, r5);
0x00001186 mov r2, r6 | r2 = r6;
0x00001188 mov r3, r8 | r3 = r8;
0x0000118a strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [sp, 8]");
0x0000118e ldrd r0, r1, [r4, 8] | __asm ("ldrd r0, r1, [r4, 8]");
0x00001192 bl 0x2548 | fcn_00002548 (r0, r1, r2, r3, r4, r5);
0x00001196 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x0000119a movs r0, 1 | r0 = 1;
0x0000119c ldr r1, [pc, 0x3c8] |
0x0000119e ldr r2, [sp, 0x2c] | r2 = *(arg_2ch);
0x000011a0 ldr r3, [sp, 0x40] | r3 = *(arg_40h);
0x000011a2 add r1, pc | r1 = 0x270e;
0x000011a4 blx 0x8f4 | printf_chk ();
0x000011a8 b 0xed6 | goto label_7;
| label_30:
0x000011aa add.w r8, sp, 0x8c | r8 += arg_8ch;
0x000011ae ldr r1, [sp, 0x80] | r1 = *(request);
0x000011b0 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x000011b2 mov r2, r8 | r2 = r8;
0x000011b4 blx 0x864 | ioctl (r0, r1);
0x000011b8 str r0, [sp, 0x38] | *(arg_38h) = r0;
0x000011ba cmp r0, 0 |
| if (r0 != 0) {
0x000011bc bne.w 0x139a | goto label_52;
| }
0x000011c0 ldr r3, [sp, 0x8c] | r3 = *(arg_8ch);
0x000011c2 ldr r6, [r4, 0x38] | r6 = *((r4 + 0x38));
0x000011c4 ldr r5, [r4, 0x70] | r5 = *((r4 + 0x70));
0x000011c6 lsls r0, r3, 0xc | r0 = r3 << 0xc;
| if (r0 < r3) {
0x000011c8 bmi.w 0xb4e | goto label_8;
| }
| if (r6 != 0) {
0x000011cc cbz r6, 0x11d8 |
0x000011ce subs r0, r6, 1 | r0 = r6 - 1;
0x000011d0 lsls r1, r5, 3 | r1 = r5 << 3;
0x000011d2 bl 0x1f80 | r0 = fcn_00001f80 (r0, r1, r2);
0x000011d6 adds r6, r0, 1 | r6 = r0 + 1;
| }
0x000011d8 ldr r3, [pc, 0x390] |
0x000011da add r3, pc | r3 = 0x274a;
0x000011dc ldr r2, [r3, 0x14] | r2 = *(0x275e);
| if (r2 != 0) {
0x000011de cbz r2, 0x11fc |
0x000011e0 ldrd r0, r2, [r3, 0x28] | __asm ("ldrd r0, r2, [r3, 0x28]");
0x000011e4 ldrd r1, r3, [sb] | __asm ("ldrd r1, r3, [sb]");
0x000011e8 cmp r2, r3 |
0x000011ea it eq |
| if (r2 == r3) {
0x000011ec cmpeq r0, r1 | __asm ("cmpeq r0, r1");
| }
| if (r2 == r3) {
0x000011ee beq 0x11fc | goto label_53;
| }
0x000011f0 ldr r1, [pc, 0x37c] |
0x000011f2 mov r2, r6 | r2 = r6;
0x000011f4 movs r0, 1 | r0 = 1;
0x000011f6 add r1, pc | r1 = 0x276a;
0x000011f8 blx 0x8f4 | printf_chk ();
| }
| label_53:
0x000011fc ldr r3, [pc, 0x374] | r3 = *(0x1574);
0x000011fe movs r2, 1 | r2 = 1;
| label_24:
0x00001200 mov r1, r6 | r1 = r6;
0x00001202 str r2, [sp, 0x38] | *(arg_38h) = r2;
0x00001204 add r3, pc | r3 += pc;
0x00001206 ldr r5, [r3, 0x70] | r5 = *((r3 + 0x70));
0x00001208 ldr r0, [r3, 0x44] | r0 = *((r3 + 0x44));
0x0000120a lsls r4, r5, 3 | r4 = r5 << 3;
0x0000120c lsrs r0, r0, 3 | r0 >>= 3;
0x0000120e subs r4, 3 | r4 -= 3;
0x00001210 bl 0x1f80 | r0 = fcn_00001f80 (r0, r1, r2);
0x00001214 subs r3, r4, r0 | r3 = r4 - r0;
0x00001216 str r3, [sp, 0x78] | *(arg_78h) = r3;
0x00001218 b 0xb52 | goto label_9;
| label_37:
0x0000121a ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x0000121c mov r3, sb | r3 = sb;
0x0000121e ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00001220 mov r1, sl | r1 = sl;
0x00001222 bl 0x1cb0 | r0 = fcn_00001cb0 (r0, r1, r2, r3, r4);
0x00001226 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 < r0) {
0x00001228 blt.w 0x140a | goto label_54;
| }
0x0000122c ldr r4, [r5, 0x18] | r4 = *((r5 + 0x18));
0x0000122e cmp r4, 0 |
| if (r4 != 0) {
0x00001230 bne.w 0xd96 | goto label_10;
| }
0x00001234 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x00001236 and r7, r3, 1 | r7 = r3 & 1;
0x0000123a b 0x1304 | goto label_55;
| label_27:
0x0000125e blx 0x8c4 | errno_location ();
0x00001262 ldr r3, [sp, 0x3c] | r3 = *(arg_3ch);
0x00001264 ldr r4, [r0] | r4 = *(r0);
0x00001266 ldr r0, [pc, 0x31c] |
0x00001268 cmp r4, 0 |
0x0000126a ite le |
| if (r4 > 0) {
0x0000126c movle r3, 0 | r3 = 0;
| }
| if (r4 <= 0) {
0x0000126e andgt r3, r3, 1 | r3 &= 1;
| }
0x00001272 rsbs r4, r4, 0 | r4 -= ;
0x00001274 add r0, pc | r0 = 0x27fe;
0x00001276 str r3, [sp, 0x3c] | *(arg_3ch) = r3;
0x00001278 blx 0x840 | perror (r0);
| label_14:
0x0000127c ldr r0, [sp, 0x24] | r0 = *(fildes);
0x0000127e blx 0x948 | close (r0);
0x00001282 b 0x10de | goto label_11;
| label_29:
0x00001284 ldr r1, [pc, 0x300] |
0x00001286 movs r0, 1 | r0 = 1;
0x00001288 add r1, pc | r1 = "unwritten,";
0x0000128a blx 0x8f4 | printf_chk ();
0x0000128e b 0xb2e | goto label_12;
| label_46:
0x00001290 ldr r3, [pc, 0x2f8] |
0x00001292 ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x00001294 ldr.w sl, [sp, 0x7c] | sl = *(arg_7ch);
0x00001298 add r3, pc |
0x0000129a ldr.w sb, [sp, 0x34] | sb = *(arg_34h);
0x0000129e ldr r3, [r3, 0x20] | r3 = "%*llu: ";
0x000012a0 ldr r1, [r2] | r1 = *(r2);
| if (r3 != 0) {
0x000012a2 cbz r3, 0x12f8 |
| if (r1 == 0) {
0x000012a4 cbz r1, 0x12f8 | goto label_56;
| }
0x000012a6 ldr r5, [sp, 0x74] | r5 = *(arg_74h);
0x000012a8 ldrd r3, r2, [r5, 0x10] | __asm ("ldrd r3, r2, [r5, 0x10]");
0x000012ac orrs r3, r2 | r3 |= r2;
| if (r3 != r2) {
0x000012ae beq 0x12de |
0x000012b0 ldr r3, [r5, 8] | r3 = *((r5 + 8));
0x000012b2 ldr r2, [r4] | r2 = *(r4);
0x000012b4 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000012b6 adds r3, r3, r2 | r3 += r2;
0x000012b8 ldr r2, [r5, 0xc] | r2 = *((r5 + 0xc));
0x000012ba adc.w r2, r2, r0 | __asm ("adc.w r2, r2, r0");
0x000012be ldr r0, [r5] | r0 = *(r5);
0x000012c0 subs r0, r3, r0 | r0 = r3 - r0;
0x000012c2 ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x000012c4 str r0, [sp, 0x4c] | *(arg_4ch) = r0;
0x000012c6 sbc.w r5, r2, r3 | __asm ("sbc.w r5, r2, r3");
0x000012ca ldrd r2, r3, [r4, 8] | __asm ("ldrd r2, r3, [r4, 8]");
0x000012ce str r5, [sp, 0x50] | *(arg_50h) = r5;
0x000012d0 cmp r5, r3 |
0x000012d2 it eq |
| if (r5 == r3) {
0x000012d4 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| }
0x000012d6 itt eq |
| if (r5 != r3) {
0x000012d8 moveq r3, 0 | r3 = 0;
| }
| if (r5 != r3) {
0x000012da strdeq r3, r3, [sp, 0x4c] | __asm ("strdeq r3, r3, [sp, 0x4c]");
| goto label_57;
| }
| }
| label_57:
0x000012de mov r0, r4 | r0 = r4;
0x000012e0 ldrd r2, r3, [sp, 0x4c] | __asm ("ldrd r2, r3, [arg_4ch]");
0x000012e4 subs r1, 1 | r1--;
0x000012e6 strd sl, sb, [sp] | __asm ("strd sl, sb, [sp]");
0x000012ea movs r4, 0 | r4 = 0;
0x000012ec bl 0x1a6c | fcn_00001a6c (r0, r1, r2, r3, r4, r5);
0x000012f0 b 0x12fa | goto label_17;
| label_39:
0x000012f2 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x000012f4 and r7, r3, 1 | r7 = r3 & 1;
| }
| label_56:
0x000012f8 movs r4, 0 | r4 = 0;
| label_17:
0x000012fa mov r0, r4 | r0 = r4;
0x000012fc ldr r1, [sp, 0x78] | r1 = *(arg_78h);
0x000012fe bl 0x21f8 | r0 = fcn_000021f8 (r0, r1);
0x00001302 adds r4, r0, 1 | r4 = r0 + 1;
| label_55:
0x00001304 ldr r3, [sp, 0x44] | r3 = *(arg_44h);
0x00001306 ldr r2, [sp, 0x30] | r2 = *(arg_30h);
0x00001308 ldr r3, [r3] | r3 = *(r3);
0x0000130a cmp r3, 1 |
| if (r3 == 1) {
0x0000130c beq 0x135e | goto label_58;
| }
0x0000130e ldr r1, [pc, 0x280] |
0x00001310 movs r0, 1 | r0 = 1;
0x00001312 add r1, pc | r1 = 0x28a8;
0x00001314 blx 0x8f4 | printf_chk ();
0x00001316 invalid |
| do {
0x00001318 cmp r4, 0 |
0x0000131a ite eq |
| if (r4 != 0) {
0x0000131c moveq r7, 0 | r7 = 0;
| }
| if (r4 == 0) {
0x0000131e andne r7, r7, 1 | r7 &= 1;
| }
| if (r7 != 0) {
0x00001322 cbz r7, 0x1348 |
0x00001324 ldr r3, [sp, 0x44] | r3 = *(arg_44h);
0x00001326 ldr r3, [r3] | r3 = *(r3);
0x00001328 cmp r4, r3 |
| if (r4 >= r3) {
0x0000132a bge 0x1348 | goto label_59;
| }
0x0000132c cmp r4, 1 |
| if (r4 <= 1) {
0x0000132e ble 0x13a8 | goto label_60;
| }
0x00001330 ldr r3, [pc, 0x260] |
0x00001332 add r3, pc | r3 = 0x28ca;
| label_15:
0x00001334 ldr r1, [pc, 0x260] |
0x00001336 mov r2, r4 | r2 = r4;
0x00001338 movs r0, 1 | r0 = 1;
0x0000133a add r1, pc | r1 = 0x28d6;
0x0000133c blx 0x8f4 | printf_chk ();
0x00001340 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00001342 blx 0x948 | close (r0);
0x00001346 b 0x10ea | goto label_13;
| }
| label_59:
0x00001348 ldr r3, [pc, 0x1dc] | r3 = *(0x1528);
0x0000134a movs r0, 0xa | r0 = 0xa;
0x0000134c ldr r2, [sp, 0x5c] | r2 = *(arg_5ch);
0x0000134e ldr r5, [r2, r3] | r5 = *((r2 + r3));
0x00001350 ldr r1, [r5] | r1 = *(r5);
0x00001352 blx 0x924 | fputc (r0, r1);
0x00001356 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00001358 blx 0x948 | close (r0);
0x0000135c b 0x10ea | goto label_13;
| label_58:
0x0000135e ldr r1, [pc, 0x23c] |
0x00001360 mov r0, r3 | r0 = r3;
0x00001362 add r1, pc | r1 = 0x2904;
0x00001364 blx 0x8f4 | printf_chk ();
0x00001368 b 0x1318 |
| } while (1);
| label_26:
0x0000136a blx 0x8c4 | errno_location ();
0x0000136e ldr r3, [sp, 0x3c] | r3 = *(arg_3ch);
0x00001370 ldr r4, [r0] | r4 = *(r0);
0x00001372 ldr r0, [pc, 0x22c] |
0x00001374 cmp r4, 0 |
0x00001376 ite le |
| if (r4 > 0) {
0x00001378 movle r3, 0 | r3 = 0;
| }
| if (r4 <= 0) {
0x0000137a andgt r3, r3, 1 | r3 &= 1;
| }
0x0000137e rsbs r4, r4, 0 | r4 -= ;
0x00001380 add r0, pc | r0 = 0x2926;
0x00001382 str r3, [sp, 0x3c] | *(arg_3ch) = r3;
0x00001384 blx 0x840 | perror (r0);
0x00001388 b 0x127c | goto label_14;
| label_44:
0x0000138a ldr r3, [pc, 0x218] |
0x0000138c add r3, pc |
0x0000138e ldr r3, [r3, 0x20] | r3 = *(0x2956);
0x00001390 cmp r3, 0 |
| if (r3 != 0) {
0x00001392 bne 0x146e | goto label_61;
| }
0x00001394 strd r3, r3, [sp, 0x4c] | __asm ("strd r3, r3, [sp, 0x4c]");
0x00001398 b 0xed6 | goto label_7;
| label_52:
0x0000139a movs r3, 0 | r3 = 0;
0x0000139c ldr r5, [r4, 0x70] | r5 = *((r4 + 0x70));
0x0000139e str r3, [sp, 0x38] | *(arg_38h) = r3;
0x000013a0 movs r3, 1 | r3 = 1;
0x000013a2 str r3, [sp, 0x78] | *(arg_78h) = r3;
0x000013a4 b.w 0xb52 | goto label_9;
| label_60:
0x000013a8 ldr r3, [pc, 0x1fc] |
0x000013aa add r3, pc | r3 = 0x2956;
0x000013ac b 0x1334 | goto label_15;
| label_38:
0x000013ae ldr r0, [sp, 0x24] | r0 = *(fildes);
0x000013b0 blx 0x810 | r0 = fsync ();
0x000013b4 cmp r0, 0 |
| if (r0 == 0) {
0x000013b6 beq.w 0xdd4 | goto label_16;
| }
0x000013ba blx 0x8c4 | r0 = errno_location ();
0x000013be ldr r3, [r0] | r3 = *(r0);
0x000013c0 cmp r3, 0 |
0x000013c2 rsb.w r4, r3, 0 | r4 = r3 - ;
| if (r3 > 0) {
0x000013c6 bgt 0x1478 | goto label_62;
| }
0x000013c8 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x000013ca and r7, r3, 1 | r7 = r3 & 1;
0x000013ce b 0x12fa | goto label_17;
| label_35:
0x000013d0 ldr r1, [pc, 0x1d8] |
0x000013d2 add r1, pc | r1 = 0x2982;
0x000013d4 b 0xd46 | goto label_18;
| label_36:
0x000013d6 add.w r8, sp, 0x8c | r8 += arg_8ch;
0x000013da ldr r1, [sp, 0x84] | r1 = *(arg_84h);
0x000013dc ldr r0, [sp, 0x24] | r0 = *(fildes);
0x000013de mov r2, r8 | r2 = r8;
0x000013e0 blx 0x864 | r0 = ioctl (r0, r1);
0x000013e4 cmp r0, 0 |
| if (r0 != 0) {
0x000013e6 bne.w 0xd78 | goto label_19;
| }
0x000013ea ldr r3, [pc, 0x13c] | r3 = *(0x152a);
0x000013ec ldr r1, [sp, 0x5c] | r1 = *(arg_5ch);
0x000013ee ldr.w r2, [r8] | r2 = *(r8);
0x000013f2 ldr r5, [r1, r3] | r5 = *((r1 + r3));
0x000013f4 lsls r2, r2, 0x1f | r2 <<= 0x1f;
0x000013f6 ldr r3, [r5] | r3 = *(r5);
| if (r2 >= r2) {
0x000013f8 bpl.w 0xd80 | goto label_20;
| }
0x000013fc ldr r0, [pc, 0x1b0] |
0x000013fe mov r1, r4 | r1 = r4;
0x00001400 movs r2, 0xe | r2 = 0xe;
0x00001402 add r0, pc | r0 = 0x29b6;
0x00001404 blx 0x84c | fwrite (r0, r1, r2, r3);
0x00001408 b 0xd80 | goto label_20;
| label_54:
0x0000140a ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x0000140c cmp r3, 0 |
| if (r3 != 0) {
0x0000140e bne.w 0x1626 | goto label_63;
| }
0x00001412 ldrd r3, r2, [r5, 4] | __asm ("ldrd r3, r2, [r5, 4]");
0x00001416 orrs r3, r2 | r3 |= r2;
| if (r3 == r2) {
0x00001418 beq.w 0xd96 | goto label_10;
| }
0x0000141c cmn.w r4, 0x35 |
| if (r4 == 0x35) {
0x00001420 beq.w 0x127c | goto label_14;
| }
0x00001424 ldr r3, [pc, 0x150] | r3 = *(0x1578);
0x00001426 ldr r2, [sp, 0x5c] | r2 = *(arg_5ch);
0x00001428 ldr r5, [pc, 0x188] |
0x0000142a ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x0000142c add r5, pc | r5 = 0x29e4;
0x0000142e ldr r6, [r3] | r6 = *(0x1578);
| label_22:
0x00001430 rsbs r0, r4, 0 | r0 = r4 - ;
0x00001432 blx 0x87c | strerror (r0);
0x00001436 ldr r2, [pc, 0x180] |
0x00001438 movs r1, 1 | r1 = 1;
0x0000143a strd r5, r0, [sp] | __asm ("strd r5, r0, [sp]");
0x0000143e mov r0, r6 | r0 = r6;
0x00001440 ldr r3, [sp, 0x30] | r3 = *(arg_30h);
0x00001442 add r2, pc | r2 = 0x2a00;
0x00001444 blx 0x90c | fprintf_chk ()
0x00001448 b 0x127c | goto label_14;
| label_61:
0x0000146e movs r3, 0 | r3 = 0;
0x00001470 strd r3, r3, [sp, 0x4c] | __asm ("strd r3, r3, [sp, 0x4c]");
0x00001474 b 0x10a8 | goto label_21;
| label_48:
0x00001476 rsbs r4, r3, 0 | r4 = r3 - ;
| label_62:
0x00001478 ldr r3, [pc, 0xfc] | r3 = *(0x1578);
0x0000147a cmn.w r4, 0x16 |
0x0000147e ldr r2, [sp, 0x5c] | r2 = *(arg_5ch);
0x00001480 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x00001482 ldr r5, [r3] | r5 = *(0x1578);
| if (r4 != 0x16) {
0x00001484 beq.w 0x15d4 |
0x00001486 strh r6, [r4, 4] | *((r4 + 4)) = r6;
0x00001488 cmn.w r4, 0x19 |
| if (r4 == 0x19) {
0x0000148c beq.w 0x15d4 | goto label_64;
| }
0x00001490 adds r3, r4, 1 | r3 = r4 + 1;
| if (r3 != r4) {
0x00001492 bne.w 0x1606 | goto label_65;
| }
0x00001496 ldr r2, [pc, 0x134] |
0x00001498 mov r0, r5 | r0 = r5;
0x0000149a ldr r3, [sp, 0x30] | r3 = *(arg_30h);
0x0000149c movs r1, 1 | r1 = 1;
0x0000149e add r2, pc | r2 = 0x2a70;
0x000014a0 blx 0x90c | fprintf_chk ()
0x000014a4 b 0x127c | goto label_14;
| }
| label_64:
0x000015d4 ldr r3, [pc, 0x90] |
0x000015d6 add r3, pc |
0x000015d8 ldr r3, [r3, 0x18] | r3 = *(0x2c5a);
| if (r3 != 0) {
0x000015da cbnz r3, 0x163c | goto label_66;
| }
0x000015dc ldr r3, [pc, 0x8c] |
0x000015de add r3, pc | r3 = 0x2c4e;
| label_23:
0x000015e0 ldr r2, [sp, 0x3c] | r2 = *(arg_3ch);
0x000015e2 mov r0, r5 | r0 = r5;
0x000015e4 str r3, [sp] | *(sp) = r3;
0x000015e6 movs r1, 1 | r1 = 1;
0x000015e8 ldr r3, [sp, 0x30] | r3 = *(arg_30h);
0x000015ea and.w r2, r2, r4, lsr 31 | r2 &= (r4 >> 31);
0x000015ee str r2, [sp, 0x3c] | *(arg_3ch) = r2;
0x000015f0 ldr r2, [pc, 0x7c] |
0x000015f2 add r2, pc | r2 = 0x2c66;
0x000015f4 blx 0x90c | fprintf_chk ()
0x000015f8 b 0x127c | goto label_14;
| label_33:
0x000015fa mov sl, r2 | sl = r2;
0x000015fc b.w 0xc4c | goto label_4;
| label_50:
0x00001600 mov sl, r0 | sl = r0;
0x00001602 b.w 0xc4c | goto label_4;
| label_65:
0x00001606 ldr r3, [sp, 0x3c] | r3 = *(arg_3ch);
0x00001608 mov r0, r4 | r0 = r4;
0x0000160a and.w r3, r3, r4, lsr 31 | r3 &= (r4 >> 31);
0x0000160e str r3, [sp, 0x3c] | *(arg_3ch) = r3;
0x00001610 blx 0x87c | strerror (r0);
0x00001614 ldr r2, [pc, 0x5c] |
0x00001616 movs r1, 1 | r1 = 1;
0x00001618 str r0, [sp] | *(sp) = r0;
0x0000161a mov r0, r5 | r0 = r5;
0x0000161c ldr r3, [sp, 0x30] | r3 = *(arg_30h);
0x0000161e add r2, pc | r2 = 0x2c96;
0x00001620 blx 0x90c | fprintf_chk ()
0x00001624 b 0x127c | goto label_14;
| label_63:
0x00001626 cmn.w r4, 0x35 |
| if (r4 == 0x35) {
0x0000162a beq.w 0x127c | goto label_14;
| }
0x0000162e ldr r3, [pc, 0x48] | r3 = *(0x167a);
0x00001630 ldr r2, [sp, 0x5c] | r2 = *(arg_5ch);
0x00001632 ldr r5, [pc, 0x48] |
0x00001634 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x00001636 add r5, pc | r5 = 0x2cb8;
0x00001638 ldr r6, [r3] | r6 = *(0x167a);
0x0000163a b 0x1430 | goto label_22;
| label_66:
0x0000163c ldr r3, [pc, 0x40] |
0x0000163e add r3, pc | r3 = 0x2cc2;
0x00001640 b 0x15e0 | goto label_23;
| label_49:
0x00001664 blx 0x834 | r0 = stack_chk_fail ();
0x00001668 subs r6, r0, r1 | r6 = r0 - r1;
0x0000166a movs r1, r0 | r1 = r0;
0x0000166c asrs r2, r5, 0xb | r2 = r5 >> 0xb;
0x0000166e movs r0, r0 |
0x00001670 asrs r6, r5, 0x11 | r6 = r5 >> 0x11;
0x00001672 movs r0, r0 |
0x00001674 asrs r6, r0, 0x12 | r6 = r0 >> 0x12;
0x00001676 movs r0, r0 |
0x00001678 lsls r4, r1, 2 | r4 = r1 << 2;
0x0000167a movs r0, r0 |
0x0000167c asrs r2, r5, 9 | r2 = r5 >> 9;
0x0000167e movs r0, r0 |
0x00001680 asrs r6, r3, 0x10 | r6 = r3 >> 0x10;
0x00001682 movs r0, r0 |
0x00001684 asrs r0, r7, 9 | r0 = r7 >> 9;
0x00001686 movs r0, r0 |
0x000016bc adds r0, 0x14 | r0 += 0x14;
0x000016be b 0x1200 | goto label_24;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/filefrag @ 0x1784 */
| #include <stdint.h>
|
; (fcn) fcn.00001784 () | void fcn_00001784 (int16_t arg1) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| r0 = arg1;
0x00001784 ldr.w ip, [pc, 0x24] | ip = *(0x000017ac);
0x00001788 movs r1, 1 | r1 = 1;
0x0000178a push {r3, lr} |
0x0000178c mov r3, r0 | r3 = r0;
0x0000178e ldr.w lr, [pc, 0x20] | lr = *(0x17b2);
0x00001792 add ip, pc |
0x00001794 ldr r2, [pc, 0x1c] |
0x00001796 mov r0, ip | r0 = ip;
0x00001798 ldr.w r4, [ip, lr] | r4 = *((ip + lr));
0x0000179c add r2, pc | r2 = 0x2f54;
0x0000179e ldr r0, [r4] | r0 = *(r4);
0x000017a0 blx 0x90c | fprintf_chk ()
0x000017a4 movs r0, 1 | r0 = 1;
0x000017a6 blx 0x894 | exit (r0);
0x000017aa nop |
0x000017ac asrs r6, r0, 0x1f | r6 = r0 >> 0x1f;
0x000017ae movs r1, r0 | r1 = r0;
0x000017b0 lsls r4, r1, 2 | r4 = r1 << 2;
0x000017b2 movs r0, r0 |
0x000017b4 lsrs r4, r0, 0x1e | r4 = r0 >> 0x1e;
0x000017b6 movs r0, r0 |
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/filefrag @ 0x1cb0).
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.
[*] Function fprintf used 6 times filefrag