[*] Binary protection state of syncfile
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function sprintf tear down of syncfile
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/syncfile @ 0xff4 */
| #include <stdint.h>
|
; (fcn) fcn.00000ff4 () | void fcn_00000ff4 () {
0x00000ff4 lui gp, 2 |
0x00000ff8 addiu gp, gp, -0x6fe4 |
0x00000ffc addu gp, gp, t9 | gp += t9;
0x00001000 addiu sp, sp, -0xf0 |
0x00001004 lw t9, -0x7fd4(gp) | t9 = *(gp);
0x00001008 sw s3, 0xd4(sp) | *(var_d4h) = s3;
0x0000100c lw s3, -0x7f54(gp) | s3 = *((gp - 8149));
0x00001010 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00001014 sw s1, 0xcc(sp) | *(var_cch) = s1;
0x00001018 lw v0, (s3) | v0 = *(s3);
0x0000101c sw ra, 0xec(sp) | *(var_ech) = ra;
0x00001020 sw fp, 0xe8(sp) | *(var_e8h) = fp;
0x00001024 sw s7, 0xe4(sp) | *(var_e4h) = s7;
0x00001028 sw s6, 0xe0(sp) | *(var_e0h) = s6;
0x0000102c sw s5, 0xdc(sp) | *(var_dch) = s5;
0x00001030 sw s4, 0xd8(sp) | *(var_d8h) = s4;
0x00001034 sw s2, 0xd0(sp) | *(var_d0h) = s2;
0x00001038 sw s0, 0xc8(sp) | *(var_c8h) = s0;
0x0000103c addiu a1, sp, 0x34 | a1 = sp + 0x34;
0x00001040 sw v0, 0xc4(sp) | *(var_c4h) = v0;
0x00001044 move s1, a0 | s1 = a0;
0x00001048 bal 0x1530 | fcn_00001530 ();
0x0000104c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00001050 bnez v0, 0x13b8 | goto label_4;
| }
0x00001054 move s2, v0 | s2 = v0;
0x00001058 lw v0, 0x48(sp) | v0 = *(var_48h);
0x0000105c addiu v1, zero, 0x4000 | v1 = 0x4000;
0x00001060 andi v0, v0, 0xf000 | v0 &= 0xf000;
0x00001064 ori v1, zero, 0x8000 | v1 = 0x8000;
| if (v0 == v1) {
0x00001068 beq v0, v1, 0x10e8 | goto label_5;
| }
0x0000106c lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
| if (v0 != v1) {
0x00001070 bne v0, v1, 0x1390 | goto label_6;
| }
0x00001074 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
| do {
0x00001078 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x0000107c move a1, s1 | a1 = s1;
0x00001080 addiu t9, t9, 0xde0 | t9 += fcn.00000de0;
0x00001084 addiu a0, a0, 0x17d0 | a0 += str.Syncing:__s_n;
0x00001088 bal 0xde0 | fcn_00000de0 ();
0x0000108c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001090 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x00001094 addiu t9, t9, 0xe74 | t9 += fcn.00000e74;
0x00001098 move a0, s1 | a0 = s1;
0x0000109c bal 0xe74 | fcn_00000e74 ();
0x000010a0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x000010a4 bltz v0, 0x1408 | goto label_7;
| }
| label_2:
0x000010a8 lw a0, 0xc4(sp) | a0 = *(var_c4h);
0x000010ac lw v1, (s3) | v1 = *(s3);
0x000010b0 move v0, s2 | v0 = s2;
| if (a0 != v1) {
0x000010b4 bne a0, v1, 0x1434 | goto label_8;
| }
0x000010b8 lw ra, 0xec(sp) | ra = *(var_ech);
0x000010bc lw fp, 0xe8(sp) | fp = *(var_e8h);
0x000010c0 lw s7, 0xe4(sp) | s7 = *(var_e4h);
0x000010c4 lw s6, 0xe0(sp) | s6 = *(var_e0h);
0x000010c8 lw s5, 0xdc(sp) | s5 = *(var_dch);
0x000010cc lw s4, 0xd8(sp) | s4 = *(var_d8h);
0x000010d0 lw s3, 0xd4(sp) | s3 = *(var_d4h);
0x000010d4 lw s2, 0xd0(sp) | s2 = *(var_d0h);
0x000010d8 lw s1, 0xcc(sp) | s1 = *(var_cch);
0x000010dc lw s0, 0xc8(sp) | s0 = *(var_c8h);
0x000010e0 addiu sp, sp, 0xf0 |
0x000010e4 jr ra | return v0;
| label_5:
0x000010e8 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
0x000010ec lw v0, 0x20f0(v0) | v0 = *((v0 + 2108));
0x000010f0 beql v0, zero, 0x1078 |
| } while (v0 == 0);
0x000010f4 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x000010f8 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
0x000010fc lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00001100 addiu t9, v0, 0xde0 | t9 = v0 + fcn.00000de0;
0x00001104 move a1, s1 | a1 = s1;
0x00001108 addiu a0, a0, 0x174c | a0 += str.Recursively_syncing:__s_n;
0x0000110c sw t9, 0x2c(sp) | *(var_2ch) = t9;
0x00001110 bal 0xde0 | fcn_00000de0 ();
0x00001114 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001118 lw t9, -0x7fa8(gp) | t9 = sym.imp.opendir;
0x0000111c move a0, s1 | a0 = s1;
0x00001120 jalr t9 | t9 ();
0x00001124 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001128 lw t9, -0x7f7c(gp) | t9 = sym.imp.__errno_location;
0x0000112c move s6, v0 | s6 = v0;
0x00001130 jalr t9 | t9 ();
0x00001134 move fp, v0 | fp = v0;
0x00001138 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s6 == 0) {
0x0000113c beqz s6, 0x1440 | goto label_9;
| }
0x00001140 lw s7, -0x7fd8(gp) | s7 = *((gp - 8182));
0x00001144 sw zero, (v0) | *(v0) = 0;
0x00001148 addiu v0, s7, 0x1770 | v0 = s7 + str._s__s;
0x0000114c sw v0, 0x24(sp) | *(var_24h) = v0;
0x00001150 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
0x00001154 lw s4, -0x7fd8(gp) | s4 = *((gp - 8182));
0x00001158 lw s5, -0x7fd8(gp) | s5 = *((gp - 8182));
0x0000115c addiu v0, v0, 0xff4 | v0 += fcn.00000ff4;
0x00001160 addiu s4, s4, 0x1768 | s4 += 0x1768;
0x00001164 addiu s5, s5, 0x176c | s5 += 0x176c;
0x00001168 sw v0, 0x28(sp) | *(var_28h) = v0;
| do {
| label_0:
0x0000116c lw t9, -0x7f88(gp) | t9 = sym.imp.readdir;
0x00001170 move a0, s6 | a0 = s6;
0x00001174 jalr t9 | t9 ();
0x00001178 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0000117c beqz v0, 0x1254 | goto label_10;
| }
| label_1:
0x00001180 lw t9, -0x7f3c(gp) | t9 = sym.imp.strcmp;
0x00001184 addiu s0, v0, 0xb | s0 = v0 + 0xb;
0x00001188 move a1, s4 | a1 = s4;
0x0000118c move a0, s0 | a0 = s0;
0x00001190 jalr t9 | t9 ();
0x00001194 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001198 beqz v0, 0x116c |
| } while (v0 == 0);
0x0000119c lw t9, -0x7f3c(gp) | t9 = sym.imp.strcmp;
0x000011a0 move a1, s5 | a1 = s5;
0x000011a4 move a0, s0 | a0 = s0;
0x000011a8 jalr t9 | t9 ();
0x000011ac lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x000011b0 beqz v0, 0x116c | goto label_0;
| }
0x000011b4 lw t9, -0x7f70(gp) | t9 = sym.imp.strlen;
0x000011b8 move a0, s1 | a0 = s1;
0x000011bc jalr t9 | t9 ();
0x000011c0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000011c4 move a0, s0 | a0 = s0;
0x000011c8 lw t9, -0x7f70(gp) | t9 = sym.imp.strlen;
0x000011cc move s7, v0 | s7 = v0;
0x000011d0 jalr t9 | t9 ();
0x000011d4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000011d8 addu a1, s7, v0 | a1 = s7 + v0;
0x000011dc addiu a1, a1, 2 | a1 += 2;
0x000011e0 lw t9, -0x7fac(gp) | t9 = sym.imp.calloc;
0x000011e4 addiu a0, zero, 1 | a0 = 1;
0x000011e8 jalr t9 | t9 ();
0x000011ec lw gp, 0x18(sp) | gp = *(var_18h);
0x000011f0 lw a3, 0x24(sp) | a3 = *(var_24h);
0x000011f4 addiu a2, zero, -1 | a2 = -1;
0x000011f8 lw t9, -0x7fb0(gp) | t9 = sym.imp.__sprintf_chk
0x000011fc addiu a1, zero, 1 | a1 = 1;
0x00001200 move a0, v0 | a0 = v0;
0x00001204 sw s0, 0x14(sp) | *(var_14h) = s0;
0x00001208 sw s1, 0x10(sp) | *(var_10h) = s1;
0x0000120c move s7, v0 | s7 = v0;
0x00001210 jalr t9 | t9 ();
0x00001214 lw t9, 0x28(sp) | t9 = *(var_28h);
0x00001218 move a0, s7 | a0 = s7;
0x0000121c jalr t9 | t9 ();
0x00001220 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001224 move a0, s7 | a0 = s7;
0x00001228 lw t9, -0x7f50(gp) | t9 = sym.imp.free;
| if (v0 < 0) {
0x0000122c bltz v0, 0x12c8 | goto label_11;
| }
0x00001230 jalr t9 | t9 ();
0x00001234 nop |
0x00001238 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000123c sw zero, (fp) | *(fp) = 0;
0x00001240 lw t9, -0x7f88(gp) | t9 = sym.imp.readdir;
0x00001244 move a0, s6 | a0 = s6;
0x00001248 jalr t9 | t9 ();
0x0000124c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00001250 bnez v0, 0x1180 | goto label_1;
| }
| label_10:
0x00001254 lw a0, (fp) | a0 = *(fp);
0x00001258 lw t9, -0x7fa4(gp) | t9 = sym.imp.closedir;
| if (a0 != 0) {
0x0000125c bnez a0, 0x1318 | goto label_12;
| }
0x00001260 move a0, s6 | a0 = s6;
0x00001264 jalr t9 | t9 ();
0x00001268 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000126c lw t9, 0x2c(sp) | t9 = *(var_2ch);
0x00001270 move a1, s1 | a1 = s1;
0x00001274 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00001278 addiu a0, a0, 0x1778 | a0 += str.Syncing_dir:__s_n;
0x0000127c jalr t9 | t9 ();
0x00001280 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001284 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x00001288 addiu t9, t9, 0xe74 | t9 += fcn.00000e74;
0x0000128c move a0, s1 | a0 = s1;
0x00001290 bal 0xe74 | fcn_00000e74 ();
0x00001294 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00001298 bgez v0, 0x10a8 | goto label_2;
| }
0x0000129c lw s0, -0x7f4c(gp) | s0 = *((gp - 8147));
| do {
| label_3:
0x000012a0 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x000012a4 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk;
0x000012a8 lw a0, (s0) | a0 = *(s0);
0x000012ac move a3, s1 | a3 = s1;
0x000012b0 addiu a2, a2, 0x17b0 | a2 += str.Failed_to_sync_directory__s_n;
0x000012b4 addiu a1, zero, 1 | a1 = 1;
0x000012b8 jalr t9 | t9 ();
0x000012bc addiu s2, zero, -1 | s2 = -1;
0x000012c0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000012c4 b 0x10a8 | goto label_2;
| label_11:
0x000012c8 jalr t9 | t9 ();
0x000012cc nop |
0x000012d0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000012d4 lw t9, -0x7fa4(gp) | t9 = sym.imp.closedir;
0x000012d8 move a0, s6 | a0 = s6;
0x000012dc jalr t9 | t9 ();
0x000012e0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000012e4 lw t9, 0x2c(sp) | t9 = *(var_2ch);
0x000012e8 move a1, s1 | a1 = s1;
0x000012ec lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x000012f0 addiu a0, a0, 0x1778 | a0 += str.Syncing_dir:__s_n;
0x000012f4 jalr t9 | t9 ();
0x000012f8 lw gp, 0x18(sp) | gp = *(var_18h);
0x000012fc lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x00001300 lw s0, -0x7f4c(gp) | s0 = *((gp - 8147));
0x00001304 addiu t9, t9, 0xe74 | t9 += fcn.00000e74;
0x00001308 move a0, s1 | a0 = s1;
0x0000130c bal 0xe74 | fcn_00000e74 ();
0x00001310 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001314 b 0x12a0 |
| } while (1);
| label_12:
0x00001318 lw s0, -0x7f4c(gp) | s0 = *((gp - 8147));
0x0000131c lw t9, -0x7f60(gp) | t9 = sym.imp.strerror;
0x00001320 lw s2, (s0) | s2 = *(s0);
0x00001324 jalr t9 | t9 ();
0x00001328 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000132c move a3, s1 | a3 = s1;
0x00001330 addiu a1, zero, 1 | a1 = 1;
0x00001334 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00001338 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk;
0x0000133c addiu a2, a2, 0x178c | a2 += str.Failed_to_list_content_of__s:__s_n;
0x00001340 move a0, s2 | a0 = s2;
0x00001344 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00001348 jalr t9 | t9 ();
0x0000134c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001350 lw t9, -0x7fa4(gp) | t9 = sym.imp.closedir;
0x00001354 move a0, s6 | a0 = s6;
0x00001358 jalr t9 | t9 ();
0x0000135c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001360 lw t9, 0x2c(sp) | t9 = *(var_2ch);
0x00001364 move a1, s1 | a1 = s1;
0x00001368 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x0000136c addiu a0, a0, 0x1778 | a0 += str.Syncing_dir:__s_n;
0x00001370 jalr t9 | t9 ();
0x00001374 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001378 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x0000137c addiu t9, t9, 0xe74 | t9 += fcn.00000e74;
0x00001380 move a0, s1 | a0 = s1;
0x00001384 bal 0xe74 | fcn_00000e74 ();
0x00001388 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000138c b 0x12a0 | goto label_3;
| label_6:
0x00001390 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00001394 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk;
0x00001398 lw a0, (v0) | a0 = *(v0);
0x0000139c move a3, s1 | a3 = s1;
0x000013a0 addiu a2, a2, 0x17f8 | a2 += str._s_is_not_a_regular_file_or_a_directory_n;
0x000013a4 addiu a1, zero, 1 | a1 = 1;
0x000013a8 jalr t9 | t9 ();
0x000013ac addiu s2, zero, -1 | s2 = -1;
0x000013b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000013b4 b 0x10a8 | goto label_2;
| label_4:
0x000013b8 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x000013bc lw t9, -0x7f7c(gp) | t9 = sym.imp.__errno_location;
0x000013c0 addiu s2, zero, -1 | s2 = -1;
0x000013c4 lw s0, (v0) | s0 = *(v0);
0x000013c8 jalr t9 | t9 ();
0x000013cc lw gp, 0x18(sp) | gp = *(var_18h);
0x000013d0 lw t9, -0x7f60(gp) | t9 = sym.imp.strerror;
0x000013d4 lw a0, (v0) | a0 = *(v0);
0x000013d8 jalr t9 | t9 ();
0x000013dc lw gp, 0x18(sp) | gp = *(var_18h);
0x000013e0 sw v0, 0x10(sp) | *(var_10h) = v0;
0x000013e4 move a3, s1 | a3 = s1;
0x000013e8 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x000013ec lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk;
0x000013f0 addiu a2, a2, 0x1730 | a2 += str.Unable_to_access__s:__s_n;
0x000013f4 addiu a1, zero, 1 | a1 = 1;
0x000013f8 move a0, s0 | a0 = s0;
0x000013fc jalr t9 | t9 ();
0x00001400 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001404 b 0x10a8 | goto label_2;
| label_7:
0x00001408 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x0000140c lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00001410 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk;
0x00001414 lw a0, (v0) | a0 = *(v0);
0x00001418 move a3, s1 | a3 = s1;
0x0000141c addiu a2, a2, 0x17e0 | a2 += str.Failed_to_sync_file__s_n;
0x00001420 addiu a1, zero, 1 | a1 = 1;
0x00001424 jalr t9 | t9 ();
0x00001428 addiu s2, zero, -1 | s2 = -1;
0x0000142c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001430 b 0x10a8 | goto label_2;
| label_8:
0x00001434 lw t9, -0x7f5c(gp) | t9 = sym.imp.__stack_chk_fail;
0x00001438 jalr t9 | t9 ();
0x0000143c nop |
| label_9:
0x00001440 lw s0, -0x7f4c(gp) | s0 = *((gp - 8147));
0x00001444 lw t9, -0x7f60(gp) | t9 = sym.imp.strerror;
0x00001448 lw a0, (v0) | a0 = *(v0);
0x0000144c lw s2, (s0) | s2 = *(s0);
0x00001450 jalr t9 | t9 ();
0x00001454 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001458 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0000145c move a3, s1 | a3 = s1;
0x00001460 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00001464 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk;
0x00001468 addiu a2, a2, 0x16e8 | a2 += str.Failed_to_open__s:__s_n;
0x0000146c addiu a1, zero, 1 | a1 = 1;
0x00001470 move a0, s2 | a0 = s2;
0x00001474 jalr t9 | t9 ();
0x00001478 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000147c b 0x12a0 | goto label_3;
| }
[*] Function sprintf used 2 times syncfile