[*] Binary protection state of syncfile
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of syncfile
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/syncfile @ 0xe74 */
| #include <stdint.h>
|
; (fcn) fcn.00000e74 () | void fcn_00000e74 () {
0x00000e74 lui gp, 2 |
0x00000e78 addiu gp, gp, -0x6e64 |
0x00000e7c addu gp, gp, t9 | gp += t9;
0x00000e80 addiu sp, sp, -0x38 |
0x00000e84 lw t9, -0x7f6c(gp) | t9 = sym.imp.open;
0x00000e88 move a1, zero | a1 = 0;
0x00000e8c sw gp, 0x18(sp) | *(var_18h_2) = gp;
0x00000e90 sw s2, 0x2c(sp) | *(var_2ch) = s2;
0x00000e94 sw ra, 0x34(sp) | *(var_34h) = ra;
0x00000e98 sw s3, 0x30(sp) | *(var_30h) = s3;
0x00000e9c sw s1, 0x28(sp) | *(var_28h) = s1;
0x00000ea0 sw s0, 0x24(sp) | *(var_24h_2) = s0;
0x00000ea4 move s2, a0 | s2 = a0;
0x00000ea8 jalr t9 | t9 ();
0x00000eac lw gp, 0x18(sp) | gp = *(var_18h_2);
| if (v0 == 0) {
0x00000eb0 beqz v0, 0xf54 | goto label_1;
| }
0x00000eb4 lw t9, -0x7f74(gp) | t9 = sym.imp.fsync;
0x00000eb8 move a0, v0 | a0 = v0;
0x00000ebc move s0, v0 | s0 = v0;
0x00000ec0 jalr t9 | t9 ();
0x00000ec4 lw gp, 0x18(sp) | gp = *(var_18h_2);
| if (v0 < 0) {
0x00000ec8 bltz v0, 0xf04 | goto label_2;
| }
0x00000ecc move s1, zero | s1 = 0;
| do {
0x00000ed0 lw t9, -0x7fa0(gp) | t9 = sym.imp.close;
0x00000ed4 move a0, s0 | a0 = s0;
0x00000ed8 jalr t9 | t9 ();
0x00000edc lw gp, 0x18(sp) | gp = *(var_18h_2);
| if (v0 < 0) {
0x00000ee0 bltz v0, 0xfa4 | goto label_3;
| }
0x00000ee4 lw ra, 0x34(sp) | ra = *(var_34h);
| label_0:
0x00000ee8 move v0, s1 | v0 = s1;
0x00000eec lw s3, 0x30(sp) | s3 = *(var_30h);
0x00000ef0 lw s2, 0x2c(sp) | s2 = *(var_2ch);
0x00000ef4 lw s1, 0x28(sp) | s1 = *(var_28h);
0x00000ef8 lw s0, 0x24(sp) | s0 = *(var_24h_2);
0x00000efc addiu sp, sp, 0x38 |
0x00000f00 jr ra | return v0;
| label_2:
0x00000f04 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x00000f08 lw t9, -0x7f7c(gp) | t9 = sym.imp.__errno_location;
0x00000f0c addiu s1, zero, -1 | s1 = -1;
0x00000f10 lw s3, (v0) | s3 = *(v0);
0x00000f14 jalr t9 | t9 ();
0x00000f18 lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000f1c lw t9, -0x7f60(gp) | t9 = sym.imp.strerror;
0x00000f20 lw a0, (v0) | a0 = *(v0);
0x00000f24 jalr t9 | t9 ();
0x00000f28 lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000f2c sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00000f30 move a3, s2 | a3 = s2;
0x00000f34 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000f38 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk
0x00000f3c addiu a2, a2, 0x1700 | a2 += str.Failed_to_sync__s:__s_n;
0x00000f40 addiu a1, zero, 1 | a1 = 1;
0x00000f44 move a0, s3 | a0 = s3;
0x00000f48 jalr t9 | t9 ();
0x00000f4c lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000f50 b 0xed0 |
| } while (1);
| label_1:
0x00000f54 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x00000f58 lw t9, -0x7f7c(gp) | t9 = sym.imp.__errno_location;
0x00000f5c addiu s1, zero, -1 | s1 = -1;
0x00000f60 lw s0, (v0) | s0 = *(v0);
0x00000f64 jalr t9 | t9 ();
0x00000f68 lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000f6c lw t9, -0x7f60(gp) | t9 = sym.imp.strerror;
0x00000f70 lw a0, (v0) | a0 = *(v0);
0x00000f74 jalr t9 | t9 ();
0x00000f78 lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000f7c sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00000f80 move a3, s2 | a3 = s2;
0x00000f84 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000f88 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk
0x00000f8c addiu a2, a2, 0x16e8 | a2 += str.Failed_to_open__s:__s_n;
0x00000f90 addiu a1, zero, 1 | a1 = 1;
0x00000f94 move a0, s0 | a0 = s0;
0x00000f98 jalr t9 | t9 ();
0x00000f9c lw ra, 0x34(sp) | ra = *(var_34h);
0x00000fa0 b 0xee8 | goto label_0;
| label_3:
0x00000fa4 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x00000fa8 lw t9, -0x7f7c(gp) | t9 = sym.imp.__errno_location;
0x00000fac addiu s1, zero, -1 | s1 = -1;
0x00000fb0 lw s0, (v0) | s0 = *(v0);
0x00000fb4 jalr t9 | t9 ();
0x00000fb8 lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000fbc lw t9, -0x7f60(gp) | t9 = sym.imp.strerror;
0x00000fc0 lw a0, (v0) | a0 = *(v0);
0x00000fc4 jalr t9 | t9 ();
0x00000fc8 lw gp, 0x18(sp) | gp = *(var_18h_2);
0x00000fcc sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00000fd0 move a3, s2 | a3 = s2;
0x00000fd4 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000fd8 lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk
0x00000fdc addiu a2, a2, 0x1718 | a2 += str.Failed_to_close__s:__s_n;
0x00000fe0 addiu a1, zero, 1 | a1 = 1;
0x00000fe4 move a0, s0 | a0 = s0;
0x00000fe8 jalr t9 | t9 ();
0x00000fec lw ra, 0x34(sp) | ra = *(var_34h);
0x00000ff0 b 0xee8 | goto label_0;
| }
; 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;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/syncfile @ 0xa20 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 2864 named .text */
0x00000a20 lui gp, 2 |
0x00000a24 addiu gp, gp, -0x6a10 |
0x00000a28 addu gp, gp, t9 | gp += t9;
0x00000a2c addiu sp, sp, -0x38 |
0x00000a30 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x00000a34 lw s0, -0x7fd8(gp) | s0 = *((gp - 8182));
0x00000a38 sw s5, 0x30(sp) | *(var_30h) = s5;
0x00000a3c sw s4, 0x2c(sp) | *(var_2ch) = s4;
0x00000a40 lw s5, -0x7fdc(gp) | s5 = *((gp - 8183));
0x00000a44 lw s4, -0x7fdc(gp) | s4 = *((gp - 8183));
0x00000a48 sw s3, 0x28(sp) | *(var_28h) = s3;
0x00000a4c sw s2, 0x24(sp) | *(var_24h) = s2;
0x00000a50 sw s1, 0x20(sp) | *(var_20h) = s1;
0x00000a54 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00000a58 sw ra, 0x34(sp) | *(var_34h) = ra;
0x00000a5c move s2, a0 | s2 = a0;
0x00000a60 move s1, a1 | s1 = a1;
0x00000a64 addiu s0, s0, 0x194c | s0 += 0x194c;
0x00000a68 addiu s3, zero, 1 | s3 = 1;
| do {
| label_0:
0x00000a6c lw t9, -0x7f8c(gp) | t9 = sym.imp.__posix_getopt;
0x00000a70 move a2, s0 | a2 = s0;
0x00000a74 move a1, s1 | a1 = s1;
0x00000a78 move a0, s2 | a0 = s2;
0x00000a7c jalr t9 | t9 ();
0x00000a80 addiu v1, zero, -1 | v1 = -1;
0x00000a84 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == v1) {
0x00000a88 beq v0, v1, 0xb38 | goto label_2;
| }
0x00000a8c addiu v1, zero, 0x68 | v1 = 0x68;
0x00000a90 slti v1, v0, 0x69 | v1 = (v0 < 0x69) ? 1 : 0;
| if (v0 == v1) {
0x00000a94 beq v0, v1, 0xb04 | goto label_3;
| }
0x00000a98 addiu v1, zero, 0x72 | v1 = 0x72;
| if (v1 != 0) {
0x00000a9c bnez v1, 0xab0 | goto label_4;
| }
0x00000aa0 addiu v1, zero, 0x76 | v1 = 0x76;
| if (v0 != v1) {
0x00000aa4 bne v0, v1, 0xaf4 | goto label_5;
| }
0x00000aa8 sw s3, 0x20f0(s5) | *((s5 + 2108)) = s3;
0x00000aac b 0xa6c |
| } while (1);
| label_4:
0x00000ab0 addiu v1, zero, 0x3f | v1 = 0x3f;
0x00000ab4 lw a1, -0x7fd8(gp) | a1 = *((gp - 8182));
| if (v0 != v1) {
0x00000ab8 bne v0, v1, 0xc64 | goto label_6;
| }
0x00000abc lw t9, -0x7f84(gp) | t9 = sym.imp.__printf_chk;
0x00000ac0 addiu a1, a1, 0x1824 | a1 += str.Usage:_syncfile___vrh___PATH__n;
0x00000ac4 addiu a0, zero, 1 | a0 = 1;
0x00000ac8 jalr t9 | t9 ();
0x00000acc addiu v0, zero, 1 | v0 = 1;
| do {
| label_1:
0x00000ad0 lw ra, 0x34(sp) | ra = *(var_34h);
0x00000ad4 lw s5, 0x30(sp) | s5 = *(var_30h);
0x00000ad8 lw s4, 0x2c(sp) | s4 = *(var_2ch);
0x00000adc lw s3, 0x28(sp) | s3 = *(var_28h);
0x00000ae0 lw s2, 0x24(sp) | s2 = *(var_24h);
0x00000ae4 lw s1, 0x20(sp) | s1 = *(var_20h);
0x00000ae8 lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x00000aec addiu sp, sp, 0x38 |
0x00000af0 jr ra | return v0;
| label_5:
0x00000af4 lw t9, -0x7f9c(gp) | t9 = sym.imp.abort;
| if (v0 != v1) {
0x00000af8 bne v0, v1, 0xc68 | goto label_7;
| }
0x00000afc sw s3, 0x20f4(s4) | *((s4 + 2109)) = s3;
0x00000b00 b 0xa6c | goto label_0;
| label_3:
0x00000b04 lw a1, -0x7fd8(gp) | a1 = *((gp - 8182));
0x00000b08 lw t9, -0x7f84(gp) | t9 = sym.imp.__printf_chk;
0x00000b0c addiu a1, a1, 0x1824 | a1 += str.Usage:_syncfile___vrh___PATH__n;
0x00000b10 addiu a0, zero, 1 | a0 = 1;
0x00000b14 jalr t9 | t9 ();
0x00000b18 lw gp, 0x10(sp) | gp = *(var_10h);
0x00000b1c addiu a0, zero, 1 | a0 = 1;
0x00000b20 lw a1, -0x7fd8(gp) | a1 = *((gp - 8182));
0x00000b24 lw t9, -0x7f84(gp) | t9 = sym.imp.__printf_chk;
0x00000b28 addiu a1, a1, 0x1848 | a1 += str.syncfile_is_a_wrapper_for_the_fsync_C_function_to_make_it_possible_nto_force_the_OS_to_flush_files_in_its_buffers_to_the_physical_media_nfrom_e.g._a_shell_script._n_nOptions:_n___v_Verbose_output_n___r_Recursively_sync_directory_paths_n___h_Show_this_help_message_n;
0x00000b2c jalr t9 | t9 ();
0x00000b30 move v0, zero | v0 = 0;
0x00000b34 b 0xad0 |
| } while (1);
| label_2:
0x00000b38 lw s3, -0x7f58(gp) | s3 = *((gp - 8150));
0x00000b3c lw s0, (s3) | s0 = *(s3);
0x00000b40 sll s0, s0, 2 | s0 <<= 2;
| if (s0 == s2) {
0x00000b44 beq s0, s2, 0xbf8 | goto label_8;
| }
0x00000b48 lwx s0, s0(s1) | __asm ("lwx s0, s0(s1)");
0x00000b4c lb v0, (s0) | v0 = *(s0);
0x00000b50 lw t9, -0x7f70(gp) | t9 = sym.imp.strlen;
| if (v0 == 0) {
0x00000b54 beqz v0, 0xc34 | goto label_9;
| }
0x00000b58 move a0, s0 | a0 = s0;
0x00000b5c jalr t9 | t9 ();
0x00000b60 lw gp, 0x10(sp) | gp = *(var_10h);
0x00000b64 addiu a1, zero, 0x2f | a1 = 0x2f;
0x00000b68 b 0xb78 |
| while (v1 == 0) {
0x00000b6c lb a0, -1(v1) | a0 = *((v1 - 1));
0x00000b70 addiu v0, v0, -1 | v0 += -1;
| if (a0 != a1) {
0x00000b74 bne a0, a1, 0xb84 | goto label_10;
| }
0x00000b78 slti v1, v0, 2 | v1 = (v0 < 2) ? 1 : 0;
0x00000b7c addu v1, s0, v0 | v1 = s0 + v0;
0x00000b80 beqz v1, 0xb6c |
| }
| label_10:
0x00000b84 sb zero, (v1) | *(v1) = 0;
0x00000b88 lw a0, (s3) | a0 = *(s3);
0x00000b8c lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x00000b90 sll a0, a0, 2 | a0 <<= 2;
0x00000b94 addiu t9, t9, 0xff4 | t9 += fcn.00000ff4;
0x00000b98 lwx a0, a0(s1) | __asm ("lwx a0, a0(s1)");
0x00000b9c bal 0xff4 | fcn_00000ff4 ();
0x00000ba0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x00000ba4 bltz v0, 0xc5c |
0x00000ba8 lw a0, (s3) | a0 = *(s3);
0x00000bac lw t9, -0x7f64(gp) | t9 = sym.imp.dirname;
0x00000bb0 sll a0, a0, 2 | a0 <<= 2;
0x00000bb4 lwx a0, a0(s1) | __asm ("lwx a0, a0(s1)");
0x00000bb8 jalr t9 | t9 ();
0x00000bbc lw gp, 0x10(sp) | gp = *(var_10h);
0x00000bc0 move a1, v0 | a1 = v0;
0x00000bc4 move s0, v0 | s0 = v0;
0x00000bc8 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00000bcc lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x00000bd0 addiu t9, t9, 0xde0 | t9 += fcn.00000de0;
0x00000bd4 addiu a0, a0, 0x197c | a0 += str.Syncing_parent_dir:__s_n;
0x00000bd8 bal 0xde0 | fcn_00000de0 ();
0x00000bdc lw gp, 0x10(sp) | gp = *(var_10h);
0x00000be0 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
0x00000be4 addiu t9, t9, 0xe74 | t9 += fcn.00000e74;
0x00000be8 move a0, s0 | a0 = s0;
0x00000bec bal 0xe74 | fcn_00000e74 ();
0x00000bf0 srl v0, v0, 0x1f | v0 >>= 0x1f;
0x00000bf4 b 0xad0 | goto label_1;
| label_8:
0x00000bf8 lw a1, -0x7fd8(gp) | a1 = *((gp - 8182));
0x00000bfc lw t9, -0x7f84(gp) | t9 = sym.imp.__printf_chk;
0x00000c00 addiu a1, a1, 0x1824 | a1 += str.Usage:_syncfile___vrh___PATH__n;
0x00000c04 addiu a0, zero, 1 | a0 = 1;
0x00000c08 jalr t9 | t9 ();
0x00000c0c lw gp, 0x10(sp) | gp = *(var_10h);
0x00000c10 addiu a1, zero, 1 | a1 = 1;
0x00000c14 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x00000c18 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000c1c lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk
0x00000c20 lw a0, (v0) | a0 = *(v0);
0x00000c24 addiu a2, a2, 0x1950 | a2 += str.No_path_specified_n;
0x00000c28 jalr t9 | t9 ();
0x00000c2c addiu v0, zero, 1 | v0 = 1;
0x00000c30 b 0xad0 | goto label_1;
| label_9:
0x00000c34 lw v0, -0x7f4c(gp) | v0 = *((gp - 8147));
0x00000c38 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000c3c lw t9, -0x7f90(gp) | t9 = sym.imp.__fprintf_chk
0x00000c40 lw a0, (v0) | a0 = *(v0);
0x00000c44 move a3, s0 | a3 = s0;
0x00000c48 addiu a2, a2, 0x1964 | a2 += str._s_is_not_a_valid_path_n;
0x00000c4c addiu a1, zero, 1 | a1 = 1;
0x00000c50 jalr t9 | t9 ();
0x00000c54 addiu v0, zero, 1 | v0 = 1;
0x00000c58 b 0xad0 | goto label_1;
| }
0x00000c5c addiu v0, zero, 1 | v0 = 1;
0x00000c60 b 0xad0 | goto label_1;
| label_6:
0x00000c64 lw t9, -0x7f9c(gp) | t9 = sym.imp.abort;
| label_7:
0x00000c68 jalr t9 | t9 ();
0x00000c6c nop |
| }
[*] Function fprintf used 12 times syncfile