[*] Binary protection state of libc.so.6
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols
[*] Function strcpy tear down of libc.so.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/libc.so.6 @ 0x2c13c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0002c13c () | void fcn_0002c13c (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_8h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_20h;
| int32_t var_24h;
| int32_t var_28h;
| int32_t var_30h;
| int32_t var_34h;
| int32_t var_38h;
| int32_t var_40h;
| int32_t var_44h;
| int32_t var_48h;
| int32_t var_50h;
| int32_t var_5ch;
| int16_t var_0h_2;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x0002c13c push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0002c140 sub sp, 0x6c |
0x0002c142 add r7, sp, 8 | r7 += var_8h;
0x0002c144 mov sb, r0 | sb = r0;
0x0002c146 mov r0, r3 | r0 = r3;
0x0002c148 str r2, [r7, 0x18] | var_18h = r2;
0x0002c14a mov sl, r1 | sl = r1;
0x0002c14c ldr r2, [pc, 0x2fc] |
0x0002c14e str r3, [r7, 0x28] | var_28h = r3;
0x0002c150 movs r3, 0 | r3 = 0;
0x0002c152 str r3, [r7, 0x38] | var_38h = r3;
0x0002c154 add r2, pc | r2 = 0x585a4;
0x0002c156 str r2, [r7, 0x30] | var_30h = r2;
| if (r1 != 0) {
0x0002c158 cbz r1, 0x2c180 |
0x0002c15a ldr.w r2, [r7, 0x8c] | r2 = *((r7 + 0x8c));
0x0002c15e sub.w r3, r2, 6 | r3 = r2 - 6;
0x0002c162 clz r3, r3 | r3 &= r3;
0x0002c166 lsrs r3, r3, 5 | r3 >>= 5;
0x0002c168 cmp r2, 0xc |
0x0002c16a it hi |
| if (r2 <= 0xc) {
0x0002c16c orrhi r3, r3, 1 | r3 |= 1;
| }
| if (r3 == 0) {
0x0002c170 cbz r3, 0x2c18c | goto label_11;
| }
0x0002c172 ldr.w r2, [r7, 0x88] | r2 = *((r7 + 0x88));
0x0002c176 cmp r2, 1 |
0x0002c178 it ne |
| if (r2 != 1) {
0x0002c17a cmpne r0, 0 | __asm ("cmpne r0, 0");
| }
| if (r2 != 1) {
0x0002c17c bne.w 0x2c352 | goto label_12;
| }
| }
| label_0:
0x0002c180 mov r3, sl | r3 = sl;
| label_7:
0x0002c182 mov r0, r3 | r0 = r3;
0x0002c184 adds r7, 0x64 | r7 += 0x64;
0x0002c186 mov sp, r7 |
0x0002c188 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_11:
0x0002c18c ldr r3, [pc, 0x2b4] |
0x0002c18e mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x0002c192 ldr r0, [pc, 0x2bc] |
0x0002c194 add r3, pc |
0x0002c196 ldr r3, [r3] | r3 = *(0x585dc);
0x0002c198 str r2, [r7, 0x20] | var_20h = r2;
0x0002c19a ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x0002c19c add r0, pc | r0 = 0x585f2;
0x0002c19e str r3, [r7, 0x24] | var_24h = r3;
0x0002c1a0 bl 0x61168 | pthread_rwlock_rdlock ();
0x0002c1a4 ldr r0, [pc, 0x2ac] |
0x0002c1a6 add r0, pc | r0 = 0x585fe;
0x0002c1a8 adds r0, 0x1c | r0 += 0x1c;
0x0002c1aa bl 0x61168 | pthread_rwlock_rdlock ();
0x0002c1ae cmp.w sb, 0 |
| if (sb == 0) {
0x0002c1b2 beq.w 0x2c428 | goto label_13;
| }
| label_6:
0x0002c1b6 ldr r5, [pc, 0x2a0] |
0x0002c1b8 ldr.w r3, [r7, 0x8c] | r3 = *((r7 + 0x8c));
0x0002c1bc ldr.w r0, [r7, 0x8c] | r0 = *((r7 + 0x8c));
0x0002c1c0 add r5, pc | r5 = 0x5861e;
0x0002c1c2 str.w sl, [r7, 0x5c] | __asm ("str.w sl, [var_5ch]");
0x0002c1c6 add.w r4, r5, 0x3c | r4 = r5 + 0x3c;
0x0002c1ca str r3, [r7, 0x44] | var_44h = r3;
0x0002c1cc movs r3, 0 | r3 = 0;
0x0002c1ce str.w sb, [r7, 0x40] | __asm ("str.w sb, [var_40h]");
0x0002c1d2 str r3, [r7, 0x50] | var_50h = r3;
0x0002c1d4 bl 0x2b10c | fcn_0002b10c (r0);
0x0002c1d8 str r0, [r7, 0xc] | var_ch = r0;
0x0002c1da str r0, [r7, 0x48] | var_48h = r0;
0x0002c1dc mov r0, r4 | r0 = r4;
0x0002c1de bl 0x61168 | pthread_rwlock_rdlock ();
0x0002c1e2 ldr r2, [pc, 0x278] |
0x0002c1e4 mov r1, r5 | r1 = r5;
0x0002c1e6 add.w r0, r7, 0x40 | r0 += var_40h;
0x0002c1ea add r2, pc | r2 = 0x5864c;
0x0002c1ec bl 0xaaef8 | r0 = tfind ();
0x0002c1f0 mov r5, r0 | r5 = r0;
0x0002c1f2 str r0, [r7, 0x10] | var_10h = r0;
0x0002c1f4 mov r0, r4 | r0 = r4;
0x0002c1f6 bl 0x61a84 | pthread_rwlock_unlock ();
| if (r5 != 0) {
0x0002c1fa cbz r5, 0x2c20e |
0x0002c1fc ldr r3, [pc, 0x260] |
0x0002c1fe ldr r1, [r7, 0x30] | r1 = var_30h;
0x0002c200 ldr r4, [r5] | r4 = *(r5);
0x0002c202 ldr r3, [r1, r3] | r3 = *((r1 + r3));
0x0002c204 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
0x0002c206 ldr r3, [r3] | r3 = *(0x2c460);
0x0002c208 cmp r2, r3 |
| if (r2 == r3) {
0x0002c20a beq.w 0x2c498 | goto label_14;
| }
| }
0x0002c20e ldr r3, [pc, 0x254] | r3 = *(0x2c466);
0x0002c210 ldr r2, [r7, 0x30] | r2 = var_30h;
0x0002c212 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x0002c214 ldr r5, [r3] | r5 = *(0x2c466);
| if (r5 != 0) {
0x0002c216 cbnz r5, 0x2c226 | goto label_15;
| }
0x0002c218 b 0x2c570 | goto label_16;
| do {
| if (r5 < 0) {
0x0002c21a blt.w 0x2c432 | goto label_17;
| }
0x0002c21e ldr r5, [r5] | r5 = *(r5);
0x0002c220 cmp r5, 0 |
| if (r5 == 0) {
0x0002c222 beq.w 0x2c43c | goto label_18;
| }
| label_15:
0x0002c226 add.w r1, r5, 0xc | r1 = r5 + 0xc;
0x0002c22a mov r0, sb | r0 = sb;
0x0002c22c bl 0x6a170 | r0 = strcmp (r0, r1);
0x0002c230 subs r1, r0, 0 | r1 = r0 - 0;
0x0002c232 bne 0x2c21a |
| } while (r1 != r0);
0x0002c234 ldr.w fp, [r5, 4] | fp = *((r5 + 4));
0x0002c238 ldrb.w r3, [fp] | r3 = *(fp);
0x0002c23c cmp r3, 0x2f |
| if (r3 != 0x2f) {
0x0002c23e bne.w 0x2c35e | goto label_19;
| }
| label_2:
0x0002c242 ldr r3, [pc, 0x224] |
0x0002c244 ldr.w r2, [r7, 0x8c] | r2 = *((r7 + 0x8c));
0x0002c248 add r3, pc | r3 = 0x586b6;
0x0002c24a ldrb r6, [r3, r2] | r6 = *((r3 + r2));
0x0002c24c mov r0, r2 | r0 = r2;
0x0002c24e ldr r3, [pc, 0x21c] |
0x0002c250 add r3, pc | r3 = 0x586c2;
0x0002c252 add r6, r3 | r6 += r3;
0x0002c254 bl 0x2b10c | r0 = fcn_0002b10c (r0);
0x0002c258 ldrb r3, [r0] | r3 = *(r0);
0x0002c25a mov r4, r0 | r4 = r0;
0x0002c25c cmp r3, 0x43 |
| if (r3 != 0x43) {
0x0002c25e bne.w 0x2c38a | goto label_20;
| }
0x0002c262 ldrb r3, [r0, 1] | r3 = *((r0 + 1));
0x0002c264 cmp r3, 0 |
| if (r3 != 0) {
0x0002c266 bne.w 0x2c38a | goto label_20;
| }
| label_3:
0x0002c26a mov r0, sb | r0 = sb;
0x0002c26c bl 0x6a8c0 | r0 = strlen ();
0x0002c270 mov r8, r0 | r8 = r0;
0x0002c272 mov r0, r6 | r0 = r6;
0x0002c274 bl 0x6a8c0 | strlen ();
0x0002c278 mov r3, r8 | r3 = r8;
0x0002c27a ldr r2, [pc, 0x1f4] |
0x0002c27c adds r3, r0, r3 | r3 = r0 + r3;
0x0002c27e str.w r8, [r7, 0x14] | __asm ("str.w r8, [var_14h]");
0x0002c282 adds r3, 0xc | r3 += 0xc;
0x0002c284 mov r1, r6 | r1 = r6;
0x0002c286 bic r3, r3, 7 | r3 = BIT_MASK (r3, 7);
0x0002c28a add r2, pc | r2 = 0x58700;
0x0002c28c sub.w sp, sp, r3 |
0x0002c290 str r2, [r7, 0x34] | *((r7 + 0x34)) = r2;
0x0002c292 add.w r8, sp, 8 | r8 += var_8h;
0x0002c296 add.w r2, r7, 0x3c | r2 = r7 + 0x3c;
0x0002c29a mov r0, r8 | r0 = r8;
0x0002c29c str r2, [r7, 0x1c] | *((r7 + 0x1c)) = r2;
0x0002c29e bl 0x6a470 | stpcpy ();
0x0002c2a2 ldr r6, [r7, 0x14] | r6 = *((r7 + 0x14));
0x0002c2a4 movs r3, 0x2f | r3 = 0x2f;
0x0002c2a6 mov r1, sb | r1 = sb;
0x0002c2a8 strb r3, [r0], 1 | *(r0) = r3;
| r0++;
0x0002c2ac mov r2, r6 | r2 = r6;
0x0002c2ae blx 0x6fa80 | memcpy (r0, r1, r2);
0x0002c2b2 ldr r2, [pc, 0x1c0] |
0x0002c2b4 mov r3, r0 | r3 = r0;
0x0002c2b6 add r2, pc | r2 = 0x58730;
0x0002c2b8 ldr r0, [r2] | r0 = *(0x58730);
0x0002c2ba str r0, [r3, r6] | *((r3 + r6)) = r0;
0x0002c2bc mov r0, r4 | r0 = r4;
0x0002c2be bl 0x6a8c0 | r0 = strlen ();
0x0002c2c2 add.w r3, r0, 8 | r3 = r0 + 8;
0x0002c2c6 bic r3, r3, 7 | r3 = BIT_MASK (r3, 7);
0x0002c2ca sub.w sp, sp, r3 |
0x0002c2ce add r6, sp, 8 | r6 += var_8h;
| do {
| label_4:
0x0002c2d0 ldrb r3, [r4] | r3 = *(r4);
0x0002c2d2 cmp r3, 0x3a |
| if (r3 == 0x3a) {
0x0002c2d4 beq 0x2c3a2 | goto label_21;
| }
0x0002c2d6 cmp r3, 0 |
| if (r3 != 0) {
0x0002c2d8 bne 0x2c3a6 | goto label_22;
| }
0x0002c2da movs r3, 0x43 | r3 = 0x43;
0x0002c2dc strh r3, [r6] | *(r6) = r3;
| label_5:
0x0002c2de ldrb r3, [r6] | r3 = *(r6);
0x0002c2e0 cmp r3, 0x43 |
| if (r3 == 0x43) {
0x0002c2e2 bne 0x2c2e8 |
0x0002c2e4 ldrb r3, [r6, 1] | r3 = *((r6 + 1));
| if (r3 == 0) {
0x0002c2e6 cbz r3, 0x2c31e | goto label_1;
| }
| }
0x0002c2e8 ldr r1, [r7, 0x34] | r1 = *((r7 + 0x34));
0x0002c2ea mov r0, r6 | r0 = r6;
0x0002c2ec bl 0x6a170 | r0 = strcmp (r0, r1);
| if (r0 == 0) {
0x0002c2f0 cbz r0, 0x2c31e | goto label_1;
| }
0x0002c2f2 mov r3, r5 | r3 = r5;
0x0002c2f4 mov r2, r8 | r2 = r8;
0x0002c2f6 mov r1, r6 | r1 = r6;
0x0002c2f8 mov r0, fp | r0 = fp;
0x0002c2fa bl 0x2c6c0 | fcn_0002c6c0 (r0, r1, r2, r3, r4);
0x0002c2fe str r0, [r7, 0x2c] | *((r7 + 0x2c)) = r0;
0x0002c300 cmp r0, 0 |
0x0002c302 beq 0x2c2d0 |
| } while (r0 == 0);
0x0002c304 ldr r3, [r7, 0x1c] | r3 = *((r7 + 0x1c));
0x0002c306 mov r2, sl | r2 = sl;
0x0002c308 mov r1, r5 | r1 = r5;
0x0002c30a str r3, [sp] | *(sp) = r3;
0x0002c30c movs r3, 1 | r3 = 1;
0x0002c30e bl 0x2bad4 | r0 = fcn_0002bad4 (r0, r1, r2, r3, r4, r5);
0x0002c312 mov r3, r0 | r3 = r0;
0x0002c314 cmp r0, 0 |
| if (r0 == 0) {
0x0002c316 beq 0x2c3e0 | goto label_23;
| }
0x0002c318 adds r2, r0, 1 | r2 = r0 + 1;
| if (r2 != r0) {
0x0002c31a bne.w 0x2c510 | goto label_24;
| }
| label_1:
0x0002c31e ldr r0, [r7, 0x38] | r0 = *((r7 + 0x38));
0x0002c320 blx 0x212d4 | fcn_000212d4 ();
0x0002c324 ldr r0, [pc, 0x150] |
0x0002c326 add r0, pc | r0 = 0x587a2;
0x0002c328 adds r0, 0x1c | r0 += 0x1c;
0x0002c32a bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c32e ldr r0, [pc, 0x14c] |
0x0002c330 add r0, pc | r0 = 0x587b2;
0x0002c332 bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c336 ldr r3, [pc, 0x110] |
0x0002c338 ldrd r2, r1, [r7, 0x20] | __asm ("ldrd r2, r1, [r7, 0x20]");
0x0002c33c add r3, pc |
0x0002c33e ldr r3, [r3] | r3 = *(0x5878a);
0x0002c340 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x0002c342 ldr r3, [r7, 0x28] | r3 = *((r7 + 0x28));
0x0002c344 ldr.w r2, [r7, 0x88] | r2 = *((r7 + 0x88));
0x0002c348 cmp r2, 1 |
0x0002c34a it ne |
| if (r2 == 1) {
0x0002c34c cmpne r3, 0 | __asm ("cmpne r3, 0");
| goto label_25;
| }
| if (r2 == 1) {
| label_25:
0x0002c34e beq.w 0x2c180 | goto label_0;
| }
| label_12:
0x0002c352 ldr r3, [r7, 0x18] | r3 = *((r7 + 0x18));
0x0002c354 adds r7, 0x64 | r7 += 0x64;
0x0002c356 mov r0, r3 | r0 = r3;
0x0002c358 mov sp, r7 |
0x0002c35a pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_19:
0x0002c35e bl 0xa0128 | r0 = getcwd ();
0x0002c362 mov r4, r0 | r4 = r0;
0x0002c364 cmp r0, 0 |
| if (r0 == 0) {
0x0002c366 beq 0x2c31e | goto label_1;
| }
0x0002c368 ldr r1, [pc, 0x114] |
0x0002c36a mov r2, r0 | r2 = r0;
0x0002c36c mov r3, fp | r3 = fp;
0x0002c36e add.w r0, r7, 0x38 | r0 += var_38h;
0x0002c372 add r1, pc | r1 = 0x587f6;
0x0002c374 bl 0x3eec0 | r0 = asprintf ();
0x0002c378 mov r6, r0 | r6 = r0;
0x0002c37a mov r0, r4 | r0 = r4;
0x0002c37c blx 0x212d4 | fcn_000212d4 ();
0x0002c380 cmp r6, 0 |
| if (r6 < 0) {
0x0002c382 blt 0x2c31e | goto label_1;
| }
0x0002c384 ldr.w fp, [r7, 0x38] | fp = var_38h;
0x0002c388 b 0x2c242 | goto label_2;
| label_20:
0x0002c38a ldr r0, [pc, 0xf8] |
0x0002c38c add r0, pc | r0 = 0x58816;
0x0002c38e bl 0x30bb8 | r0 = getenv (r0);
0x0002c392 cmp r0, 0 |
| if (r0 == 0) {
0x0002c394 beq.w 0x2c26a | goto label_3;
| }
0x0002c398 ldrb r3, [r0] | r3 = *(r0);
0x0002c39a cmp r3, 0 |
0x0002c39c it ne |
| if (r3 == 0) {
0x0002c39e movne r4, r0 | r4 = r0;
| }
0x0002c3a0 b 0x2c26a | goto label_3;
| label_21:
0x0002c3a2 adds r4, 1 | r4++;
0x0002c3a4 b 0x2c2d0 | goto label_4;
| label_22:
0x0002c3a6 adds r2, r4, 1 | r2 = r4 + 1;
0x0002c3a8 mov r1, r6 | r1 = r6;
| do {
0x0002c3aa strb r3, [r1], 1 | *(r1) = r3;
| r1++;
0x0002c3ae mov r4, r2 | r4 = r2;
0x0002c3b0 ldrb r3, [r2] | r3 = *(r2);
0x0002c3b2 adds r2, 1 | r2++;
0x0002c3b4 cmp r3, 0 |
0x0002c3b6 it ne |
| if (r3 != 0) {
0x0002c3b8 cmpne r3, 0x3a | __asm ("cmpne r3, 0x3a");
| }
0x0002c3ba ite ne |
| if (r3 == 0) {
0x0002c3bc movne r0, 1 | r0 = 1;
| }
| if (r3 != 0) {
0x0002c3be moveq r0, 0 | r0 = 0;
| }
0x0002c3c0 bne 0x2c3aa |
| } while (r3 != 0);
0x0002c3c2 ldr r3, [pc, 0xc4] |
0x0002c3c4 ldr r2, [r7, 0x30] | r2 = *((r7 + 0x30));
0x0002c3c6 strb r0, [r1] | *(r1) = r0;
0x0002c3c8 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x0002c3ca ldr r3, [r3] | r3 = *(0x2c48a);
0x0002c3cc cmp r3, 0 |
| if (r3 == 0) {
0x0002c3ce beq 0x2c2de | goto label_5;
| }
0x0002c3d0 movs r1, 0x2f | r1 = 0x2f;
0x0002c3d2 mov r0, r6 | r0 = r6;
0x0002c3d4 bl 0x6a0a0 | r0 = strchr ();
0x0002c3d8 cmp r0, 0 |
| if (r0 != 0) {
0x0002c3da bne.w 0x2c2d0 | goto label_4;
| }
0x0002c3de b 0x2c2de | goto label_5;
| label_23:
0x0002c3e0 ldr r2, [r7, 0x2c] | r2 = *((r7 + 0x2c));
0x0002c3e2 ldr r0, [r2, 0x10] | r0 = *((r2 + 0x10));
0x0002c3e4 cmp r0, 0 |
| if (r0 == 0) {
0x0002c3e6 beq.w 0x2c2d0 | goto label_4;
| }
0x0002c3ea adds r2, 0x10 | r2 += 0x10;
0x0002c3ec str.w r8, [r7, 4] | __asm ("str.w r8, [r7, 4]");
0x0002c3f0 mov r8, r5 | r8 = r5;
0x0002c3f2 mov r5, r3 | r5 = r3;
0x0002c3f4 mov r3, sl | r3 = sl;
0x0002c3f6 str r4, [r7, 8] | *((r7 + 8)) = r4;
0x0002c3f8 mov sl, sb | sl = sb;
0x0002c3fa str r6, [r7] | *(r7) = r6;
0x0002c3fc mov r4, r2 | r4 = r2;
0x0002c3fe ldr r6, [r7, 0x1c] | r6 = *((r7 + 0x1c));
0x0002c400 mov sb, r3 | sb = r3;
0x0002c402 b 0x2c414 |
| while (r1 != r0) {
0x0002c404 cmp r0, 0 |
| if (r0 != 0) {
0x0002c406 bne 0x2c4fc | goto label_26;
| }
0x0002c408 ldr r0, [r4, 4]! | r0 = *((r4 += 4));
0x0002c40c adds r5, 1 | r5++;
0x0002c40e cmp r0, 0 |
| if (r0 == 0) {
0x0002c410 beq.w 0x2c560 | goto label_27;
| }
0x0002c414 mov r1, r8 | r1 = r8;
0x0002c416 movs r3, 1 | r3 = 1;
0x0002c418 mov r2, sb | r2 = sb;
0x0002c41a str r6, [sp] | *(sp) = r6;
0x0002c41c bl 0x2bad4 | r0 = fcn_0002bad4 (r0, r1, r2, r3, r4, r5);
0x0002c420 adds r1, r0, 1 | r1 = r0 + 1;
0x0002c422 bne 0x2c404 |
| }
0x0002c424 mov sl, sb | sl = sb;
0x0002c426 b 0x2c31e | goto label_1;
| label_13:
0x0002c428 ldr r3, [pc, 0x60] |
0x0002c42a add r3, pc | r3 = 0x588ba;
0x0002c42c ldr.w sb, [r3] | sb = *(0x588ba);
0x0002c430 b 0x2c1b6 | goto label_6;
| label_17:
0x0002c432 ldr.w fp, [pc, 0x5c] |
0x0002c436 movs r5, 0 | r5 = 0;
0x0002c438 add fp, pc | fp = 0x588ce;
0x0002c43a b 0x2c242 | goto label_2;
| label_18:
0x0002c43c ldr.w fp, [pc, 0x54] |
0x0002c440 add fp, pc | fp = 0x588d8;
0x0002c442 b 0x2c242 | goto label_2;
| label_14:
0x0002c498 ldr r2, [r7, 0x28] | r2 = var_28h;
0x0002c49a ldr r3, [r4, 0x14] | r3 = *((r4 + 0x14));
0x0002c49c cbnz r2, 0x2c4c2 |
| while (r0 >= r2) {
| label_8:
0x0002c49e ldr r0, [pc, 0x1c4] |
0x0002c4a0 str r3, [r7, 0x34] | var_34h = r3;
0x0002c4a2 add r0, pc | r0 = 0x58b0c;
0x0002c4a4 adds r0, 0x1c | r0 += 0x1c;
0x0002c4a6 bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c4aa ldr r0, [pc, 0x1bc] |
0x0002c4ac add r0, pc | r0 = 0x58b1a;
0x0002c4ae bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c4b2 ldr r2, [pc, 0x1a8] |
0x0002c4b4 ldrd r3, r1, [r7, 0x20] | __asm ("ldrd r3, r1, [var_20h]");
0x0002c4b8 add r2, pc |
0x0002c4ba ldr r2, [r2] | r2 = *(0x58b1a);
0x0002c4bc str r1, [r3, r2] | *((r3 + r2)) = r1;
0x0002c4be ldr r3, [r7, 0x34] | r3 = var_34h;
0x0002c4c0 b 0x2c182 | goto label_7;
0x0002c4c2 ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x0002c4c4 ldr.w r1, [r7, 0x88] | r1 = *((r7 + 0x88));
0x0002c4c8 str r3, [r7, 0x34] | var_34h = r3;
0x0002c4ca ldr r6, [r2, 8] | r6 = *((r2 + 8));
0x0002c4cc ldr r0, [r6, 0x60] | r0 = *((r6 + 0x60));
0x0002c4ce bl 0x2b994 | fcn_0002b994 (r0, r1);
0x0002c4d2 ldr r2, [r6, 0x64] | r2 = *((r6 + 0x64));
0x0002c4d4 mov r5, r0 | r5 = r0;
0x0002c4d6 ldr r3, [r7, 0x34] | r3 = var_34h;
0x0002c4d8 cmp r0, r2 |
0x0002c4da bhs 0x2c49e |
| }
0x0002c4dc ldr r4, [r4, 0x18] | r4 = *((r4 + 0x18));
0x0002c4de mov r0, r3 | r0 = r3;
0x0002c4e0 mov r6, r3 | r6 = r3;
0x0002c4e2 add r4, r3 | r4 += r3;
| do {
0x0002c4e4 subs r5, 1 | r5--;
0x0002c4e6 mov.w r1, 0 | r1 = 0;
| if (r5 <= 1) {
0x0002c4ea blo.w 0x2c654 | goto label_28;
| }
0x0002c4ee bl 0x6c840 | rawmemchr ();
0x0002c4f2 adds r0, 1 | r0++;
0x0002c4f4 cmp r0, r4 |
0x0002c4f6 blo 0x2c4e4 |
| } while (r0 <= r4);
0x0002c4f8 mov r3, r6 | r3 = r6;
0x0002c4fa b 0x2c49e | goto label_8;
| label_26:
0x0002c4fc mov r1, sb | r1 = sb;
0x0002c4fe mov sb, sl | sb = sl;
0x0002c500 mov sl, r1 | sl = r1;
0x0002c502 ldr r1, [r7, 0x2c] | r1 = *((r7 + 0x2c));
0x0002c504 mov r2, r5 | r2 = r5;
0x0002c506 mov r3, r0 | r3 = r0;
0x0002c508 adds r2, 4 | r2 += 4;
0x0002c50a ldr.w r2, [r1, r2, lsl 2] | offset_0 = r2 << 2;
| r2 = *((r1 + offset_0));
0x0002c50e str r2, [r7, 0x2c] | *((r7 + 0x2c)) = r2;
| label_24:
0x0002c510 ldr r0, [r7, 0x38] | r0 = *((r7 + 0x38));
0x0002c512 str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x0002c514 blx 0x212d4 | fcn_000212d4 ();
0x0002c518 ldr r2, [r7, 0x10] | r2 = *((r7 + 0x10));
0x0002c51a ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x0002c51c cmp r2, 0 |
| if (r2 == 0) {
0x0002c51e beq 0x2c5b0 | goto label_29;
| }
0x0002c520 ldr r0, [r7, 0x30] | r0 = *((r7 + 0x30));
0x0002c522 ldr r1, [pc, 0x148] |
0x0002c524 ldr r2, [r7, 0x10] | r2 = *((r7 + 0x10));
0x0002c526 ldr r1, [r0, r1] | r1 = *((r0 + r1));
0x0002c528 ldr r2, [r2] | r2 = *(r2);
0x0002c52a ldr r0, [r7, 0x2c] | r0 = *((r7 + 0x2c));
0x0002c52c ldr r1, [r1] | r1 = *(0x2c66e);
0x0002c52e strd r0, r3, [r2, 0x10] | __asm ("strd r0, r3, [r2, 0x10]");
0x0002c532 str r1, [r2, 0xc] | *((r2 + 0xc)) = r1;
0x0002c534 ldr r1, [r7, 0x3c] | r1 = *((r7 + 0x3c));
0x0002c536 str r1, [r2, 0x18] | *((r2 + 0x18)) = r1;
| label_10:
0x0002c538 ldr r2, [pc, 0x124] |
0x0002c53a ldrd r1, r0, [r7, 0x20] | __asm ("ldrd r1, r0, [r7, 0x20]");
0x0002c53e add r2, pc |
0x0002c540 ldr r2, [r2] | r2 = *(0x58ba2);
0x0002c542 str r0, [r1, r2] | *((r1 + r2)) = r0;
0x0002c544 ldr r2, [r7, 0x28] | r2 = *((r7 + 0x28));
0x0002c546 cbnz r2, 0x2c578 |
| while (r0 >= r2) {
| label_9:
0x0002c548 ldr r0, [pc, 0x124] |
0x0002c54a str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x0002c54c add r0, pc | r0 = 0x58bc0;
0x0002c54e adds r0, 0x1c | r0 += 0x1c;
0x0002c550 bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c554 ldr r0, [pc, 0x11c] |
0x0002c556 add r0, pc | r0 = 0x58bce;
0x0002c558 bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c55c ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x0002c55e b 0x2c182 | goto label_7;
| label_27:
0x0002c560 mov r3, sb | r3 = sb;
0x0002c562 mov r5, r8 | r5 = r8;
0x0002c564 mov sb, sl | sb = sl;
0x0002c566 ldr r4, [r7, 8] | r4 = *((r7 + 8));
0x0002c568 ldrd r6, r8, [r7] | __asm ("ldrd r6, r8, [r7]");
0x0002c56c mov sl, r3 | sl = r3;
0x0002c56e b 0x2c2d0 | goto label_4;
| label_16:
0x0002c570 ldr.w fp, [pc, 0x104] |
0x0002c574 add fp, pc | fp = 0x58bf0;
0x0002c576 b 0x2c242 | goto label_2;
0x0002c578 str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x0002c57a ldr r3, [r7, 0x2c] | r3 = *((r7 + 0x2c));
0x0002c57c ldr.w r1, [r7, 0x88] | r1 = *((r7 + 0x88));
0x0002c580 ldr r4, [r3, 8] | r4 = *((r3 + 8));
0x0002c582 ldr r0, [r4, 0x60] | r0 = *((r4 + 0x60));
0x0002c584 bl 0x2b994 | fcn_0002b994 (r0, r1);
0x0002c588 ldr r2, [r4, 0x64] | r2 = *((r4 + 0x64));
0x0002c58a mov r4, r0 | r4 = r0;
0x0002c58c ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x0002c58e cmp r0, r2 |
0x0002c590 bhs 0x2c548 |
| }
0x0002c592 ldr r5, [r7, 0x3c] | r5 = *((r7 + 0x3c));
0x0002c594 mov r0, r3 | r0 = r3;
0x0002c596 mov r6, r3 | r6 = r3;
0x0002c598 add r5, r3 | r5 += r3;
| do {
0x0002c59a subs r4, 1 | r4--;
0x0002c59c mov.w r1, 0 | r1 = 0;
| if (r4 <= 1) {
0x0002c5a0 blo 0x2c658 | goto label_30;
| }
0x0002c5a2 bl 0x6c840 | rawmemchr ();
0x0002c5a6 adds r0, 1 | r0++;
0x0002c5a8 cmp r0, r5 |
0x0002c5aa blo 0x2c59a |
| } while (r0 <= r5);
0x0002c5ac mov r3, r6 | r3 = r6;
0x0002c5ae b 0x2c548 | goto label_9;
| label_29:
0x0002c5b0 mov r0, sl | r0 = sl;
0x0002c5b2 bl 0x6a8c0 | strlen ();
0x0002c5b6 ldr.w r8, [r7, 0xc] | r8 = *((r7 + 0xc));
0x0002c5ba adds r6, r0, 1 | r6 = r0 + 1;
0x0002c5bc mov r0, r8 | r0 = r8;
0x0002c5be bl 0x6a8c0 | strlen ();
0x0002c5c2 ldr r5, [r7, 0x14] | r5 = *((r7 + 0x14));
0x0002c5c4 add.w r2, r5, 0x1e | r2 = r5 + 0x1e;
0x0002c5c8 add r0, r2 | r0 += r2;
0x0002c5ca add r0, r6 | r0 += r6;
0x0002c5cc blx 0x21354 | fcn_00021354 ();
0x0002c5d0 ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x0002c5d2 mov r4, r0 | r4 = r0;
0x0002c5d4 cmp r0, 0 |
| if (r0 == 0) {
0x0002c5d6 beq 0x2c538 | goto label_10;
| }
0x0002c5d8 mov r2, r6 | r2 = r6;
0x0002c5da mov r1, sl | r1 = sl;
0x0002c5dc adds r0, 0x1c | r0 += 0x1c;
0x0002c5de adds r5, 1 | r5++;
0x0002c5e0 blx 0x6fa80 | r0 = memcpy (r0, r1, r2);
0x0002c5e4 add r6, r0 | r6 += r0;
0x0002c5e6 mov r2, r5 | r2 = r5;
0x0002c5e8 mov r1, sb | r1 = sb;
0x0002c5ea adds r5, r6, r5 | r5 = r6 + r5;
0x0002c5ec mov r0, r6 | r0 = r6;
0x0002c5ee blx 0x6fa80 | memcpy (r0, r1, r2);
0x0002c5f2 mov r1, r8 | r1 = r8;
0x0002c5f4 mov r0, r5 | r0 = r5;
0x0002c5f6 bl 0x6a480 | strcpy (r0, r1)
0x0002c5fa ldr.w r3, [r7, 0x8c] | r3 = *((r7 + 0x8c));
0x0002c5fe ldr r2, [pc, 0x6c] |
0x0002c600 str r6, [r4] | *(r4) = r6;
0x0002c602 strd r3, r5, [r4, 4] | __asm ("strd r3, r5, [r4, 4]");
0x0002c606 ldr r3, [r7, 0x30] | r3 = *((r7 + 0x30));
0x0002c608 ldr r6, [pc, 0x70] |
0x0002c60a ldr r2, [r3, r2] | r2 = *((r3 + r2));
0x0002c60c ldr r3, [r7, 0x2c] | r3 = *((r7 + 0x2c));
0x0002c60e add r6, pc | r6 = 0x58c8e;
0x0002c610 add.w r5, r6, 0x3c | r5 = r6 + 0x3c;
0x0002c614 ldr r2, [r2] | r2 = *(0x2c66e);
0x0002c616 mov r0, r5 | r0 = r5;
0x0002c618 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x0002c61a ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x0002c61c str r2, [r4, 0xc] | *((r4 + 0xc)) = r2;
0x0002c61e ldr r2, [r7, 0x3c] | r2 = *((r7 + 0x3c));
0x0002c620 str r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
0x0002c622 str r2, [r4, 0x18] | *((r4 + 0x18)) = r2;
0x0002c624 bl 0x61c20 | pthread_rwlock_wrlock ();
0x0002c628 ldr r2, [pc, 0x54] |
0x0002c62a mov r1, r6 | r1 = r6;
0x0002c62c mov r0, r4 | r0 = r4;
0x0002c62e add r2, pc | r2 = 0x58cb2;
0x0002c630 bl 0xaae0c | r0 = tsearch ();
0x0002c634 mov r6, r0 | r6 = r0;
0x0002c636 mov r0, r5 | r0 = r5;
0x0002c638 bl 0x61a84 | pthread_rwlock_unlock ();
0x0002c63c ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
| if (r6 == 0) {
0x0002c63e cbz r6, 0x2c648 | goto label_31;
| }
0x0002c640 ldr r2, [r6] | r2 = *(r6);
0x0002c642 cmp r2, r4 |
| if (r2 == r4) {
0x0002c644 beq.w 0x2c538 | goto label_10;
| }
| label_31:
0x0002c648 mov r0, r4 | r0 = r4;
0x0002c64a str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x0002c64c blx 0x212d4 | fcn_000212d4 ();
0x0002c650 ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x0002c652 b 0x2c538 | goto label_10;
| label_28:
0x0002c654 mov r3, r0 | r3 = r0;
0x0002c656 b 0x2c49e | goto label_8;
| label_30:
0x0002c658 mov r3, r0 | r3 = r0;
0x0002c65a b 0x2c548 | goto label_9;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libc.so.6 @ 0x37d0c */
| #include <stdint.h>
|
; (fcn) fcn.00037d0c () | void fcn_00037d0c (int16_t arg_4h, int16_t arg_24h, int16_t arg_28h, int16_t arg_2ch, int16_t arg_30h, int16_t arg_34h, int16_t arg_38h, int16_t arg_40h, int16_t arg_440h, int16_t arg_448h, uint32_t arg1, char * arg2, int16_t arg3) {
| int16_t var_84ch;
| int16_t var_4h;
| char * dest;
| int16_t var_ch;
| int16_t var_10h;
| size_t s2;
| void * var_18h;
| size_t n;
| int16_t var_20h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00037d0c push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00037d10 subw sp, sp, 0x84c | __asm ("subw sp, sp, aav.0x000000ff");
0x00037d14 mov r4, r0 | r4 = r0;
0x00037d16 str r1, [sp, 8] | dest = r1;
0x00037d18 cmp r0, 0 |
| if (arg_24h == ) {
0x00037d1a beq.w 0x37f54 | goto label_18;
| }
0x00037d1e ldrb r0, [r0] | r0 = *(r0);
0x00037d20 cmp r0, 0 |
| if (arg_24h == ) {
0x00037d22 beq.w 0x37ec2 | goto label_19;
| }
0x00037d26 add r3, sp, 0x40 | r3 += arg_40h;
0x00037d28 mov.w r1, 0x400 | r1 = 0x400;
0x00037d2c str r3, [sp, 0x10] | var_10h = r3;
0x00037d2e mov r5, r2 | r5 = r2;
0x00037d30 str r3, [sp, 0x38] | *(arg_38h) = r3;
0x00037d32 add.w r3, r2, 8 | r3 = r2 + 8;
0x00037d36 str r1, [r2, 4] | *((r2 + 4)) = r1;
0x00037d38 add.w fp, sp, 0x38 |
0x00037d3c str r3, [r2] | *(r2) = r3;
0x00037d3e add.w r2, sp, 0x448 | r2 += arg_448h;
0x00037d42 str r3, [sp, 4] | var_4h = r3;
0x00037d44 add.w sl, sp, 0x440 | sl += arg_440h;
0x00037d48 ldrb r3, [r4] | r3 = *(r4);
0x00037d4a str r2, [sp, 0xc] | var_ch = r2;
0x00037d4c str.w r1, [fp, 4] | __asm ("str.w r1, [arg_4h]");
0x00037d50 cmp r3, 0x2f |
0x00037d52 str.w r1, [sl, 4] | __asm ("str.w r1, [sl, 4]");
0x00037d56 str.w r2, [sl] | __asm ("str.w r2, [sl]");
| if (r3 == 0x2f) {
0x00037d5a beq 0x37de4 | goto label_20;
| }
0x00037d5c ldr r6, [sp, 4] | r6 = var_4h;
0x00037d5e mrc p15, 0, r8, c13, c0, 3 | __asm ("mrc p15, 0, r8, c13, c0, 3");
0x00037d62 b 0x37d68 |
| while (r0 != 0) {
0x00037d64 ldrd r6, r1, [r5] | __asm ("ldrd r6, r1, [r5]");
0x00037d68 mov r0, r6 | r0 = r6;
0x00037d6a bl 0xa0128 | r0 = getcwd ();
0x00037d6e mov r2, r0 | r2 = r0;
0x00037d70 ldr r3, [pc, 0x268] | r3 = *(0x37fdc);
0x00037d72 mov r0, r5 | r0 = r5;
0x00037d74 cmp r2, 0 |
| if (r2 != 0) {
0x00037d76 bne.w 0x37f16 | goto label_21;
| }
0x00037d7a add r3, pc | r3 += pc;
0x00037d7c ldr r3, [r3] | r3 = *(r3);
0x00037d7e ldr.w r3, [r8, r3] | r3 = *((r8 + r3));
0x00037d82 cmp r3, 0x22 |
| if (r3 != 0x22) {
0x00037d84 bne.w 0x37f22 | goto label_22;
| }
0x00037d88 bl 0x69c4c | r0 = libc_scratch_buffer_grow ();
0x00037d8c cmp r0, 0 |
0x00037d8e bne 0x37d64 |
| }
| label_4:
0x00037d90 mov.w r8, 1 | r8 = 1;
0x00037d94 mov r4, r8 | r4 = r8;
| label_0:
0x00037d96 ldr.w r0, [fp] | r0 = *(fp);
0x00037d9a ldr r3, [sp, 0x10] | r3 = var_10h;
0x00037d9c cmp r0, r3 |
| if (r0 != r3) {
0x00037d9e beq 0x37da4 |
0x00037da0 blx 0x212d4 | fcn_000212d4 ();
| }
0x00037da4 ldr.w r0, [sl] | r0 = *(sl);
0x00037da8 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00037daa cmp r0, r3 |
| if (r0 != r3) {
0x00037dac beq 0x37db2 |
0x00037dae blx 0x212d4 | fcn_000212d4 ();
| }
0x00037db2 cmp.w r8, 0 |
| if (r8 != 0) {
0x00037db6 beq 0x37dd4 |
0x00037db8 ldr r0, [r5] | r0 = *(r5);
0x00037dba ldr r3, [sp, 4] | r3 = var_4h;
0x00037dbc cmp r3, r0 |
| if (r3 != r0) {
0x00037dbe beq 0x37dc4 |
0x00037dc0 blx 0x212d4 | fcn_000212d4 ();
| }
0x00037dc4 cmp r4, 0 |
0x00037dc6 ldr r0, [sp, 8] | r0 = dest;
0x00037dc8 it ne |
| if (r4 == 0) {
0x00037dca movne r0, 0 | r0 = 0;
| }
| label_6:
0x00037dcc addw sp, sp, 0x84c | __asm ("addw sp, var_84ch");
0x00037dd0 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x00037dd4 subs r1, r7, r6 | r1 = r7 - r6;
0x00037dd6 mov r0, r5 | r0 = r5;
0x00037dd8 bl 0x69c14 | libc_scratch_buffer_dupfree ();
0x00037ddc addw sp, sp, 0x84c | __asm ("addw sp, var_84ch");
0x00037de0 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_20:
0x00037de4 ldr r6, [sp, 4] | r6 = var_4h;
0x00037de6 add.w r7, r5, 9 | r7 = r5 + 9;
0x00037dea strb r3, [r5, 8] | *((r5 + 8)) = r3;
| label_5:
0x00037dec ldrb r3, [r4] | r3 = *(r4);
0x00037dee cmp r3, 0 |
| if (r3 == 0) {
0x00037df0 beq 0x37ea2 | goto label_3;
| }
0x00037df2 ldr r2, [pc, 0x1fc] |
0x00037df4 mrc p15, 0, r1, c13, c0, 3 | __asm ("mrc p15, 0, r1, c13, c0, 3");
0x00037df8 str r1, [sp, 0x2c] | *(arg_2ch) = r1;
0x00037dfa add r2, pc | r2 = 0x6fdf0;
0x00037dfc str r2, [sp, 0x28] | *(arg_28h) = r2;
0x00037dfe ldr r2, [pc, 0x1f4] |
0x00037e00 add r2, pc | r2 = 0x6fdfa;
0x00037e02 str r2, [sp, 0x30] | *(arg_30h) = r2;
0x00037e04 movs r2, 0 | r2 = 0;
0x00037e06 str r2, [sp, 0x20] | var_20h = r2;
0x00037e08 str r2, [sp, 0x24] | *(arg_24h) = r2;
| label_2:
0x00037e0a cmp r3, 0x2f |
0x00037e0c itt ne |
| if (r3 == 0x2f) {
0x00037e0e movne r2, r3 | r2 = r3;
| }
| if (r3 == 0x2f) {
0x00037e10 strne r4, [sp, 0x18] | var_18h = r4;
| }
| if (r3 != 0x2f) {
0x00037e12 bne 0x37e22 | goto label_23;
| }
| do {
0x00037e14 ldrb r2, [r4, 1]! | r2 = *((r4 += 1));
0x00037e18 cmp r2, 0x2f |
0x00037e1a beq 0x37e14 |
| } while (r2 == 0x2f);
0x00037e1c cmp r2, 0 |
| if (r2 == 0) {
0x00037e1e beq 0x37ea2 | goto label_3;
| }
0x00037e20 str r4, [sp, 0x18] | var_18h = r4;
| do {
| label_23:
0x00037e22 mov r8, r4 | r8 = r4;
0x00037e24 ldrb r3, [r4, 1]! | r3 = *((r4 += 1));
0x00037e28 cmp r3, 0 |
0x00037e2a it ne |
| if (r3 != 0) {
0x00037e2c cmpne r3, 0x2f | __asm ("cmpne r3, 0x2f");
| }
0x00037e2e bne 0x37e22 |
| } while (r3 != 0);
0x00037e30 ldr r1, [sp, 0x18] | r1 = var_18h;
0x00037e32 subs r1, r4, r1 | r1 = r4 - r1;
0x00037e34 str r1, [sp, 0x14] | s2 = r1;
| if (r1 == r4) {
0x00037e36 beq 0x37ea2 | goto label_3;
| }
0x00037e38 cmp r1, 1 |
| if (r1 == 1) {
0x00037e3a beq 0x37eb8 | goto label_24;
| }
0x00037e3c ldr r1, [sp, 0x14] | r1 = s2;
0x00037e3e cmp r2, 0x2e |
0x00037e40 it eq |
| if (r2 == 0x2e) {
0x00037e42 cmpeq r1, 2 | __asm ("cmpeq r1, 2");
| }
| if (r2 == 0x2e) {
0x00037e44 beq 0x37e8e | goto label_25;
| }
| label_1:
0x00037e46 ldrb r3, [r7, -0x1] | r3 = *((r7 - 0x1));
0x00037e4a cmp r3, 0x2f |
| if (r3 != 0x2f) {
0x00037e4c beq 0x37e54 |
0x00037e4e movs r3, 0x2f | r3 = 0x2f;
0x00037e50 strb r3, [r7], 1 | *(r7) = r3;
| r7++;
| }
0x00037e54 ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00037e56 ldr r2, [sp, 0x14] | r2 = s2;
0x00037e58 add r3, r6 | r3 += r6;
0x00037e5a adds r2, 2 | r2 += 2;
0x00037e5c subs r3, r3, r7 | r3 -= r7;
0x00037e5e cmp r2, r3 |
0x00037e60 ittt hi |
| if (r2 <= r3) {
0x00037e62 strhi r4, [sp, 0x1c] | n = r4;
| }
| if (r2 <= r3) {
0x00037e64 movhi sb, r2 | sb = r2;
| }
| if (r2 <= r3) {
0x00037e66 movhi r4, r7 | r4 = r7;
| }
| if (r2 > r3) {
0x00037e68 bhi 0x37e78 | goto label_26;
| }
0x00037e6a b 0x37edc | goto label_27;
| do {
0x00037e6c ldrd r6, r3, [r5] | __asm ("ldrd r6, r3, [r5]");
0x00037e70 subs r3, r3, r7 | r3 -= r7;
0x00037e72 adds r4, r6, r7 | r4 = r6 + r7;
0x00037e74 cmp r3, sb |
| if (r3 >= sb) {
0x00037e76 bhs 0x37ed8 | goto label_28;
| }
| label_26:
0x00037e78 mov r0, r5 | r0 = r5;
0x00037e7a subs r7, r4, r6 | r7 = r4 - r6;
0x00037e7c bl 0x69c9c | r0 = libc_scratch_buffer_grow_preserve ();
0x00037e80 cmp r0, 0 |
0x00037e82 bne 0x37e6c |
| } while (r0 != 0);
0x00037e84 mov.w r8, 1 | r8 = 1;
0x00037e88 mov r7, r4 | r7 = r4;
0x00037e8a mov r4, r8 | r4 = r8;
0x00037e8c b 0x37d96 | goto label_0;
| label_25:
0x00037e8e ldr r2, [sp, 0x18] | r2 = var_18h;
0x00037e90 ldrb r2, [r2, 1] | r2 = *((r2 + 1));
0x00037e92 cmp r2, 0x2e |
| if (r2 != 0x2e) {
0x00037e94 bne 0x37e46 | goto label_1;
| }
0x00037e96 adds r2, r6, 1 | r2 = r6 + 1;
0x00037e98 cmp r7, r2 |
| if (r7 > r2) {
0x00037e9a bhi.w 0x37fb6 | goto label_29;
| }
| label_8:
0x00037e9e cmp r3, 0 |
| if (r3 != 0) {
0x00037ea0 bne 0x37e0a | goto label_2;
| }
| label_3:
0x00037ea2 adds r3, r6, 1 | r3 = r6 + 1;
0x00037ea4 cmp r7, r3 |
| if (r7 >= r3) {
0x00037ea6 bls 0x37eb2 |
0x00037ea8 ldrb r3, [r7, -0x1] | r3 = *((r7 - 0x1));
0x00037eac cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x00037eae beq.w 0x3815c | goto label_30;
| }
| }
0x00037eb2 adds r3, r7, 1 | r3 = r7 + 1;
0x00037eb4 movs r4, 0 | r4 = 0;
0x00037eb6 b 0x37f28 | goto label_12;
| label_24:
0x00037eb8 cmp r2, 0x2e |
| if (r2 != 0x2e) {
0x00037eba bne 0x37e46 | goto label_1;
| }
0x00037ebc cmp r3, 0 |
| if (r3 != 0) {
0x00037ebe bne 0x37e0a | goto label_2;
| }
0x00037ec0 b 0x37ea2 | goto label_3;
| label_19:
0x00037ec2 ldr r3, [pc, 0x11c] |
0x00037ec4 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x00037ec8 movs r1, 2 | r1 = 2;
0x00037eca add r3, pc |
0x00037ecc ldr r3, [r3] | r3 = *(0x6feb0);
0x00037ece str r1, [r2, r3] | *((r2 + r3)) = r1;
0x00037ed0 addw sp, sp, 0x84c | __asm ("addw sp, var_84ch");
0x00037ed4 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_28:
0x00037ed8 mov r7, r4 | r7 = r4;
0x00037eda ldr r4, [sp, 0x1c] | r4 = n;
| label_27:
0x00037edc mov r0, r7 | r0 = r7;
0x00037ede ldrd r7, r1, [sp, 0x14] | __asm ("ldrd r7, r1, [s2]");
0x00037ee2 mov r2, r7 | r2 = r7;
0x00037ee4 blx 0x6fa80 | memcpy (r0, r1, r2);
0x00037ee8 movs r3, 0 | r3 = 0;
0x00037eea str r0, [sp, 0x1c] | n = r0;
0x00037eec strb r3, [r0, r7] | *((r0 + r7)) = r3;
0x00037eee adds r7, r0, r7 | r7 = r0 + r7;
0x00037ef0 str r4, [sp, 0x18] | var_18h = r4;
| do {
0x00037ef2 ldrd r4, r3, [sl] | __asm ("ldrd r4, r3, [sl]");
0x00037ef6 mov r0, r6 | r0 = r6;
0x00037ef8 add.w sb, r3, -1 | sb = r3 + -1;
0x00037efc mov r1, r4 | r1 = r4;
0x00037efe mov r2, sb | r2 = sb;
0x00037f00 bl 0xa0ac0 | r0 = readlink ();
0x00037f04 mov r2, r0 | r2 = r0;
0x00037f06 mov r0, sl | r0 = sl;
0x00037f08 cmp sb, r2 |
| if (sb > r2) {
0x00037f0a bgt 0x37f64 | goto label_31;
| }
0x00037f0c bl 0x69c4c | r0 = libc_scratch_buffer_grow ();
0x00037f10 cmp r0, 0 |
0x00037f12 bne 0x37ef2 |
| } while (r0 != 0);
0x00037f14 b 0x37d90 | goto label_4;
| label_21:
0x00037f16 movs r1, 0 | r1 = 0;
0x00037f18 mov r0, r6 | r0 = r6;
0x00037f1a bl 0x6c840 | r0 = rawmemchr ();
0x00037f1e mov r7, r0 | r7 = r0;
0x00037f20 b 0x37dec | goto label_5;
| label_22:
0x00037f22 adds r3, r6, 1 | r3 = r6 + 1;
0x00037f24 mov r7, r6 | r7 = r6;
0x00037f26 movs r4, 1 | r4 = 1;
| label_12:
0x00037f28 movs r2, 0 | r2 = 0;
0x00037f2a strb r2, [r7] | *(r7) = r2;
0x00037f2c ldr r2, [sp, 8] | r2 = dest;
0x00037f2e cmp r2, 0 |
| if (r2 == 0) {
0x00037f30 beq.w 0x380a8 | goto label_32;
| }
0x00037f34 subs r2, r3, r6 | r2 = r3 - r6;
0x00037f36 cmp.w r2, 0x1000 |
| if (r2 <= 0x1000) {
0x00037f3a ble.w 0x380b6 | goto label_33;
| }
0x00037f3e mov r7, r3 | r7 = r3;
0x00037f40 ldr r3, [pc, 0xa0] |
0x00037f42 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x00037f46 movs r1, 0x24 | r1 = 0x24;
0x00037f48 movs r4, 1 | r4 = 1;
0x00037f4a add r3, pc |
0x00037f4c ldr r3, [r3] | r3 = *(0x6ff32);
0x00037f4e mov r8, r4 | r8 = r4;
0x00037f50 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x00037f52 b 0x37d96 | goto label_0;
| label_18:
0x00037f54 ldr r3, [pc, 0x90] |
0x00037f56 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x00037f5a movs r1, 0x16 | r1 = 0x16;
0x00037f5c add r3, pc |
0x00037f5e ldr r3, [r3] | r3 = *(0x6ff48);
0x00037f60 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x00037f62 b 0x37dcc | goto label_6;
| label_31:
0x00037f64 cmp r2, 0 |
0x00037f66 mov r3, r4 | r3 = r4;
0x00037f68 mov sb, r2 | sb = r2;
0x00037f6a ldr r4, [sp, 0x18] | r4 = var_18h;
| if (r2 >= 0) {
0x00037f6c bge 0x37ff8 | goto label_34;
| }
0x00037f6e ldrb r3, [r4] | r3 = *(r4);
0x00037f70 cmp r3, 0x2f |
0x00037f72 it eq |
| if (r3 != 0x2f) {
0x00037f74 moveq r3, r4 | r3 = r4;
| }
| if (r3 != 0x2f) {
0x00037f76 bne 0x37f9c | goto label_10;
| }
| do {
| label_7:
0x00037f78 mov r1, r3 | r1 = r3;
0x00037f7a ldrb r2, [r3, 1]! | r2 = *((r3 += 1));
0x00037f7e cmp r2, 0x2f |
0x00037f80 beq 0x37f78 |
| } while (r2 == 0x2f);
0x00037f82 adds r1, 2 | r1 += 2;
0x00037f84 cmp r2, 0 |
| if (r2 == 0) {
0x00037f86 beq 0x38084 | goto label_35;
| }
0x00037f88 cmp r2, 0x2e |
| if (r2 != 0x2e) {
0x00037f8a bne 0x37f9c | goto label_10;
| }
0x00037f8c ldrb r2, [r3, 1] | r2 = *((r3 + 1));
0x00037f8e cmp r2, 0 |
| if (r2 == 0) {
0x00037f90 beq 0x38084 | goto label_35;
| }
0x00037f92 cmp r2, 0x2e |
| if (r2 == 0x2e) {
0x00037f94 beq 0x3807a | goto label_36;
| }
0x00037f96 cmp r2, 0x2f |
0x00037f98 mov r3, r1 | r3 = r1;
| if (r2 == 0x2f) {
0x00037f9a beq 0x37f78 | goto label_7;
| }
| label_10:
0x00037f9c ldr r3, [pc, 0x4c] |
0x00037f9e ldr r2, [sp, 0x2c] | r2 = *(arg_2ch);
0x00037fa0 add r3, pc |
0x00037fa2 ldr r3, [r3] | r3 = *(0x6ff90);
0x00037fa4 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x00037fa6 cmp r3, 0x16 |
| if (r3 != 0x16) {
0x00037fa8 bne 0x380a2 | goto label_37;
| }
| label_11:
0x00037faa ldrb.w r3, [r8, 1] | r3 = *((r8 + 1));
0x00037fae cmp r3, 0 |
| if (r3 != 0) {
0x00037fb0 bne.w 0x37e0a | goto label_2;
| }
0x00037fb4 b 0x37ea2 | goto label_3;
| label_29:
0x00037fb6 subs r7, 1 | r7--;
0x00037fb8 cmp r7, r6 |
| if (r7 < r6) {
0x00037fba bls.w 0x37e9e | goto label_8;
| }
0x00037fbe mov r2, r7 | r2 = r7;
| label_9:
0x00037fc0 ldrb r1, [r2, -0x1] | r1 = *((r2 - 0x1));
0x00037fc4 mov r7, r2 | r7 = r2;
0x00037fc6 subs r2, 1 | r2--;
0x00037fc8 cmp r1, 0x2f |
| if (r1 == 0x2f) {
0x00037fca beq.w 0x37e9e | goto label_8;
| }
0x00037fce cmp r6, r2 |
| if (r6 != r2) {
0x00037fd0 bne 0x37fc0 | goto label_9;
| }
0x00037fd2 mov r7, r6 | r7 = r6;
0x00037fd4 cmp r3, 0 |
| if (r3 != 0) {
0x00037fd6 bne.w 0x37e0a | goto label_2;
| }
0x00037fda b 0x37ea2 | goto label_3;
| label_34:
0x00037ff8 ldr r2, [sp, 0x24] | r2 = *(arg_24h);
0x00037ffa adds r2, 1 | r2++;
0x00037ffc str r2, [sp, 0x24] | *(arg_24h) = r2;
0x00037ffe ldr r2, [sp, 0x28] | r2 = *(arg_28h);
0x00038000 ldr r2, [r2] | r2 = *(r2);
0x00038002 cmp r2, 0 |
| if (r2 == 0) {
0x00038004 beq.w 0x3812e | goto label_38;
| }
| label_14:
0x00038008 cmp r2, 0 |
0x0003800a it le |
| if (r2 > 0) {
0x0003800c movle r2, 0x28 | r2 = 0x28;
| }
| if (r2 > 0) {
0x0003800e ble 0x38016 |
0x00038010 cmp r2, 0x28 |
0x00038012 it lo |
| if (r2 < 0x28) {
0x00038014 movlo r2, 0x28 | r2 = 0x28;
| goto label_39;
| }
| }
| label_39:
0x00038016 ldr r1, [sp, 0x24] | r1 = *(arg_24h);
0x00038018 cmp r2, r1 |
| if (r2 <= r1) {
0x0003801a blo.w 0x38192 | goto label_40;
| }
0x0003801e movs r2, 0 | r2 = 0;
0x00038020 ldr r1, [sp, 0x20] | r1 = var_20h;
0x00038022 strb.w r2, [r3, sb] | *((r3 + sb)) = r2;
0x00038026 ldr.w r2, [fp] | r2 = *(fp);
0x0003802a str r2, [sp, 0x14] | s2 = r2;
0x0003802c cmp r1, 0 |
| if (r1 == 0) {
0x0003802e beq 0x380d2 | goto label_41;
| }
0x00038030 mov r0, r4 | r0 = r4;
0x00038032 str r3, [sp, 0x34] | *(arg_34h) = r3;
0x00038034 bl 0x6a8c0 | strlen ();
0x00038038 ldr.w r2, [fp, 4] | r2 = *(arg_4h);
0x0003803c add.w r8, sb, r0 | r8 = sb + r0;
0x00038040 ldr r3, [sp, 0x14] | r3 = s2;
0x00038042 str r0, [sp, 0x1c] | n = r0;
0x00038044 cmp r8, r2 |
0x00038046 sub.w r3, r4, r3 | r3 = r4 - r3;
0x0003804a str r3, [sp, 0x18] | var_18h = r3;
0x0003804c ldr r3, [sp, 0x34] | r3 = *(arg_34h);
| if (r8 <= r2) {
0x0003804e blo.w 0x38154 | goto label_42;
| }
| label_13:
0x00038052 str r3, [sp, 0x34] | *(arg_34h) = r3;
0x00038054 mov r3, fp | r3 = fp;
0x00038056 mov fp, sl |
0x00038058 mov sl, r5 | sl = r5;
0x0003805a mov r5, r4 | r5 = r4;
0x0003805c mov r4, r3 | r4 = r3;
0x0003805e b 0x38068 |
| while (r0 != 0) {
0x00038060 ldrd r1, r2, [r4] | __asm ("ldrd r1, r2, [r4]");
0x00038064 cmp r2, r8 |
| if (r2 > r8) {
0x00038066 bhi 0x38140 | goto label_43;
| }
0x00038068 mov r0, r4 | r0 = r4;
0x0003806a bl 0x69c9c | r0 = libc_scratch_buffer_grow_preserve ();
0x0003806e cmp r0, 0 |
0x00038070 bne 0x38060 |
| }
0x00038072 mov r5, sl | r5 = sl;
0x00038074 mov sl, fp | sl = fp;
0x00038076 mov fp, r4 |
0x00038078 b 0x37d90 | goto label_4;
| label_36:
0x0003807a ldrb r3, [r3, 2] | r3 = *((r3 + 2));
0x0003807c cmp r3, 0x2f |
0x0003807e it ne |
| if (r3 == 0x2f) {
0x00038080 cmpne r3, 0 | __asm ("cmpne r3, 0");
| goto label_44;
| }
| if (r3 != 0x2f) {
| label_44:
0x00038082 bne 0x37f9c | goto label_10;
| }
| label_35:
0x00038084 ldr r3, [sp, 0x30] | r3 = *(arg_30h);
0x00038086 mvn r0, 0x63 | r0 = ~0x63;
0x0003808a ldr r2, [sp, 0x1c] | r2 = n;
0x0003808c ldr r1, [sp, 0x14] | r1 = s2;
0x0003808e ldrh r3, [r3] | r3 = *(r3);
0x00038090 strh r3, [r2, r1] | *((r2 + r1)) = r3;
0x00038092 mov.w r3, 0x200 | r3 = 0x200;
0x00038096 movs r2, 0 | r2 = 0;
0x00038098 mov r1, r6 | r1 = r6;
0x0003809a bl 0x9f9f0 | faccessat ();
0x0003809c stc2 p8, c2, [sb], 0 | __asm ("stc2 p8, c2, [sb], 0");
| if (r2 == 0) {
0x000380a0 beq 0x37faa | goto label_11;
| }
| label_37:
0x000380a2 adds r3, r7, 1 | r3 = r7 + 1;
0x000380a4 movs r4, 1 | r4 = 1;
0x000380a6 b 0x37f28 | goto label_12;
| label_32:
0x000380a8 mov r7, r3 | r7 = r3;
0x000380aa cmp r6, 0 |
0x000380ac ite ne |
| if (r6 == 0) {
0x000380ae movne r8, r4 | r8 = r4;
| }
| if (r6 != 0) {
0x000380b0 orreq r8, r4, 1 | r8 = r4 | 1;
| }
0x000380b4 b 0x37d96 | goto label_0;
| label_33:
0x000380b6 ldr.w r8, [sp, 8] | r8 = dest;
0x000380ba mov r1, r6 | r1 = r6;
0x000380bc mov r7, r3 | r7 = r3;
0x000380be mov r0, r8 | r0 = r8;
0x000380c0 bl 0x6a480 | r0 = strcpy (r0, r1)
0x000380c4 mov r6, r0 | r6 = r0;
0x000380c6 cmp r8, r0 |
0x000380c8 ite ne |
| if (r8 == r0) {
0x000380ca movne r8, r4 | r8 = r4;
| }
| if (r8 != r0) {
0x000380cc orreq r8, r4, 1 | r8 = r4 | 1;
| }
0x000380d0 b 0x37d96 | goto label_0;
| label_41:
0x000380d2 mov r0, r4 | r0 = r4;
0x000380d4 str r3, [sp, 0x18] | var_18h = r3;
0x000380d6 bl 0x6a8c0 | strlen ();
0x000380da ldr.w r2, [fp, 4] | r2 = *(arg_4h);
0x000380de add.w r8, sb, r0 | r8 = sb + r0;
0x000380e2 ldr r3, [sp, 0x18] | r3 = var_18h;
0x000380e4 str r0, [sp, 0x1c] | n = r0;
0x000380e6 cmp r8, r2 |
0x000380e8 itt hs |
| if (r8 < r2) {
0x000380ea ldrhs r2, [sp, 0x20] | r2 = var_20h;
| }
| if (r8 >= r2) {
0x000380ec strhs r2, [sp, 0x18] | var_18h = r2;
| goto label_45;
| }
| if (r8 >= r2) {
| label_45:
0x000380ee bhs 0x38052 | goto label_13;
| }
| label_15:
0x000380f0 mov r1, r4 | r1 = r4;
0x000380f2 ldr r2, [sp, 0x1c] | r2 = n;
0x000380f4 ldr r4, [sp, 0x14] | r4 = s2;
0x000380f6 str r3, [sp, 0x18] | var_18h = r3;
0x000380f8 adds r2, 1 | r2++;
0x000380fa add.w r0, r4, sb | r0 = r4 + sb;
0x000380fe blx 0x6b560 | memmove ();
0x00038102 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00038104 mov r2, sb | r2 = sb;
0x00038106 mov r0, r4 | r0 = r4;
0x00038108 mov r1, r3 | r1 = r3;
0x0003810a str r3, [sp, 0x14] | s2 = r3;
0x0003810c blx 0x6fa80 | memcpy (r0, r1, r2);
0x00038110 ldr r3, [sp, 0x14] | r3 = s2;
0x00038112 mov r4, r0 | r4 = r0;
0x00038114 adds r2, r6, 1 | r2 = r6 + 1;
0x00038116 ldrb r3, [r3] | r3 = *(r3);
0x00038118 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x0003811a beq 0x38164 | goto label_46;
| }
0x0003811c cmp r7, r2 |
0x0003811e ldrb r3, [r0] | r3 = *(r0);
| if (r7 > r2) {
0x00038120 bhi 0x38176 | goto label_47;
| }
| label_16:
0x00038122 movs r2, 1 | r2 = 1;
0x00038124 str r2, [sp, 0x20] | var_20h = r2;
0x00038126 cmp r3, 0 |
| if (r3 != 0) {
0x00038128 bne.w 0x37e0a | goto label_2;
| }
0x0003812c b 0x37ea2 | goto label_3;
| label_38:
0x0003812e movs r0, 0xad | r0 = 0xad;
0x00038130 str r3, [sp, 0x14] | s2 = r3;
0x00038132 bl 0x86980 | sysconf ();
0x00038136 ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00038138 mov r2, r0 | r2 = r0;
0x0003813a str r0, [r3] | *(r3) = r0;
0x0003813c ldr r3, [sp, 0x14] | r3 = s2;
0x0003813e b 0x38008 | goto label_14;
| label_43:
0x00038140 mov r2, r4 | r2 = r4;
0x00038142 mov r4, r5 | r4 = r5;
0x00038144 mov r5, sl | r5 = sl;
0x00038146 mov sl, fp | sl = fp;
0x00038148 mov fp, r2 |
0x0003814a ldr r2, [sp, 0x20] | r2 = var_20h;
0x0003814c ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x0003814e str r1, [sp, 0x14] | s2 = r1;
0x00038150 cmp r2, 0 |
| if (r2 == 0) {
0x00038152 beq 0x380f0 | goto label_15;
| }
| label_42:
0x00038154 ldrd r2, r4, [sp, 0x14] | __asm ("ldrd r2, r4, [s2]");
0x00038158 add r4, r2 | r4 += r2;
0x0003815a b 0x380f0 | goto label_15;
| label_30:
0x0003815c mov r3, r7 | r3 = r7;
0x0003815e movs r4, 0 | r4 = 0;
0x00038160 subs r7, 1 | r7--;
0x00038162 b 0x37f28 | goto label_12;
| label_46:
0x00038164 strb r3, [r6] | *(r6) = r3;
0x00038166 mov r7, r2 | r7 = r2;
0x00038168 ldrb r3, [r0] | r3 = *(r0);
0x0003816a movs r2, 1 | r2 = 1;
0x0003816c str r2, [sp, 0x20] | var_20h = r2;
0x0003816e cmp r3, 0 |
| if (r3 != 0) {
0x00038170 bne.w 0x37e0a | goto label_2;
| }
0x00038174 b 0x37ea2 | goto label_3;
| label_47:
0x00038176 subs r7, 1 | r7--;
0x00038178 cmp r7, r6 |
| if (r7 < r6) {
0x0003817a bls 0x38122 | goto label_16;
| }
0x0003817c mov r2, r7 | r2 = r7;
| label_17:
0x0003817e ldrb r1, [r2, -0x1] | r1 = *((r2 - 0x1));
0x00038182 mov r7, r2 | r7 = r2;
0x00038184 subs r2, 1 | r2--;
0x00038186 cmp r1, 0x2f |
| if (r1 == 0x2f) {
0x00038188 beq 0x38122 | goto label_16;
| }
0x0003818a cmp r6, r2 |
| if (r6 != r2) {
0x0003818c bne 0x3817e | goto label_17;
| }
0x0003818e mov r7, r6 | r7 = r6;
0x00038190 b 0x38122 | goto label_16;
| label_40:
0x00038192 ldr r3, [pc, 0x14] |
0x00038194 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x00038198 movs r1, 0x28 | r1 = 0x28;
0x0003819a movs r4, 1 | r4 = 1;
0x0003819c add r3, pc |
0x0003819e ldr r3, [r3] | r3 = *(0x7034a);
0x000381a0 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000381a2 adds r3, r7, 1 | r3 = r7 + 1;
0x000381a4 b 0x37f28 | goto label_12;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libc.so.6 @ 0xae0d4 */
| #include <stdint.h>
|
; (fcn) fcn.000ae0d4 () | void fcn_000ae0d4 (int16_t arg_1a0h, int16_t arg_1c8h, int16_t arg_220h, int16_t arg_2b8h, int16_t arg_358h) {
| int16_t var_0h;
| int16_t var_4h;
| char * dest;
0x000ae0d4 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000ae0d8 sub sp, 0x1c |
0x000ae0da ldr r4, [pc, 0x108] |
0x000ae0dc add r4, pc | r4 = 0x15c2c6;
0x000ae0de ldr r0, [r4] | r0 = GLIBC_2.4;
| if (r0 == 0) {
0x000ae0e0 cbz r0, 0xae112 | goto label_2;
| }
0x000ae0e2 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x000ae0e4 cmp r1, 0 |
| if (r1 == 0) {
0x000ae0e6 beq 0xae1ca | goto label_3;
| }
0x000ae0e8 orr r1, r1, 0x80000 | r1 |= 0x80000;
0x000ae0ec movs r2, 0 | r2 = 0;
0x000ae0ee bl 0xae060 | r0 = socket (r0, r1, r2);
0x000ae0f2 adds r1, r0, 1 | r1 = r0 + 1;
0x000ae0f4 beq 0xae0fc |
| while (r3 != 0x61) {
0x000ae0f6 add sp, 0x1c |
0x000ae0f8 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x000ae0fc ldr r3, [pc, 0xdc] |
0x000ae0fe mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000ae102 add r3, pc |
0x000ae104 ldr r3, [r3] | r3 = GLIBC_2.4;
0x000ae106 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x000ae108 cmp r3, 0x61 |
0x000ae10a bne 0xae0f6 |
| }
0x000ae10c movs r3, 0 | r3 = 0;
0x000ae10e strd r3, r3, [r4] | __asm ("strd r3, r3, [r4]");
| label_2:
0x000ae112 ldr r0, [pc, 0xd4] |
0x000ae114 movs r1, 4 | r1 = 4;
0x000ae116 ldr r5, [pc, 0xd4] |
0x000ae118 mov.w r8, 2 | r8 = 2;
0x000ae11c movs r7, 5 | r7 = 5;
0x000ae11e movt r8, 8 | r8 = (r8 & 0xFFFF) | 0x80000;
0x000ae122 add r0, pc | r0 = 0x15c310;
0x000ae124 movt r7, 8 | r7 = (r7 & 0xFFFF) | 0x80000;
0x000ae128 bl 0x9f914 | access (r0, r1);
0x000ae12c ldr r3, [pc, 0xc0] |
0x000ae12e mov r6, r0 | r6 = r0;
0x000ae130 add r5, pc | r5 = 0x15c322;
0x000ae132 mov sl, sp | sl = sp;
0x000ae134 adds r4, r5, 4 | r4 = r5 + 4;
0x000ae136 adds r5, 0xe0 | r5 += 0xe0;
0x000ae138 add r3, pc | r3 = 0x15c32c;
0x000ae13a ldm.w r3, {r0, r1} | r0 = *(r3);
| r1 = *((r3 + 4));
0x000ae13e strh.w r1, [sp, 4] | var_4h = r1;
0x000ae142 lsrs r1, r1, 0x10 | r1 >>= 0x10;
0x000ae144 str r0, [sp] | *(sp) = r0;
0x000ae146 strb.w r1, [sp, 6] | dest = r1;
0x000ae14a b 0xae182 |
| while (r2 == r6) {
| label_0:
0x000ae14c ldr fp, [r4, -0x4] | fp = *((r4 - 0x4));
0x000ae150 movs r2, 0 | r2 = 0;
0x000ae152 cmp.w fp, 9 |
0x000ae156 it ne |
| if (fp != 9) {
0x000ae158 cmpne fp, 6 | __asm ("cmpne fp, 6");
| }
0x000ae15c mov r0, fp | r0 = fp;
0x000ae15e ite eq |
| if (fp != 9) {
0x000ae160 moveq r3, 1 | r3 = 1;
| }
| if (fp == 9) {
0x000ae162 movne r3, 0 | r3 = 0;
| }
0x000ae164 cmp r3, r2 |
0x000ae166 itete eq |
| if (r3 != r2) {
0x000ae168 moveq r1, r8 | r1 = r8;
| }
| if (r3 == r2) {
0x000ae16a movne r1, r7 | r1 = r7;
| }
| if (r3 != r2) {
0x000ae16c moveq sb, 2 | sb = 2;
| }
| if (r3 != r2) {
0x000ae170 mov.w sb, 5 | sb = 5;
| }
0x000ae174 bl 0xae060 | r0 = socket (r0, r1, r2);
0x000ae178 adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 != r0) {
0x000ae17a bne 0xae1bc | goto label_4;
| }
| label_1:
0x000ae17c adds r4, 0x14 | r4 += 0x14;
0x000ae17e cmp r4, r5 |
| if (r4 == r5) {
0x000ae180 beq 0xae1a4 | goto label_5;
| }
0x000ae182 adds r2, r6, 1 | r2 = r6 + 1;
0x000ae184 beq 0xae14c |
| }
0x000ae186 ldrb r3, [r4] | r3 = *(r4);
0x000ae188 cmp r3, 0 |
| if (r3 == 0) {
0x000ae18a beq 0xae14c | goto label_0;
| }
0x000ae18c mov r1, r4 | r1 = r4;
0x000ae18e add.w r0, sp, 6 | r0 += dest;
0x000ae192 bl 0x6a480 | strcpy (r0, r1)
0x000ae196 movs r1, 4 | r1 = 4;
0x000ae198 mov r0, sl | r0 = sl;
0x000ae19a bl 0x9f914 | access (r0, r1);
0x000ae19e adds r0, 1 | r0++;
| if (r0 != 1) {
0x000ae1a0 bne 0xae14c | goto label_0;
| }
0x000ae1a2 b 0xae17c | goto label_1;
| label_5:
0x000ae1a4 ldr r3, [pc, 0x38] |
0x000ae1a6 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000ae1aa movs r1, 2 | r1 = 2;
0x000ae1ac mov.w r0, -1 | r0 = -1;
0x000ae1b0 add r3, pc |
0x000ae1b2 ldr r3, [r3] | r3 = GLIBC_2.4;
0x000ae1b4 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000ae1b6 add sp, 0x1c |
0x000ae1b8 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_4:
0x000ae1bc ldr r3, [pc, 0x34] |
0x000ae1be add r3, pc | r3 = 0x15c3b6;
0x000ae1c0 invalid |
| if (r0 == 0) {
0x000ae1c2 cbnz r0, 0xae1c6 |
0x000ae1c4 add sp, 0x1c |
| }
0x000ae1c6 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x000ae1ca ldr r3, [pc, 0x2c] | r3 = *(0xae1fa);
0x000ae1cc movs r2, 0x3f | r2 = 0x3f;
0x000ae1ce ldr r1, [pc, 0x2c] |
0x000ae1d0 ldr r0, [pc, 0x2c] |
0x000ae1d2 add r3, pc | r3 += pc;
0x000ae1d4 add r1, pc | r1 = 0x15c3d6;
0x000ae1d6 add r0, pc |
0x000ae1d8 bl 0x2b2bc | assert_fail ();
0x000ae1dc ldc2l p0, c0, [r2, 0x14] | __asm ("ldc2l p0, c0, [r2, 0x14]");
0x000ae1e0 stc2 p0, c0, [r4, -0x14]! | __asm ("stc2 p0, c0, [r4, -0x14]!");
0x000ae1e4 add r0, pc | r0 = 0x20a5c2;
0x000ae1e6 movs r6, r0 | r6 = r0;
0x000ae1e8 str r2, [sp, 0x1c8] | *(arg_1c8h) = r2;
0x000ae1ea movs r4, r0 | r4 = r0;
0x000ae1ec asrs r0, r6, 0x16 | r0 = r6 >> 0x16;
0x000ae1ee movs r4, r0 | r4 = r0;
0x000ae1f0 str r2, [sp, 0x1a0] | *(arg_1a0h) = r2;
0x000ae1f2 movs r4, r0 | r4 = r0;
0x000ae1f4 bics r6, r2 | __asm ("bics r6, r2");
0x000ae1f6 movs r6, r0 | r6 = r0;
0x000ae1f8 str r1, [sp, 0x358] | *(arg_358h) = r1;
0x000ae1fa movs r4, r0 | r4 = r0;
0x000ae1fc str r1, [sp, 0x220] | *(arg_220h) = r1;
0x000ae1fe movs r4, r0 | r4 = r0;
0x000ae200 str r1, [sp, 0x2b8] | *(arg_2b8h) = r1;
0x000ae202 movs r4, r0 | r4 = 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/libc.so.6 @ 0xc81a4 */
| #include <stdint.h>
|
; (fcn) fcn.000c81a4 () | void fcn_000c81a4 (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 arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_4h;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x000c81a4 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000c81a8 mov r7, r2 | r7 = r2;
0x000c81aa ldrb r2, [r1] | r2 = *(r1);
0x000c81ac mov r4, r3 | r4 = r3;
0x000c81ae sub sp, 0xc |
0x000c81b0 mov r6, r1 | r6 = r1;
0x000c81b2 ldr.w r8, [sp, 0x30] | r8 = *(arg_30h);
0x000c81b6 sub.w r3, r2, 0x30 | r3 = r2 - 0x30;
0x000c81ba cmp r3, 9 |
| if (r3 >= 9) {
0x000c81bc bls 0xc81e0 |
0x000c81be ldr r3, [pc, 0x250] |
0x000c81c0 mrc p15, 0, r1, c13, c0, 3 | __asm ("mrc p15, 0, r1, c13, c0, 3");
0x000c81c4 add r3, pc |
0x000c81c6 ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c81c8 ldr r3, [r1, r3] | r3 = *((r1 + r3));
0x000c81ca ldrh.w r3, [r3, r2, lsl 1] | offset_0 = r2 << 1;
| r3 = *((r3 + offset_0));
0x000c81ce ubfx r3, r3, 0xc, 1 | r3 = (r3 >> 0xc) & ((1 << 1) - 1);
0x000c81d2 cmp r2, 0x3a |
0x000c81d4 it eq |
| if (r2 != 0x3a) {
0x000c81d6 orreq r3, r3, 1 | r3 |= 1;
| }
0x000c81da cmp r3, 0 |
| if (r3 == 0) {
0x000c81dc beq.w 0xc832e | goto label_7;
| }
| }
0x000c81e0 ldr r3, [sp, 0x40] | r3 = *(arg_40h);
0x000c81e2 mov r0, r6 | r0 = r6;
0x000c81e4 cmp r3, 0xa |
0x000c81e6 itett ne |
| if (r3 == 0xa) {
0x000c81e8 movne r3, 2 | r3 = 2;
| }
| if (r3 != 0xa) {
0x000c81ea moveq r5, 0x10 | r5 = 0x10;
| }
| if (r3 == 0xa) {
0x000c81ec movne r5, 4 | r5 = 4;
| }
| if (r3 == 0xa) {
0x000c81ee strne r3, [sp, 0x40] | *(arg_40h) = r3;
| }
0x000c81f0 bl 0x6a8c0 | r0 = strlen ();
0x000c81f4 add.w r2, r0, 0x1d | r2 = r0 + 0x1d;
0x000c81f8 cmp.w r8, 0 |
| if (r8 == 0) {
0x000c81fc beq.w 0xc8336 | goto label_8;
| }
0x000c8200 ldr.w r1, [r8] | r1 = *(r8);
0x000c8204 ldr r3, [r4] | r3 = *(r4);
0x000c8206 cmp r1, r2 |
| if (r1 <= r2) {
0x000c8208 blo.w 0xc8340 | goto label_9;
| }
| label_1:
0x000c820c mov r0, r3 | r0 = r3;
0x000c820e movs r1, 0 | r1 = 0;
0x000c8210 blx 0x6b880 | memset (r0, r1, r2);
0x000c8214 ldr.w sb, [r4] | sb = *(r4);
0x000c8218 ldrb r4, [r6] | r4 = *(r6);
0x000c821a add.w r3, sb, 0x10 | r3 = sb + 0x10;
0x000c821c lsls r0, r2, 0xc | r0 = r2 << 0xc;
0x000c821e add.w sl, sb, 0x18 | sl = sb + 0x18;
0x000c8222 str r3, [sp] | *(sp) = r3;
0x000c8224 sub.w r3, r4, 0x30 | r3 = r4 - 0x30;
0x000c8228 cmp r3, 9 |
0x000c822a add.w fp, sb, 0x1c |
| if (r3 > 9) {
0x000c822e bhi 0xc8286 | goto label_10;
| }
0x000c8230 mov r1, r6 | r1 = r6;
| if (r4 != 0) {
0x000c8232 cbnz r4, 0xc823e | goto label_11;
| }
0x000c8234 b 0xc824a | goto label_12;
| do {
0x000c8236 cmp r3, 0x2e |
0x000c8238 it ne |
| if (r3 != 0x2e) {
0x000c823a cmpne r2, 9 | __asm ("cmpne r2, 9");
| }
| if (r3 > 0x2e) {
0x000c823c bhi 0xc8286 | goto label_10;
| }
| label_11:
0x000c823e ldrb r3, [r1, 1]! | r3 = *((r1 += 1));
0x000c8242 sub.w r2, r3, 0x30 | r2 = r3 - 0x30;
0x000c8246 cmp r3, 0 |
0x000c8248 bne 0xc8236 |
| } while (r3 != 0);
| label_12:
0x000c824a ldrb r3, [r1, -0x1] | r3 = *((r1 - 0x1));
0x000c824e cmp r3, 0x2e |
| if (r3 == 0x2e) {
0x000c8250 beq 0xc8286 | goto label_10;
| }
0x000c8252 ldr r3, [sp, 0x40] | r3 = *(arg_40h);
0x000c8254 cmp r3, 2 |
| if (r3 == 2) {
0x000c8256 beq.w 0xc8388 | goto label_13;
| }
0x000c825a mov r2, sb | r2 = sb;
0x000c825c mov r1, r6 | r1 = r6;
0x000c825e movs r0, 0xa | r0 = 0xa;
0x000c8260 bl 0xc2168 | r0 = inet_pton ();
0x000c8264 cmp r0, 0 |
| if (r0 > 0) {
0x000c8266 bgt.w 0xc8396 | goto label_14;
| }
| do {
| label_0:
0x000c826a ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x000c826c movs r3, 1 | r3 = 1;
0x000c826e str r3, [r2] | *(r2) = r3;
0x000c8270 cmp.w r8, 0 |
| if (r8 == 0) {
0x000c8274 beq.w 0xc83cc | goto label_15;
| }
| label_6:
0x000c8278 ldr r2, [sp, 0x38] | r2 = *(arg_38h);
0x000c827a movs r3, 0 | r3 = 0;
0x000c827c movs r0, 1 | r0 = 1;
0x000c827e str r3, [r2] | *(r2) = r3;
0x000c8280 add sp, 0xc |
0x000c8282 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_10:
0x000c8286 ldr r3, [pc, 0x18c] |
0x000c8288 mrc p15, 0, r1, c13, c0, 3 | __asm ("mrc p15, 0, r1, c13, c0, 3");
0x000c828c add r3, pc |
0x000c828e ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c8290 ldr r3, [r1, r3] | r3 = *((r1 + r3));
0x000c8292 ldrh.w r5, [r3, r4, lsl 1] | offset_1 = r4 << 1;
| r5 = *((r3 + offset_1));
0x000c8296 lsls r2, r5, 0x13 | r2 = r5 << 0x13;
| if (r2 >= r5) {
0x000c8298 bpl 0xc832a | goto label_16;
| }
0x000c829a movs r1, 0x3a | r1 = 0x3a;
0x000c829c mov r0, r6 | r0 = r6;
0x000c829e str r3, [sp, 4] | var_4h = r3;
0x000c82a0 bl 0x6a0a0 | strchr ();
0x000c82a4 ldr r3, [sp, 4] | r3 = var_4h;
0x000c82a6 cmp r0, 0 |
| if (r0 == 0) {
0x000c82a8 beq 0xc832a | goto label_16;
| }
0x000c82aa ldr r2, [sp, 0x40] | r2 = *(arg_40h);
0x000c82ac cmp r2, 0xa |
0x000c82ae bne 0xc826a |
| } while (r2 != 0xa);
0x000c82b0 cmp r4, 0 |
| if (r4 == 0) {
0x000c82b2 beq.w 0xc83d6 | goto label_17;
| }
| label_2:
0x000c82b6 mov r1, r6 | r1 = r6;
0x000c82b8 b 0xc82be |
| while (r4 != 0) {
0x000c82ba ldrh.w r5, [r3, r4, lsl 1] | offset_2 = r4 << 1;
| r5 = *((r3 + offset_2));
0x000c82be cmp r4, 0x3a |
0x000c82c0 it ne |
| if (r4 != 0x3a) {
0x000c82c2 cmpne r4, 0x2e | __asm ("cmpne r4, 0x2e");
| }
0x000c82c4 eor r5, r5, 0x1000 | r5 ^= 0x1000;
0x000c82c8 ite ne |
| if (r4 == 0x3a) {
0x000c82ca movne r4, 1 | r4 = 1;
| }
| if (r4 != 0x3a) {
0x000c82cc moveq r4, 0 | r4 = 0;
| }
0x000c82ce ands.w r4, r4, r5, lsr 12 | r4 &= (r5 >> 12);
| if (r4 != r4) {
0x000c82d2 bne 0xc832e | goto label_7;
| }
0x000c82d4 ldrb r4, [r1, 1]! | r4 = *((r1 += 1));
0x000c82d8 cmp r4, 0 |
0x000c82da bne 0xc82ba |
| }
| label_5:
0x000c82dc ldrb r3, [r1, -0x1] | r3 = *((r1 - 0x1));
0x000c82e0 cmp r3, 0x2e |
| if (r3 == 0x2e) {
0x000c82e2 beq 0xc832e | goto label_7;
| }
0x000c82e4 mov r2, sb | r2 = sb;
0x000c82e6 mov r1, r6 | r1 = r6;
0x000c82e8 movs r0, 0xa | r0 = 0xa;
0x000c82ea bl 0xc2168 | r0 = inet_pton ();
0x000c82ee cmp r0, 0 |
| if (r0 <= 0) {
0x000c82f0 ble 0xc826a | goto label_0;
| }
0x000c82f2 mov r1, r6 | r1 = r6;
0x000c82f4 mov r0, fp | r0 = fp;
0x000c82f6 bl 0x6a480 | strcpy (r0, r1)
0x000c82fa movs r3, 0 | r3 = 0;
0x000c82fc movs r2, 0xa | r2 = 0xa;
0x000c82fe str r0, [r7] | *(r7) = r0;
0x000c8300 str.w r3, [sb, 0x18] | __asm ("str.w r3, [sb, 0x18]");
0x000c8304 str.w sl, [r7, 4] | __asm ("str.w sl, [r7, 4]");
0x000c8308 strd sb, r3, [sb, 0x10] | __asm ("strd sb, r3, [sb, 0x10]");
0x000c830c str r2, [r7, 8] | *((r7 + 8)) = r2;
0x000c830e movs r2, 0x10 | r2 = 0x10;
0x000c8310 str r2, [r7, 0xc] | *((r7 + 0xc)) = r2;
0x000c8312 ldr r1, [sp] | r1 = *(sp);
0x000c8314 ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x000c8316 str r1, [r7, 0x10] | *((r7 + 0x10)) = r1;
0x000c8318 str r3, [r2] | *(r2) = r3;
0x000c831a cmp.w r8, 0 |
| if (r8 != 0) {
0x000c831e bne 0xc83c4 | goto label_18;
| }
| label_4:
0x000c8320 ldr r2, [sp, 0x3c] | r2 = *(arg_3ch);
0x000c8322 movs r3, 1 | r3 = 1;
0x000c8324 mov r0, r3 | r0 = r3;
0x000c8326 str r3, [r2] | *(r2) = r3;
0x000c8328 b 0xc8330 | goto label_3;
| label_16:
0x000c832a cmp r4, 0x3a |
| if (r4 != 0x3a) {
0x000c832c beq 0xc835a |
| label_7:
0x000c832e movs r0, 0 | r0 = 0;
| label_3:
0x000c8330 add sp, 0xc |
0x000c8332 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_8:
0x000c8336 ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x000c8338 cmp r2, r3 |
| if (r2 > r3) {
0x000c833a bhi 0xc8362 | goto label_19;
| }
0x000c833c ldr r3, [r4] | r3 = *(r4);
0x000c833e b 0xc820c | goto label_1;
| label_9:
0x000c8340 mov r0, r3 | r0 = r3;
0x000c8342 mov r1, r2 | r1 = r2;
0x000c8344 str.w r2, [r8] | __asm ("str.w r2, [r8]");
0x000c8348 str r2, [sp] | *(sp) = r2;
0x000c834a blx 0x212ac | fcn_000212ac ();
0x000c834e ldr r2, [sp] | r2 = *(sp);
0x000c8350 mov r3, r0 | r3 = r0;
0x000c8352 cmp r0, 0 |
| if (r0 == 0) {
0x000c8354 beq 0xc83da | goto label_20;
| }
0x000c8356 str r0, [r4] | *(r4) = r0;
0x000c8358 b 0xc820c | goto label_1;
| }
0x000c835a ldr r2, [sp, 0x40] | r2 = *(arg_40h);
0x000c835c cmp r2, 0xa |
| if (r2 == 0xa) {
0x000c835e beq 0xc82b6 | goto label_2;
| }
0x000c8360 b 0xc826a | goto label_0;
| label_19:
0x000c8362 ldr r2, [sp, 0x3c] | r2 = *(arg_3ch);
0x000c8364 mvn r3, 1 | r3 = ~1;
0x000c8368 str r3, [r2] | *(r2) = r3;
0x000c836a ldr r3, [sp, 0x44] | r3 = *(arg_44h);
| if (r3 != 0) {
0x000c836c cbz r3, 0xc8376 |
0x000c836e ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x000c8370 mov.w r3, -1 | r3 = -1;
0x000c8374 str r3, [r2] | *(r2) = r3;
| }
0x000c8376 ldr r3, [pc, 0xa0] |
0x000c8378 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000c837c movs r1, 0x22 | r1 = 0x22;
0x000c837e movs r0, 1 | r0 = 1;
0x000c8380 add r3, pc |
0x000c8382 ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c8384 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000c8386 b 0xc8330 | goto label_3;
| label_13:
0x000c8388 mov r1, sb | r1 = sb;
0x000c838a mov r0, r6 | r0 = r6;
0x000c838c bl 0xc1cd0 | r0 = inet_aton_exact ();
0x000c8390 cmp r0, 0 |
| if (r0 == 0) {
0x000c8392 beq.w 0xc826a | goto label_0;
| }
| label_14:
0x000c8396 mov r1, r6 | r1 = r6;
0x000c8398 mov r0, fp | r0 = fp;
0x000c839a bl 0x6a480 | strcpy (r0, r1)
0x000c839e ldr r2, [sp] | r2 = *(sp);
0x000c83a0 movs r3, 0 | r3 = 0;
0x000c83a2 str r0, [r7] | *(r7) = r0;
0x000c83a4 str.w r3, [sb, 0x18] | __asm ("str.w r3, [sb, 0x18]");
0x000c83a8 str.w sl, [r7, 4] | __asm ("str.w sl, [r7, 4]");
0x000c83ac strd sb, r3, [sb, 0x10] | __asm ("strd sb, r3, [sb, 0x10]");
0x000c83b0 str r2, [r7, 0x10] | *((r7 + 0x10)) = r2;
0x000c83b2 ldr r2, [sp, 0x40] | r2 = *(arg_40h);
0x000c83b4 strd r2, r5, [r7, 8] | __asm ("strd r2, r5, [r7, 8]");
0x000c83b8 ldr r2, [sp, 0x44] | r2 = *(arg_44h);
| if (r2 != 0) {
0x000c83ba cbz r2, 0xc83be |
0x000c83bc str r3, [r2] | *(r2) = r3;
| }
0x000c83be cmp.w r8, 0 |
| if (r8 == 0) {
0x000c83c2 beq 0xc8320 | goto label_4;
| }
| label_18:
0x000c83c4 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x000c83c6 movs r0, 1 | r0 = 1;
0x000c83c8 str r7, [r3] | *(r3) = r7;
0x000c83ca b 0xc8330 | goto label_3;
| label_15:
0x000c83cc ldr r2, [sp, 0x3c] | r2 = *(arg_3ch);
0x000c83ce movs r3, 0 | r3 = 0;
0x000c83d0 movs r0, 1 | r0 = 1;
0x000c83d2 str r3, [r2] | *(r2) = r3;
0x000c83d4 b 0xc8330 | goto label_3;
| label_17:
0x000c83d6 mov r1, r6 | r1 = r6;
0x000c83d8 b 0xc82dc | goto label_5;
| label_20:
0x000c83da ldr r2, [pc, 0x40] |
0x000c83dc mrc p15, 0, r5, c13, c0, 3 | __asm ("mrc p15, 0, r5, c13, c0, 3");
0x000c83e0 str r0, [sp] | *(sp) = r0;
0x000c83e2 ldr r0, [r4] | r0 = *(r4);
0x000c83e4 add r2, pc |
0x000c83e6 ldr r2, [r2] | r2 = GLIBC_2.4;
0x000c83e8 ldr r6, [r5, r2] | r6 = *((r5 + r2));
0x000c83ea blx 0x212d4 | fcn_000212d4 ();
0x000c83ee ldr r3, [sp] | r3 = *(sp);
0x000c83f0 ldr r2, [pc, 0x2c] |
0x000c83f2 str r3, [r4] | *(r4) = r3;
0x000c83f4 str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x000c83f8 add r2, pc |
0x000c83fa ldr r2, [r2] | r2 = GLIBC_2.4;
0x000c83fc ldr r3, [sp, 0x44] | r3 = *(arg_44h);
0x000c83fe str r6, [r5, r2] | *((r5 + r2)) = r6;
0x000c8400 cmp r3, 0 |
| if (r3 == 0) {
0x000c8402 beq.w 0xc8278 | goto label_6;
| }
0x000c8406 ldr r2, [sp, 0x44] | r2 = *(arg_44h);
0x000c8408 mov.w r3, -1 | r3 = -1;
0x000c840c str r3, [r2] | *(r2) = r3;
0x000c840e b 0xc8278 | 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/libc.so.6 @ 0xbaad0 */
| #include <stdint.h>
|
; (fcn) sym.ether_ntohost () | void ether_ntohost (int16_t arg_24h, int16_t arg_30h, char * arg1, int16_t arg2) {
| int16_t var_0h;
| int16_t var_ch;
| int16_t var_10h;
| char * dest;
| int16_t var_1ch;
| int16_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x000baad0 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000baad4 subw sp, sp, 0x434 | __asm ("subw sp, sp, aav.0x000000ff");
0x000baad8 ldr r6, [pc, 0x84] |
0x000baada add r4, sp, 0x20 | r4 += var_20h;
0x000baadc add r7, sp, 0x1c | r7 += var_1ch;
0x000baade mov r5, r1 | r5 = r1;
0x000baae0 str r0, [sp, 0x14] | dest = r0;
0x000baae2 mov r3, r4 | r3 = r4;
0x000baae4 add r6, pc | r6 = 0x175648;
0x000baae6 movs r2, 0 | r2 = 0;
0x000baae8 mov r1, r6 | r1 = r6;
0x000baaea mov r0, r7 | r0 = r7;
0x000baaec bl 0xc869c | fcn_000c869c (r0, r1, r2, r3);
0x000baaf0 str r0, [sp, 0x10] | var_10h = r0;
| if (r0 != 0) {
0x000baaf2 cbnz r0, 0xbab36 | goto label_0;
| }
0x000baaf4 add.w sb, sp, 0x30 | sb += arg_30h;
0x000baaf8 add.w r8, sp, 0x24 | r8 += arg_24h;
0x000baafc mrc p15, 0, sl, c13, c0, 3 | __asm ("mrc p15, 0, sl, c13, c0, 3");
0x000bab00 str r5, [sp, 0xc] | var_ch = r5;
| do {
0x000bab02 ldr r2, [pc, 0x58] |
0x000bab04 mov.w r3, 0x400 | r3 = 0x400;
0x000bab08 mov r1, r8 | r1 = r8;
0x000bab0a ldr r0, [sp, 0xc] | r0 = var_ch;
0x000bab0c add r2, pc |
0x000bab0e ldr r2, [r2] | r2 = GLIBC_2.4;
0x000bab10 add r2, sl | r2 += sl;
0x000bab12 str r2, [sp] | *(sp) = r2;
0x000bab14 mov r2, sb | r2 = sb;
0x000bab16 ldr r5, [r4] | r5 = *(r4);
0x000bab18 blx r5 | uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x000bab1a movs r2, 0 | r2 = 0;
0x000bab1c mov fp, r0 |
0x000bab1e strd r0, r2, [sp] | __asm ("strd r0, r2, [sp]");
0x000bab22 mov r3, r4 | r3 = r4;
0x000bab24 mov r1, r6 | r1 = r6;
0x000bab26 mov r0, r7 | r0 = r7;
0x000bab28 bl 0xc7cd0 | r0 = nss_next2 ();
0x000bab2c cmp r0, 0 |
0x000bab2e beq 0xbab02 |
| } while (r0 == 0);
0x000bab30 cmp.w fp, 1 |
| if (fp != 1) {
0x000bab34 beq 0xbab46 |
| label_0:
0x000bab36 mov.w r3, -1 | r3 = -1;
0x000bab3a str r3, [sp, 0x10] | var_10h = r3;
0x000bab3c ldr r0, [sp, 0x10] | r0 = var_10h;
0x000bab3e addw sp, sp, 0x434 | __asm ("addw sp, var_0h");
0x000bab42 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x000bab46 ldr.w r1, [r8] | r1 = *(r8);
0x000bab4a ldr r0, [sp, 0x14] | r0 = dest;
0x000bab4c bl 0x6a480 | strcpy (r0, r1)
0x000bab50 ldr r0, [sp, 0x10] | r0 = var_10h;
0x000bab52 addw sp, sp, 0x434 | __asm ("addw sp, var_0h");
0x000bab56 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/libc.so.6 @ 0xa0654 */
| #include <stdint.h>
|
; (fcn) sym.getwd () | void getwd (int16_t arg1, int16_t arg3) {
| char * src;
| int16_t var_1000h;
| r0 = arg1;
| r2 = arg3;
0x000a0654 push {r4, r5, r6, lr} |
0x000a0656 mov r5, r0 | r5 = r0;
0x000a0658 sub.w sp, sp, 0x1000 |
| if (r0 == 0) {
0x000a065c cbz r0, 0xa0680 | goto label_0;
| }
0x000a065e mov r6, sp | r6 = sp;
0x000a0660 mov.w r1, 0x1000 | r1 = 0x1000;
0x000a0664 mov r0, r6 | r0 = r6;
0x000a0666 bl 0xa0128 | r0 = getcwd ();
0x000a066a mov r4, r0 | r4 = r0;
| if (r0 == 0) {
0x000a066c cbz r0, 0xa0698 | goto label_1;
| }
0x000a066e mov r1, r6 | r1 = r6;
0x000a0670 mov r0, r5 | r0 = r5;
0x000a0672 bl 0x6a480 | r0 = strcpy (r0, r1)
0x000a0676 mov r4, r0 | r4 = r0;
| do {
0x000a0678 mov r0, r4 | r0 = r4;
0x000a067a add.w sp, sp, 0x1000 |
0x000a067e pop {r4, r5, r6, pc} |
| label_0:
0x000a0680 ldr r3, [pc, 0x2c] |
0x000a0682 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000a0686 movs r1, 0x16 | r1 = 0x16;
0x000a0688 mov r4, r0 | r4 = r0;
0x000a068a mov r0, r4 | r0 = r4;
0x000a068c add r3, pc |
0x000a068e ldr r3, [r3] | r3 = GLIBC_2.4;
0x000a0690 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000a0692 add.w sp, sp, 0x1000 |
0x000a0696 pop {r4, r5, r6, pc} |
| label_1:
0x000a0698 ldr r3, [pc, 0x18] |
0x000a069a mrc p15, 0, r0, c13, c0, 3 | __asm ("mrc p15, 0, r0, c13, c0, 3");
0x000a069e mov.w r2, 0x400 | r2 = 0x400;
0x000a06a2 mov r1, r5 | r1 = r5;
0x000a06a4 add r3, pc |
0x000a06a6 ldr r3, [r3] | r3 = GLIBC_2.4;
0x000a06a8 ldr r0, [r0, r3] | r0 = *((r0 + r3));
0x000a06aa bl 0x6a85c | strerror_r ();
0x000a06ae b 0xa0678 |
| } 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/libc.so.6 @ 0xc1d24 */
| #include <stdint.h>
|
; (fcn) sym.inet_ntop () | void inet_ntop (uint32_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_ch;
| char * dest;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_24h;
| void * s;
| int16_t var_4h_2;
| int16_t var_3ch;
| char * src;
| int16_t var_0h_2;
| int16_t var_78h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x000c1d24 cmp r0, 2 |
0x000c1d26 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000c1d2a sub sp, 0x7c |
0x000c1d2c mov r7, r1 | r7 = r1;
0x000c1d2e strd r3, r2, [sp, 0xc] | __asm ("strd r3, r2, [var_ch]");
| if (r0 != 2) {
0x000c1d32 beq 0xc1d4e |
0x000c1d34 cmp r0, 0xa |
| if (r0 == 0xa) {
0x000c1d36 beq 0xc1d7c | goto label_9;
| }
0x000c1d38 ldr r3, [pc, 0x208] |
0x000c1d3a movs r0, 0 | r0 = 0;
0x000c1d3c mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000c1d40 movs r1, 0x61 | r1 = 0x61;
0x000c1d42 add r3, pc |
0x000c1d44 ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c1d46 str r1, [r2, r3] | *((r2 + r3)) = r1;
| label_8:
0x000c1d48 add sp, 0x7c |
0x000c1d4a pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x000c1d4e ldrb r2, [r1, 3] | r2 = *((r1 + 3));
0x000c1d50 add r4, sp, 0x48 | r4 += src;
0x000c1d52 ldrb r3, [r1, 2] | r3 = *((r1 + 2));
0x000c1d54 mov r0, r4 | r0 = r4;
0x000c1d56 strd r3, r2, [sp] | __asm ("strd r3, r2, [sp]");
0x000c1d5a ldrb r3, [r1, 1] | r3 = *((r1 + 1));
0x000c1d5c ldrb r2, [r1] | r2 = *(r1);
0x000c1d5e ldr r1, [pc, 0x1f4] |
0x000c1d60 add r1, pc | r1 = 0x183cba;
0x000c1d62 bl 0x3ee9c | IO_sprintf ();
0x000c1d66 ldr r3, [sp, 0xc] | r3 = var_ch;
0x000c1d68 cmp r3, r0 |
| if (r3 < r0) {
0x000c1d6a bls.w 0xc1f10 | goto label_10;
| }
0x000c1d6e ldr r0, [sp, 0x10] | r0 = dest;
0x000c1d70 mov r1, r4 | r1 = r4;
0x000c1d72 bl 0x6a480 | strcpy (r0, r1)
0x000c1d76 add sp, 0x7c |
0x000c1d78 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_9:
0x000c1d7c add.w sb, sp, 0x28 | sb += s;
0x000c1d80 movs r2, 0x20 | r2 = 0x20;
0x000c1d82 movs r1, 0 | r1 = 0;
0x000c1d84 mov r0, sb | r0 = sb;
0x000c1d86 blx 0x6b880 | memset (r0, r1, r2);
0x000c1d8a adds r5, r7, 1 | r5 = r7 + 1;
0x000c1d8c movs r2, 0 | r2 = 0;
| do {
0x000c1d8e ldrb r0, [r7, r2] | r0 = *((r7 + r2));
0x000c1d90 asrs r3, r2, 1 | r3 = r2 >> 1;
0x000c1d92 ldrb r1, [r5, r2] | r1 = *((r5 + r2));
0x000c1d94 add r4, sp, 0x78 | r4 += var_78h;
0x000c1d96 adds r2, 2 | r2 += 2;
0x000c1d98 add.w r3, r4, r3, lsl 2 | r3 = r4 + (r3 << 2);
0x000c1d9c cmp r2, 0x10 |
0x000c1d9e orr.w r1, r1, r0, lsl 8 | r1 |= (r0 << 8);
0x000c1da2 str r1, [r3, -0x50] | s = r1;
0x000c1da6 bne 0xc1d8e |
| } while (r2 != 0x10);
0x000c1da8 mov.w r8, 0 | r8 = 0;
0x000c1dac mov.w r6, -1 | r6 = -1;
0x000c1db0 add r0, sp, 0x24 | r0 += var_24h;
0x000c1db2 mov r4, r8 | r4 = r8;
0x000c1db4 mov r1, r6 | r1 = r6;
0x000c1db6 mov r2, r8 | r2 = r8;
0x000c1db8 b 0xc1dcc |
| while (r3 == 0) {
0x000c1dba adds r3, r1, 1 | r3 = r1 + 1;
0x000c1dbc add.w r4, r4, 1 | r4++;
| if (r3 == r1) {
0x000c1dc0 bne 0xc1dc6 |
0x000c1dc2 mov r1, r2 | r1 = r2;
0x000c1dc4 movs r4, 1 | r4 = 1;
| }
| label_0:
0x000c1dc6 adds r2, 1 | r2++;
0x000c1dc8 cmp r2, 8 |
| if (r2 == 8) {
0x000c1dca beq 0xc1dfe | goto label_11;
| }
| label_1:
0x000c1dcc ldr r3, [r0, 4]! | r3 = s;
0x000c1dd0 cmp r3, 0 |
0x000c1dd2 beq 0xc1dba |
| }
0x000c1dd4 adds r5, r1, 1 | r5 = r1 + 1;
| if (r5 == r1) {
0x000c1dd6 beq 0xc1dc6 | goto label_0;
| }
0x000c1dd8 sub.w r3, r6, -1 | r3 = r6 - -1;
0x000c1ddc clz r3, r3 | r3 &= r3;
0x000c1de0 lsrs r3, r3, 5 | r3 >>= 5;
0x000c1de2 cmp r4, r8 |
0x000c1de4 it gt |
| if (r4 <= r8) {
0x000c1de6 orrgt r3, r3, 1 | r3 |= 1;
| }
0x000c1dea cmp r3, 0 |
| if (r3 == 0) {
0x000c1dec beq.w 0xc1efc | goto label_12;
| }
0x000c1df0 adds r2, 1 | r2++;
0x000c1df2 mov r6, r1 | r6 = r1;
0x000c1df4 cmp r2, 8 |
0x000c1df6 mov r8, r4 | r8 = r4;
0x000c1df8 mov.w r1, -1 | r1 = -1;
| if (r2 != 8) {
0x000c1dfc bne 0xc1dcc | goto label_1;
| }
| label_11:
0x000c1dfe adds r0, r1, 1 | r0 = r1 + 1;
| if (r0 == r1) {
0x000c1e00 beq 0xc1f02 | goto label_13;
| }
0x000c1e02 sub.w r2, r6, -1 | r2 = r6 - -1;
0x000c1e06 clz r2, r2 | r2 &= r2;
0x000c1e0a lsrs r2, r2, 5 | r2 >>= 5;
0x000c1e0c cmp r8, r4 |
0x000c1e0e it lt |
| if (r8 >= r4) {
0x000c1e10 orrlt r2, r2, 1 | r2 |= 1;
| }
0x000c1e14 cmp r2, 0 |
0x000c1e16 ite ne |
| if (r2 == 0) {
0x000c1e18 movne r8, r4 | r8 = r4;
| }
| if (r2 != 0) {
0x000c1e1a moveq r1, r6 | r1 = r6;
| }
| label_7:
0x000c1e1c cmp.w r8, 2 |
0x000c1e20 iteet ge |
| if (r8 < 2) {
0x000c1e22 movge r6, r1 | r6 = r1;
| }
| if (r8 >= 2) {
0x000c1e24 movlt r6, -1 | r6 = -1;
| }
| if (r8 < 2) {
0x000c1e28 movge sl, 0 | sl = 0;
| }
| if (r8 >= 2) {
0x000c1e2c mov.w sl, 1 | sl = 1;
| }
| label_6:
0x000c1e30 ldr.w fp, [pc, 0x124] |
0x000c1e34 add r3, sp, 0x48 | r3 += src;
0x000c1e36 movs r5, 0 | r5 = 0;
0x000c1e38 mov r4, r3 | r4 = r3;
0x000c1e3a str r3, [sp, 0x14] | var_14h = r3;
0x000c1e3c add fp, pc | fp = 0x183d98;
| do {
0x000c1e3e cmp r6, r5 |
0x000c1e40 ite gt |
| if (r6 <= r5) {
0x000c1e42 movgt r3, 0 | r3 = 0;
| }
| if (r6 > r5) {
0x000c1e44 andle r3, sl, 1 | r3 = sl & 1;
| }
| if (r3 != 0) {
0x000c1e48 cbnz r3, 0xc1ea2 | goto label_14;
| }
| if (r5 != 0) {
| label_2:
0x000c1e4a cbz r5, 0xc1e5c |
0x000c1e4c cmp r6, 0 |
0x000c1e4e it eq |
| if (r6 == 0) {
0x000c1e50 cmpeq r5, 6 | __asm ("cmpeq r5, 6");
| }
0x000c1e52 mov.w r3, 0x3a | r3 = 0x3a;
0x000c1e56 strb r3, [r4], 1 | *(r4) = r3;
| r4++;
| if (r6 == 0) {
0x000c1e5a beq 0xc1eb6 | goto label_15;
| }
| }
| label_4:
0x000c1e5c mov r0, r4 | r0 = r4;
0x000c1e5e ldr.w r2, [sb] | r2 = *(sb);
0x000c1e62 mov r1, fp | r1 = fp;
0x000c1e64 bl 0x3ee9c | r0 = IO_sprintf ();
0x000c1e68 add r4, r0 | r4 += r0;
| label_3:
0x000c1e6a adds r5, 1 | r5++;
0x000c1e6c add.w sb, sb, 4 | sb += var_4h_2;
0x000c1e70 cmp r5, 8 |
0x000c1e72 bne 0xc1e3e |
| } while (r5 != 8);
0x000c1e74 adds r3, r6, 1 | r3 = r6 + 1;
| if (r3 != r6) {
0x000c1e76 beq 0xc1e84 |
| label_5:
0x000c1e78 add r6, r8 | r6 += r8;
0x000c1e7a cmp r6, 8 |
0x000c1e7c itt eq |
| if (r6 != 8) {
0x000c1e7e moveq r3, 0x3a | r3 = 0x3a;
| }
| if (r6 == 8) {
0x000c1e80 strbeq r3, [r4], 1 | *(r4) = r3;
| r4++;
| goto label_16;
| }
| }
| label_16:
0x000c1e84 ldr r3, [sp, 0x14] | r3 = var_14h;
0x000c1e86 movs r0, 0 | r0 = 0;
0x000c1e88 strb r0, [r4], 1 | *(r4) = r0;
| r4++;
0x000c1e8c subs r4, r4, r3 | r4 -= r3;
0x000c1e8e ldr r3, [sp, 0xc] | r3 = var_ch;
0x000c1e90 cmp r3, r4 |
| if (r3 <= r4) {
0x000c1e92 blo 0xc1f22 | goto label_17;
| }
0x000c1e94 ldrd r0, r1, [sp, 0x10] | __asm ("ldrd r0, r1, [dest]");
0x000c1e98 bl 0x6a480 | strcpy (r0, r1)
0x000c1e9c add sp, 0x7c |
0x000c1e9e pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_14:
0x000c1ea2 add.w r3, r6, r8 | r3 = r6 + r8;
0x000c1ea6 cmp r3, r5 |
| if (r3 <= r5) {
0x000c1ea8 ble 0xc1e4a | goto label_2;
| }
0x000c1eaa cmp r6, r5 |
0x000c1eac itt eq |
| if (r6 != r5) {
0x000c1eae moveq r3, 0x3a | r3 = 0x3a;
| }
| if (r6 != r5) {
0x000c1eb0 strbeq r3, [r4], 1 | *(r4) = r3;
| r4++;
| }
0x000c1eb4 b 0xc1e6a | goto label_3;
| label_15:
0x000c1eb6 cmp.w r8, 6 |
| if (r8 == 6) {
0x000c1eba beq 0xc1ecc | goto label_18;
| }
0x000c1ebc cmp.w r8, 5 |
| if (r8 != 5) {
0x000c1ec0 bne 0xc1e5c | goto label_4;
| }
0x000c1ec2 ldr r3, [sp, 0x3c] | r3 = var_3ch;
0x000c1ec4 movw r2, 0xffff | r2 = 0xffff;
0x000c1ec8 cmp r3, r2 |
| if (r3 != r2) {
0x000c1eca bne 0xc1e5c | goto label_4;
| }
| label_18:
0x000c1ecc ldrb r3, [r7, 0xf] | r3 = *((r7 + 0xf));
0x000c1ece add r5, sp, 0x18 | r5 += var_18h;
0x000c1ed0 ldr r1, [pc, 0x88] |
0x000c1ed2 mov r0, r5 | r0 = r5;
0x000c1ed4 str r3, [sp, 4] | var_4h = r3;
0x000c1ed6 ldrb r3, [r7, 0xe] | r3 = *((r7 + 0xe));
0x000c1ed8 add r1, pc | r1 = 0x183e38;
0x000c1eda str r3, [sp] | *(sp) = r3;
0x000c1edc ldrb r3, [r7, 0xd] | r3 = *((r7 + 0xd));
0x000c1ede ldrb r2, [r7, 0xc] | r2 = *((r7 + 0xc));
0x000c1ee0 bl 0x3ee9c | IO_sprintf ();
0x000c1ee4 ldr r3, [sp, 0x14] | r3 = var_14h;
0x000c1ee6 subs r3, r4, r3 | r3 = r4 - r3;
0x000c1ee8 rsb.w r3, r3, 0x2e | r3 = 0x2e - r3;
0x000c1eec cmp r3, r0 |
| if (r3 < r0) {
0x000c1eee bls 0xc1f32 | goto label_19;
| }
0x000c1ef0 mov r0, r4 | r0 = r4;
0x000c1ef2 mov r1, r5 | r1 = r5;
0x000c1ef4 bl 0x6a470 | r0 = stpcpy ();
0x000c1ef8 mov r4, r0 | r4 = r0;
0x000c1efa b 0xc1e78 | goto label_5;
| label_12:
0x000c1efc mov.w r1, -1 | r1 = -1;
0x000c1f00 b 0xc1dc6 | goto label_0;
| label_13:
0x000c1f02 adds r2, r6, 1 | r2 = r6 + 1;
0x000c1f04 it eq |
| if (r2 == r6) {
0x000c1f06 moveq sl, 0 | sl = 0;
| goto label_20;
| }
| if (r2 == r6) {
| label_20:
0x000c1f0a beq 0xc1e30 | goto label_6;
| }
0x000c1f0c mov r1, r6 | r1 = r6;
0x000c1f0e b 0xc1e1c | goto label_7;
| label_10:
0x000c1f10 ldr r3, [pc, 0x34] |
0x000c1f12 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000c1f16 movs r1, 0x1c | r1 = 0x1c;
0x000c1f18 movs r0, 0 | r0 = 0;
0x000c1f1a add r3, pc |
0x000c1f1c ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c1f1e str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000c1f20 b 0xc1d48 | goto label_8;
| label_17:
0x000c1f22 ldr r3, [pc, 0x28] |
0x000c1f24 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000c1f28 movs r1, 0x1c | r1 = 0x1c;
0x000c1f2a add r3, pc |
0x000c1f2c ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c1f2e str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000c1f30 b 0xc1d48 | goto label_8;
| label_19:
0x000c1f32 ldr r3, [pc, 0x1c] |
0x000c1f34 mrc p15, 0, r2, c13, c0, 3 | __asm ("mrc p15, 0, r2, c13, c0, 3");
0x000c1f38 movs r1, 0x1c | r1 = 0x1c;
0x000c1f3a movs r0, 0 | r0 = 0;
0x000c1f3c add r3, pc |
0x000c1f3e ldr r3, [r3] | r3 = GLIBC_2.4;
0x000c1f40 str r1, [r2, r3] | *((r2 + r3)) = r1;
0x000c1f42 b 0xc1d48 | goto label_8;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libc.so.6 @ 0xd9988 */
| #include <stdint.h>
|
; (fcn) sym.openpty () | void openpty (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_4h;
| int32_t var_4h_2;
| int16_t var_10h;
| int16_t var_1000h;
| int16_t var_1020h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x000d9988 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000d998c sub.w sp, sp, 0x1000 |
0x000d9990 sub sp, 0x14 |
0x000d9992 mov r8, r3 | r8 = r3;
0x000d9994 add r5, sp, 0x10 | r5 += var_10h;
0x000d9996 movs r3, 0 | r3 = 0;
0x000d9998 strb r3, [r5] | *(r5) = r3;
0x000d999a mov sl, r0 | sl = r0;
0x000d999c mov r7, r2 | r7 = r2;
0x000d999e str r1, [sp, 4] | var_4h = r1;
0x000d99a0 str r5, [r5, -0x4] | *((r5 - 0x4)) = r5;
0x000d99a4 bl 0xd946c | r0 = getpt ();
0x000d99a8 adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x000d99aa beq 0xd99ba | goto label_3;
| }
0x000d99ac mov r4, r0 | r4 = r0;
0x000d99ae bl 0xd947c | r0 = grantpt ();
0x000d99b2 cbz r0, 0xd99ca |
| while (r0 != 0) {
0x000d99b4 mov r0, r4 | r0 = r4;
0x000d99b6 bl 0x9ff60 | close (r0);
| label_3:
0x000d99ba mov.w r6, -1 | r6 = -1;
| label_0:
0x000d99be mov r0, r6 | r0 = r6;
0x000d99c0 add.w sp, sp, 0x1000 |
0x000d99c4 add sp, 0x14 |
0x000d99c6 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x000d99ca mov r0, r4 | r0 = r4;
0x000d99cc bl 0xd94c0 | r0 = unlockpt ();
0x000d99d0 mov r6, r0 | r6 = r0;
0x000d99d2 cmp r0, 0 |
0x000d99d4 bne 0xd99b4 |
| }
0x000d99d6 mov.w r2, 0x102 | r2 = 0x102;
0x000d99da movw r1, 0x5441 | r1 = 0x5441;
0x000d99de mov r0, r4 | r0 = r4;
0x000d99e0 bl 0xa7280 | r0 = ioctl_time64 ();
0x000d99e4 cmp.w r0, -1 |
0x000d99e8 mov sb, r0 | sb = r0;
0x000d99ea it ne |
| if (r0 == -1) {
0x000d99ec movne fp, r5 |
| }
| if (r0 == -1) {
0x000d99ee beq 0xd9a70 | goto label_4;
| }
| label_2:
0x000d99f0 cmp.w r8, 0 |
| if (r8 != 0) {
0x000d99f4 beq 0xd9a00 |
0x000d99f6 mov r2, r8 | r2 = r8;
0x000d99f8 movs r1, 2 | r1 = 2;
0x000d99fa mov r0, sb | r0 = sb;
0x000d99fc bl 0xa6a5c | tcsetattr ();
| }
0x000d9a00 add.w r3, sp, 0x1020 | r3 += var_1020h;
0x000d9a04 adds r3, 0x18 | r3 += 0x18;
0x000d9a06 ldr r3, [r3] | r3 = *(r3);
| if (r3 != 0) {
0x000d9a08 cbz r3, 0xd9a1c |
0x000d9a0a add.w r3, sp, 0x1020 | r3 += var_1020h;
0x000d9a0e movw r1, 0x5414 | r1 = 0x5414;
0x000d9a12 mov r0, sb | r0 = sb;
0x000d9a14 ldr r2, [r3, 0x18] | r2 = *((r3 + 0x18));
0x000d9a16 adds r3, 0x18 | r3 += 0x18;
0x000d9a18 bl 0xa7280 | ioctl_time64 ();
| }
0x000d9a1c ldr r3, [sp, 4] | r3 = var_4h;
0x000d9a1e str.w r4, [sl] | __asm ("str.w r4, [sl]");
0x000d9a22 str.w sb, [r3] | __asm ("str.w sb, [r3]");
| if (r7 != 0) {
0x000d9a26 cbz r7, 0xd9a44 |
0x000d9a28 ldrb.w r2, [fp] | r2 = *(fp);
| if (r2 == 0) {
0x000d9a2c cbnz r2, 0xd9a3c |
0x000d9a2e subs r1, r5, 4 | r1 -= var_4h_2;
0x000d9a30 mov r0, r4 | r0 = r4;
0x000d9a32 bl 0xd9904 | r0 = fcn_000d9904 (r0, r1);
| if (r0 != 0) {
0x000d9a36 cbnz r0, 0xd9a5a | goto label_5;
| }
0x000d9a38 ldr fp, [r5, -0x4] | fp = *((r5 - 0x4));
| }
0x000d9a3c mov r1, fp | r1 = fp;
0x000d9a3e mov r0, r7 | r0 = r7;
0x000d9a40 bl 0x6a480 | strcpy (r0, r1)
| }
| label_1:
0x000d9a44 cmp fp, r5 |
| if (fp == r5) {
0x000d9a46 beq 0xd99be | goto label_0;
| }
0x000d9a48 mov r0, fp | r0 = fp;
0x000d9a4a blx 0x212d4 | fcn_000212d4 ();
0x000d9a4e mov r0, r6 | r0 = r6;
0x000d9a50 add.w sp, sp, 0x1000 |
0x000d9a54 add sp, 0x14 |
0x000d9a56 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x000d9a5a mov r0, r4 | r0 = r4;
0x000d9a5c mov.w r6, -1 | r6 = -1;
0x000d9a60 bl 0x9ff60 | close (r0);
0x000d9a64 mov r0, sb | r0 = sb;
0x000d9a66 bl 0x9ff60 | close (r0);
0x000d9a6a ldr fp, [r5, -0x4] | fp = *((r5 - 0x4));
0x000d9a6e b 0xd9a44 | goto label_1;
| label_4:
0x000d9a70 subs r1, r5, 4 | r1 -= var_4h_2;
0x000d9a72 mov r0, r4 | r0 = r4;
0x000d9a74 bl 0xd9904 | r0 = fcn_000d9904 (r0, r1);
| if (r0 != 0) {
0x000d9a78 cbnz r0, 0xd9a9a | goto label_6;
| }
0x000d9a7a ldr fp, [r5, -0x4] | fp = *((r5 - 0x4));
0x000d9a7e mov.w r1, 0x102 | r1 = 0x102;
0x000d9a82 mov r0, fp | r0 = fp;
0x000d9a84 bl 0x9f504 | r0 = open64 ();
0x000d9a88 cmp.w r0, -1 |
0x000d9a8c mov sb, r0 | sb = r0;
| if (r0 != -1) {
0x000d9a8e bne 0xd99f0 | goto label_2;
| }
0x000d9a90 mov r0, r4 | r0 = r4;
0x000d9a92 mov r6, sb | r6 = sb;
0x000d9a94 bl 0x9ff60 | close (r0);
0x000d9a98 b 0xd9a44 | goto label_1;
| label_6:
0x000d9a9a mov r0, r4 | r0 = r4;
0x000d9a9c mov r6, sb | r6 = sb;
0x000d9a9e bl 0x9ff60 | close (r0);
0x000d9aa2 ldr fp, [r5, -0x4] | fp = *((r5 - 0x4));
0x000d9aa6 b 0xd9a44 | 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/libc.so.6 @ 0x6a084 */
| #include <stdint.h>
|
; (fcn) sym.strcat () | void strcat (char * s1, const char * s2) {
| r0 = s1;
| r1 = s2;
0x0006a084 push {r3, r4, r5, lr} |
0x0006a086 mov r4, r0 | r4 = r0;
0x0006a088 mov r5, r1 | r5 = r1;
0x0006a08a bl 0x6a8c0 | strlen ();
0x0006a08e mov r1, r5 | r1 = r5;
0x0006a090 add r0, r4 | r0 += r4;
0x0006a092 bl 0x6a480 | strcpy (r0, r1)
0x0006a096 mov r0, r4 | r0 = r4;
0x0006a098 pop {r3, r4, r5, pc} |
| }
[*] Function strcpy used 12 times libc.so.6