[*] Binary protection state of libblkid.so.1.1.0
Partial RELRO No Canary found NX disabled DSO No RPATH No RUNPATH No Symbols
[*] Function strcpy tear down of libblkid.so.1.1.0
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/lib/libblkid.so.1.1.0 @ 0xa314 */
| #include <stdint.h>
|
; (fcn) fcn.0000a314 () | void fcn_0000a314 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_8h;
| int32_t var_58h;
| char * dest;
| int32_t var_1040h;
| int32_t var_30h;
| r0 = arg1;
| r1 = arg2;
0x0000a314 push {r4, r5, r6, r7, r8, lr} |
0x0000a318 ldr r4, [pc, 0x25c] | r4 = *(0xa578);
0x0000a31c ldr r3, [pc, 0x25c] | r3 = *(0xa57c);
0x0000a320 add r4, pc, r4 | r4 = pc + r4;
0x0000a324 ldr r6, [r4, r3] | r6 = *(0xa578);
0x0000a328 sub sp, sp, 0x1040 |
0x0000a32c ldr r3, [r6] | r3 = *(0xa578);
0x0000a330 sub sp, sp, 0x30 |
0x0000a334 tst r3, 0x80 |
0x0000a338 mov r5, r0 | r5 = r0;
0x0000a33c mov r7, r1 | r7 = r1;
| if ((r3 & 0x80) != 0) {
0x0000a340 beq 0xa390 |
0x0000a344 ldr r3, [pc, 0x238] | r3 = *(0xa580);
0x0000a348 ldr r3, [r4, r3] | r3 = *((r4 + r3));
0x0000a34c ldr r8, [r3] | r8 = *(0xa580);
0x0000a350 bl 0x58fc | getpid ();
0x0000a354 ldr r3, [pc, 0x22c] | r3 = *(0xa584);
0x0000a358 ldr r1, [pc, 0x22c] | r1 = *(0xa588);
0x0000a35c add r3, pc, r3 | r3 = pc + r3;
0x0000a360 str r3, [sp] | *(sp) = r3;
0x0000a364 ldr r3, [pc, 0x224] | r3 = *(0xa58c);
0x0000a368 add r1, pc, r1 | r1 = pc + r1;
0x0000a36c add r3, pc, r3 | r3 = pc + r3;
0x0000a370 mov r2, r0 | r2 = r0;
0x0000a374 mov r0, r8 | r0 = r8;
0x0000a378 bl 0x5c50 | fprintf (r0, r1, r2, r3);
0x0000a37c ldr r0, [pc, 0x210] | r0 = *(0xa590);
0x0000a380 mov r2, r7 | r2 = r7;
0x0000a384 mov r1, r5 | r1 = r5;
0x0000a388 add r0, pc, r0 | r0 = pc + r0;
0x0000a38c bl 0xa288 | fcn_0000a288 ();
| }
0x0000a390 ldr r1, [pc, 0x200] | r1 = *(0xa594);
0x0000a394 mov r0, r5 | r0 = r5;
0x0000a398 add r1, pc, r1 | r1 = pc + r1;
0x0000a39c bl 0x5efc | r0 = strcmp (r0, r1);
0x0000a3a0 cmp r0, 0 |
| if (r0 != 0) {
0x0000a3a4 bne 0xa468 | goto label_3;
| }
0x0000a3a8 ldr r1, [pc, 0x1ec] | r1 = *(0xa598);
0x0000a3ac add r1, pc, r1 | r1 = pc + r1;
| do {
| label_0:
0x0000a3b0 add r5, sp, 0x70 | r5 += dest;
0x0000a3b4 add r0, sp, 0x70 | r0 += dest;
0x0000a3b8 bl 0x5710 | strcpy (r0, r1)
0x0000a3bc mov r0, r5 | r0 = r5;
0x0000a3c0 bl 0x6118 | r0 = strlen (r0);
0x0000a3c4 rsb r2, r0, 0x1000 | r2 = 0x1000 - r0;
0x0000a3c8 add r1, r5, r0 | r1 = r5 + r0;
0x0000a3cc mov r0, r7 | r0 = r7;
0x0000a3d0 bl 0x5b00 | r0 = fcn_00005b00 ();
0x0000a3d4 cmp r0, 0 |
| if (r0 != 0) {
0x0000a3d8 bne 0xa4d4 | goto label_2;
| }
0x0000a3dc ldr r3, [r6] | r3 = *(r6);
0x0000a3e0 tst r3, 0x80 |
| if ((r3 & 0x80) != 0) {
0x0000a3e4 beq 0xa430 |
0x0000a3e8 ldr r3, [pc, 0x194] | r3 = *(0xa580);
0x0000a3ec ldr r3, [r4, r3] | r3 = *((r4 + r3));
0x0000a3f0 ldr r7, [r3] | r7 = *(0xa580);
0x0000a3f4 bl 0x58fc | getpid ();
0x0000a3f8 ldr r3, [pc, 0x1a0] | r3 = *(0xa59c);
0x0000a3fc ldr r1, [pc, 0x1a0] | r1 = *(0xa5a0);
0x0000a400 add r3, pc, r3 | r3 = pc + r3;
0x0000a404 str r3, [sp] | *(sp) = r3;
0x0000a408 ldr r3, [pc, 0x198] | r3 = *(0xa5a4);
0x0000a40c add r1, pc, r1 | r1 = pc + r1;
0x0000a410 add r3, pc, r3 | r3 = pc + r3;
0x0000a414 mov r2, r0 | r2 = r0;
0x0000a418 mov r0, r7 | r0 = r7;
0x0000a41c bl 0x5c50 | fprintf (r0, r1, r2, r3);
0x0000a420 ldr r0, [pc, 0x184] | r0 = *(0xa5a8);
0x0000a424 mov r1, r5 | r1 = r5;
0x0000a428 add r0, pc, r0 | r0 = pc + r0;
0x0000a42c bl 0xa288 | fcn_0000a288 ();
| }
0x0000a430 add r1, sp, 8 | r1 += var_8h;
0x0000a434 mov r0, r5 | r0 = r5;
0x0000a438 bl 0x5800 | r0 = stat64 ();
0x0000a43c cmp r0, 0 |
| if (r0 != 0) {
0x0000a440 bne 0xa528 | goto label_4;
| }
0x0000a444 ldr r3, [r5, -0x58] | r3 = var_58h;
0x0000a448 and r3, r3, 0xf000 | r3 &= 0xf000;
0x0000a44c cmp r3, 0x6000 |
| if (r3 != 0x6000) {
0x0000a450 bne 0xa4d4 | goto label_2;
| }
0x0000a454 mov r0, r5 | r0 = r5;
0x0000a458 bl 0x22a24 | fcn_00022a24 (r0);
| label_1:
0x0000a45c add sp, sp, 0x1040 |
0x0000a460 add sp, sp, 0x30 |
0x0000a464 pop {r4, r5, r6, r7, r8, pc} |
| label_3:
0x0000a468 ldr r1, [pc, 0x140] | r1 = *(0xa5ac);
0x0000a46c mov r0, r5 | r0 = r5;
0x0000a470 add r1, pc, r1 | r1 = pc + r1;
0x0000a474 bl 0x5efc | r0 = strcmp (r0, r1);
0x0000a478 cmp r0, 0 |
| if (r0 != 0) {
0x0000a47c ldreq r1, [pc, 0x130] | r1 = *((pc + 0x130));
| }
| if (r0 != 0) {
0x0000a480 addeq r1, pc, r1 | r1 = pc + r1;
| }
0x0000a484 beq 0xa3b0 |
| } while (r0 == 0);
0x0000a488 ldr r1, [pc, 0x128] | r1 = *(0xa5b4);
0x0000a48c mov r0, r5 | r0 = r5;
0x0000a490 add r1, pc, r1 | r1 = pc + r1;
0x0000a494 bl 0x5efc | r0 = strcmp (r0, r1);
0x0000a498 cmp r0, 0 |
| if (r0 != 0) {
0x0000a49c ldreq r1, [pc, 0x118] | r1 = *((pc + 0x118));
| }
| if (r0 == 0) {
0x0000a4a0 addeq r1, pc, r1 | r1 = pc + r1;
| goto label_5;
| }
| if (r0 == 0) {
| label_5:
0x0000a4a4 beq 0xa3b0 | goto label_0;
| }
0x0000a4a8 ldr r1, [pc, 0x110] | r1 = *(0xa5bc);
0x0000a4ac mov r0, r5 | r0 = r5;
0x0000a4b0 add r1, pc, r1 | r1 = pc + r1;
0x0000a4b4 bl 0x5efc | r0 = strcmp (r0, r1);
0x0000a4b8 cmp r0, 0 |
| if (r0 != 0) {
0x0000a4bc ldreq r1, [pc, 0x100] | r1 = *((pc + 0x100));
| }
| if (r0 == 0) {
0x0000a4c0 addeq r1, pc, r1 | r1 = pc + r1;
| goto label_6;
| }
| if (r0 == 0) {
| label_6:
0x0000a4c4 beq 0xa3b0 | goto label_0;
| }
0x0000a4c8 ldr r3, [r6] | r3 = *(r6);
0x0000a4cc tst r3, 0x80 |
0x0000a4d0 bne 0xa4dc |
| while (1) {
| label_2:
0x0000a4d4 mov r0, 0 | r0 = 0;
0x0000a4d8 b 0xa45c | goto label_1;
0x0000a4dc ldr r3, [pc, 0xa0] | r3 = *(0xa580);
0x0000a4e0 ldr r3, [r4, r3] | r3 = *((r4 + r3));
0x0000a4e4 ldr r4, [r3] | r4 = *(0xa580);
0x0000a4e8 bl 0x58fc | getpid ();
0x0000a4ec ldr r3, [pc, 0xd4] | r3 = *(0xa5c4);
0x0000a4f0 ldr r1, [pc, 0xd4] | r1 = *(0xa5c8);
0x0000a4f4 add r3, pc, r3 | r3 = pc + r3;
0x0000a4f8 str r3, [sp] | *(sp) = r3;
0x0000a4fc ldr r3, [pc, 0xcc] | r3 = *(0xa5cc);
0x0000a500 add r1, pc, r1 | r1 = pc + r1;
0x0000a504 add r3, pc, r3 | r3 = pc + r3;
0x0000a508 mov r2, r0 | r2 = r0;
0x0000a50c mov r0, r4 | r0 = r4;
0x0000a510 bl 0x5c50 | fprintf (r0, r1, r2, r3);
0x0000a514 ldr r0, [pc, 0xb8] | r0 = *(0xa5d0);
0x0000a518 mov r1, r5 | r1 = r5;
0x0000a51c add r0, pc, r0 | r0 = pc + r0;
0x0000a520 bl 0xa288 | fcn_0000a288 ();
0x0000a524 b 0xa4d4 |
| }
| label_4:
0x0000a528 ldr r3, [r6] | r3 = *(r6);
0x0000a52c tst r3, 0x80 |
| if ((r3 & 0x80) == 0) {
0x0000a530 beq 0xa4d4 | goto label_2;
| }
0x0000a534 ldr r3, [pc, 0x48] | r3 = *(0xa580);
0x0000a538 ldr r3, [r4, r3] | r3 = *((r4 + r3));
0x0000a53c ldr r4, [r3] | r4 = *(0xa580);
0x0000a540 bl 0x58fc | getpid ();
0x0000a544 ldr r3, [pc, 0x8c] | r3 = *(0xa5d4);
0x0000a548 ldr r1, [pc, 0x8c] | r1 = *(0xa5d8);
0x0000a54c add r3, pc, r3 | r3 = pc + r3;
0x0000a550 str r3, [sp] | *(sp) = r3;
0x0000a554 ldr r3, [pc, 0x84] | r3 = *(0xa5dc);
0x0000a558 add r1, pc, r1 | r1 = pc + r1;
0x0000a55c add r3, pc, r3 | r3 = pc + r3;
0x0000a560 mov r2, r0 | r2 = r0;
0x0000a564 mov r0, r4 | r0 = r4;
0x0000a568 bl 0x5c50 | fprintf (r0, r1, r2, r3);
0x0000a56c ldr r0, [pc, 0x70] | r0 = *(0xa5e0);
0x0000a570 add r0, pc, r0 | r0 = pc + r0;
0x0000a574 bl 0xa288 | fcn_0000a288 ();
0x0000a578 b 0xa4d4 | goto label_2;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/lib/libblkid.so.1.1.0 @ 0x7994 */
| #include <stdint.h>
|
; (fcn) sym.blkid_dev_set_search () | void blkid_dev_set_search (int32_t arg1, uint32_t arg2) {
| r0 = arg1;
| r1 = arg2;
0x00007994 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00007998 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x0000799c beq 0x7a18 |
0x000079a0 ldr r0, [r5] | r0 = *(r5);
0x000079a4 ldr r3, [pc, 0xac] | r3 = *(0x7a54);
0x000079a8 cmp r0, r3 |
| if (r0 != r3) {
0x000079ac bne 0x7a18 | goto label_0;
| }
0x000079b0 cmp r2, 0 |
0x000079b4 cmpne r1, 0 | __asm ("cmpne r1, 0");
| if (r2 == 0) {
0x000079b8 beq 0x7a18 | goto label_0;
| }
0x000079bc mov r0, r1 | r0 = r1;
0x000079c0 mov r6, r2 | r6 = r2;
0x000079c4 mov r7, r1 | r7 = r1;
0x000079c8 bl 0x6118 | r0 = strlen (r0);
0x000079cc add r0, r0, 1 | r0++;
0x000079d0 bl 0x59f8 | r0 = malloc (r0);
0x000079d4 mov r8, r0 | r8 = r0;
0x000079d8 mov r0, r6 | r0 = r6;
0x000079dc bl 0x6118 | r0 = strlen (r0);
0x000079e0 add r0, r0, 1 | r0++;
0x000079e4 bl 0x59f8 | malloc (r0);
0x000079e8 cmp r8, 0 |
| if (r8 != 0) {
0x000079ec moveq r4, 1 | r4 = 1;
| }
0x000079f0 mov sb, r0 | sb = r0;
0x000079f4 clz r0, r0 | r0 &= r0;
0x000079f8 lsr r0, r0, 5 | r0 >>= 5;
| if (r8 == 0) {
0x000079fc movne r4, r0 | r4 = r0;
| }
0x00007a00 cmp r4, 0 |
| if (r4 == 0) {
0x00007a04 beq 0x7a20 | goto label_1;
| }
0x00007a08 mov r0, r8 | r0 = r8;
0x00007a0c bl 0x6220 | free (r0);
0x00007a10 mov r0, sb | r0 = sb;
0x00007a14 bl 0x6220 | free (r0);
| }
| label_0:
0x00007a18 mvn r0, 0 | r0 = ~0;
0x00007a1c pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_1:
0x00007a20 mov r1, r7 | r1 = r7;
0x00007a24 mov r0, r8 | r0 = r8;
0x00007a28 bl 0x5710 | strcpy (r0, r1)
0x00007a2c mov r1, r6 | r1 = r6;
0x00007a30 mov r0, sb | r0 = sb;
0x00007a34 bl 0x5710 | strcpy (r0, r1)
0x00007a38 ldr r0, [r5, 8] | r0 = *((r5 + 8));
0x00007a3c bl 0x6220 | free (r0);
0x00007a40 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00007a44 bl 0x6220 | free (r0);
0x00007a48 str r8, [r5, 8] | *((r5 + 8)) = r8;
0x00007a4c str sb, [r5, 0xc] | *((r5 + 0xc)) = sb;
0x00007a50 mov r0, r4 | r0 = r4;
0x00007a54 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
[*] Function strcpy used 4 times libblkid.so.1.1.0