[*] Binary protection state of libformatname.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of libformatname.so
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libformatname.so @ 0x1790 */
| #include <stdint.h>
|
; (fcn) fcn.00001790 () | void fcn_00001790 (int16_t arg1) {
| r0 = arg1;
0x00001790 invalid |
0x00001794 blx 0x1388 | fflush (r0);
0x00001798 mov r0, r4 | r0 = r4;
0x0000179a blx 0x15a4 | fprintf_chk ()
0x0000179e movs r2, 0 | r2 = 0;
0x000017a0 mov r1, r2 | r1 = r2;
0x000017a2 blx 0x157c | fcn_0000157c ();
0x000017a6 adds r0, 1 | r0++;
| if (r0 != 1) {
0x000017a8 beq 0x17b4 |
0x000017aa mov r0, r4 | r0 = r4;
0x000017ac pop.w {r4, lr} |
0x000017b0 b.w 0x15bc | void (*0x15bc)() ();
| }
0x000017b4 blx 0x1540 | fcn_00001540 ();
0x000017b8 ldr r2, [pc, 0x14] |
0x000017ba movs r1, 1 | r1 = 1;
0x000017bc ldr r3, [r0] | r3 = *(r0);
0x000017be movs r0, 6 | r0 = 6;
0x000017c0 add r2, pc | r2 = 0x2f94;
0x000017c2 blx 0x15dc | fcn_000015dc ();
0x000017c6 mov r0, r4 | r0 = r4;
0x000017c8 pop.w {r4, lr} |
0x000017cc b.w 0x15bc | return void (*0x15bc)() ();
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libformatname.so @ 0x1cd4 */
| #include <stdint.h>
|
; (fcn) sym.formatname_exit () | void formatname_exit (int16_t arg1) {
| int16_t var_0h;
| r0 = arg1;
| do {
0x0000141c invalid | void (*0x1420)() ();
| label_1:
0x000015d8 bx pc | return void (*pc)() ();
| if (r0 == 0) {
0x00001cd4 cbz r0, 0x1d42 | goto label_3;
| }
0x00001cd6 push {r4, r5, r6, lr} |
0x00001cd8 mov r4, r0 | r4 = r0;
0x00001cda ldr r0, [r0, 0x10] | r0 = *((r0 + 0x10));
0x00001cdc sub sp, 8 |
| if (r0 != 0) {
0x00001cde cbz r0, 0x1d2a |
0x00001ce0 ldr r1, [pc, 0x88] |
0x00001ce2 movs r2, 0 | r2 = 0;
0x00001ce4 add r1, pc | r1 = 0x3a54;
0x00001ce6 bl 0x1720 | r0 = fcn_00001720 (r0, r1);
0x00001cea mov r5, r0 | r5 = r0;
| if (r0 == 0) {
0x00001cec cbz r0, 0x1d4e | goto label_4;
| }
0x00001cee ldrb.w r2, [r4, 0x54] | r2 = *((r4 + 0x54));
0x00001cf2 ldr r3, [r4, 0x34] | r3 = *((r4 + 0x34));
| if (r2 == 0) {
0x00001cf4 cbz r2, 0x1d36 | goto label_5;
| }
0x00001cf6 ldr r2, [pc, 0x78] |
0x00001cf8 movs r1, 1 | r1 = 1;
0x00001cfa add r2, pc | r2 = 0x3a70;
0x00001cfc blx 0x15b0 | fclose (r0);
| label_0:
0x00001d00 mov r0, r5 | r0 = r5;
0x00001d02 blx 0x15a4 | fprintf_chk ()
0x00001d06 blx 0x1340 | fsync ();
0x00001d0a ldr r0, [pc, 0x68] |
0x00001d0c movs r1, 0 | r1 = 0;
0x00001d0e add r0, pc | r0 = 0x3a88;
0x00001d10 blx 0x14f8 | r0 = fcn_000014f8 ();
0x00001d14 adds r3, r0, 1 | r3 = r0 + 1;
0x00001d16 mov r6, r0 | r6 = r0;
| if (r3 != r0) {
0x00001d18 beq 0x1d24 |
0x00001d1a blx 0x1340 | fsync ();
0x00001d1e mov r0, r6 | r0 = r6;
0x00001d20 blx 0x1634 | fchmod (r0, r1);
| }
0x00001d24 mov r0, r5 | r0 = r5;
0x00001d26 bl 0x1790 | fcn_00001790 (r0);
| }
| label_2:
0x00001d2a mov r0, r4 | r0 = r4;
0x00001d2c add sp, 8 |
0x00001d2e pop.w {r4, r5, r6, lr} |
0x00001d32 b.w 0x141c |
| } while (1);
| label_5:
0x00001d36 ldr r2, [pc, 0x40] |
0x00001d38 movs r1, 1 | r1 = 1;
0x00001d3a add r2, pc | r2 = 0x3ab8;
0x00001d3c blx 0x15b0 | fclose (r0);
0x00001d40 b 0x1d00 | goto label_0;
| label_3:
0x00001d42 ldr r2, [pc, 0x38] |
0x00001d44 movs r1, 1 | r1 = 1;
0x00001d46 movs r0, 4 | r0 = 4;
0x00001d48 add r2, pc | r2 = 0x3aca;
0x00001d4a b.w 0x15d8 | goto label_1;
| label_4:
0x00001d4e blx 0x1540 | r0 = fcn_00001540 ();
0x00001d52 ldr r0, [r0] | r0 = *(r0);
0x00001d54 ldr r5, [r4, 0x10] | r5 = *((r4 + 0x10));
0x00001d56 blx 0x14bc | fcn_000014bc ();
0x00001d5a ldr r2, [pc, 0x24] |
0x00001d5c movs r1, 1 | r1 = 1;
0x00001d5e str r0, [sp] | *(sp) = r0;
0x00001d60 mov r3, r5 | r3 = r5;
0x00001d62 movs r0, 4 | r0 = 4;
0x00001d64 add r2, pc | r2 = 0x3aea;
0x00001d66 blx 0x15dc | fcn_000015dc ();
0x00001d6a b 0x1d2a | goto label_2;
| }
[*] Function fprintf used 3 times libformatname.so