[*] Binary protection state of addon-pre-installer
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of addon-pre-installer
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/addon-pre-installer @ 0x1020 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 5440 named .text */
0x00001020 lui gp, 2 |
0x00001024 addiu gp, gp, -0x6010 |
0x00001028 addu gp, gp, t9 | gp += t9;
0x0000102c addiu sp, sp, -0x220 |
0x00001030 lw t9, -0x7f60(gp) | t9 = sym.imp.memset;
0x00001034 sw s1, 0x1fc(sp) | *(var_1fch) = s1;
0x00001038 lw s1, -0x7f10(gp) | s1 = *((gp - 8132));
0x0000103c sw s0, 0x1f8(sp) | *(var_1f8h) = s0;
0x00001040 addiu s0, sp, 0x28 | s0 = sp + 0x28;
0x00001044 lw v0, (s1) | v0 = *(s1);
0x00001048 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0000104c sw ra, 0x21c(sp) | *(var_21ch) = ra;
0x00001050 addiu a2, zero, 0xcc | a2 = 0xcc;
0x00001054 move a1, zero | a1 = 0;
0x00001058 move a0, s0 | a0 = s0;
0x0000105c sw fp, 0x218(sp) | *(var_218h) = fp;
0x00001060 sw s7, 0x214(sp) | *(var_214h) = s7;
0x00001064 sw s6, 0x210(sp) | *(var_210h) = s6;
0x00001068 sw s5, 0x20c(sp) | *(var_20ch) = s5;
0x0000106c sw s4, 0x208(sp) | *(var_208h) = s4;
0x00001070 sw s3, 0x204(sp) | *(var_204h) = s3;
0x00001074 sw s2, 0x200(sp) | *(var_200h) = s2;
0x00001078 sw v0, 0x1f4(sp) | *(var_1f4h) = v0;
0x0000107c jalr t9 | t9 ();
0x00001080 nop |
0x00001084 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001088 addiu a1, zero, 0x10 | a1 = 0x10;
0x0000108c sw zero, 0x24(sp) | *(var_24h) = 0;
0x00001090 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00001094 lw t9, -0x7fa0(gp) | t9 = sym.imp.g_file_test;
0x00001098 addiu a0, a0, 0x2d10 | a0 += str._etc_addon_conf_addonpreinstall;
0x0000109c jalr t9 | t9 ();
0x000010a0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x000010a4 bnez v0, 0x1298 | goto label_4;
| }
0x000010a8 lw t9, -0x7fd8(gp) | t9 = sym.install_addons;
0x000010ac addiu s2, sp, 0x24 | s2 = sp + 0x24;
0x000010b0 move a1, s2 | a1 = s2;
0x000010b4 move a0, zero | a0 = 0;
0x000010b8 bal 0x1eb8 | sym_install_addons ();
0x000010bc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x000010c0 bnez v0, 0x1104 |
0x000010c4 lw v0, 0x24(sp) | v0 = *(var_24h);
0x000010c8 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
| if (v0 == 0) {
0x000010cc beqz v0, 0x1104 | goto label_5;
| }
0x000010d0 lw a3, 8(v0) | a3 = *((v0 + 2));
0x000010d4 lw v0, 4(v0) | v0 = *((v0 + 1));
0x000010d8 lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x000010dc addiu a2, a2, 0x2d50 | a2 += str.Error_occured__s__d;
0x000010e0 addiu a1, zero, 1 | a1 = 1;
0x000010e4 addiu a0, zero, 3 | a0 = 3;
0x000010e8 sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x000010ec jalr t9 | t9 ();
0x000010f0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000010f4 lw t9, -0x7f8c(gp) | t9 = sym.imp.g_clear_error;
0x000010f8 move a0, s2 | a0 = s2;
0x000010fc jalr t9 | t9 ();
0x00001100 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_5:
0x00001104 lw t9, -0x7fd8(gp) | t9 = sym.install_addons;
0x00001108 move a1, s2 | a1 = s2;
0x0000110c move a0, s0 | a0 = s0;
0x00001110 bal 0x1eb8 | sym_install_addons ();
0x00001114 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00001118 bnez v0, 0x119c |
| label_0:
0x0000111c lw v0, 0x24(sp) | v0 = *(var_24h);
0x00001120 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
| if (v0 != 0) {
0x00001124 beqz v0, 0x115c |
0x00001128 lw a3, 8(v0) | a3 = *((v0 + 2));
0x0000112c lw v0, 4(v0) | v0 = *((v0 + 1));
0x00001130 lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x00001134 addiu a2, a2, 0x2d50 | a2 += str.Error_occured__s__d;
0x00001138 addiu a1, zero, 1 | a1 = 1;
0x0000113c addiu a0, zero, 3 | a0 = 3;
0x00001140 sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00001144 jalr t9 | t9 ();
0x00001148 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000114c lw t9, -0x7f8c(gp) | t9 = sym.imp.g_clear_error;
0x00001150 move a0, s2 | a0 = s2;
0x00001154 jalr t9 | t9 ();
0x00001158 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_1:
0x0000115c lw a0, 0x1f4(sp) | a0 = *(var_1f4h);
0x00001160 lw v1, (s1) | v1 = *(s1);
0x00001164 move v0, zero | v0 = 0;
| if (a0 != v1) {
0x00001168 bne a0, v1, 0x14ec | goto label_6;
| }
0x0000116c lw ra, 0x21c(sp) | ra = *(var_21ch);
0x00001170 lw fp, 0x218(sp) | fp = *(var_218h);
0x00001174 lw s7, 0x214(sp) | s7 = *(var_214h);
0x00001178 lw s6, 0x210(sp) | s6 = *(var_210h);
0x0000117c lw s5, 0x20c(sp) | s5 = *(var_20ch);
0x00001180 lw s4, 0x208(sp) | s4 = *(var_208h);
0x00001184 lw s3, 0x204(sp) | s3 = *(var_204h);
0x00001188 lw s2, 0x200(sp) | s2 = *(var_200h);
0x0000118c lw s1, 0x1fc(sp) | s1 = *(var_1fch);
0x00001190 lw s0, 0x1f8(sp) | s0 = *(var_1f8h);
0x00001194 addiu sp, sp, 0x220 |
0x00001198 jr ra | return v0;
| }
0x0000119c lw s4, -0x7fdc(gp) | s4 = *((gp - 8183));
0x000011a0 lw t9, -0x7f70(gp) | t9 = sym.imp.access;
0x000011a4 move a1, zero | a1 = 0;
0x000011a8 addiu a0, s4, 0x2878 | a0 = s4 + str._etc_addon_conf_addonautostart;
0x000011ac jalr t9 | t9 ();
0x000011b0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x000011b4 beqz v0, 0x12b8 | goto label_7;
| }
0x000011b8 lw s5, -0x7fdc(gp) | s5 = *((gp - 8183));
| label_2:
0x000011bc lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x000011c0 lw t9, -0x7f04(gp) | t9 = sym.imp.fopen;
0x000011c4 addiu a1, a1, 0x2e14 | a1 += 0x2e14;
0x000011c8 addiu a0, s5, 0x2d68 | a0 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x000011cc jalr t9 | t9 ();
0x000011d0 move s3, v0 | s3 = v0;
0x000011d4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x000011d8 beqz v0, 0x1450 | goto label_8;
| }
0x000011dc lw a2, 0x28(sp) | a2 = *(var_28h);
0x000011e0 lw t9, -0x7f68(gp) | t9 = sym.imp.fileno;
| if (a2 == 0) {
0x000011e4 beqz a2, 0x1224 | goto label_9;
| }
0x000011e8 lw s6, -0x7fdc(gp) | s6 = *((gp - 8183));
0x000011ec addiu s6, s6, 0x2be4 | s6 += 0x2be4;
| do {
0x000011f0 lw t9, -0x7ef8(gp) | t9 = sym.imp.g_fprintf
0x000011f4 move a1, s6 | a1 = s6;
0x000011f8 move a0, s3 | a0 = s3;
0x000011fc jalr t9 | t9 ();
0x00001200 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001204 addiu s0, s0, 4 | s0 += 4;
0x00001208 lw t9, -0x7efc(gp) | t9 = sym.imp.g_free;
0x0000120c lw a0, -4(s0) | a0 = *((s0 - 1));
0x00001210 jalr t9 | t9 ();
0x00001214 lw a2, (s0) | a2 = *(s0);
0x00001218 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000121c bnez a2, 0x11f0 |
| } while (a2 != 0);
0x00001220 lw t9, -0x7f68(gp) | t9 = sym.imp.fileno;
| label_9:
0x00001224 move a0, s3 | a0 = s3;
0x00001228 jalr t9 | t9 ();
0x0000122c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001230 lw t9, -0x7f54(gp) | t9 = sym.imp.fsync;
0x00001234 move a0, v0 | a0 = v0;
0x00001238 jalr t9 | t9 ();
0x0000123c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00001240 bltz v0, 0x1408 | goto label_10;
| }
| label_3:
0x00001244 lw t9, -0x7f88(gp) | t9 = sym.imp.fclose;
0x00001248 move a0, s3 | a0 = s3;
0x0000124c jalr t9 | t9 ();
0x00001250 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001254 addiu a1, s4, 0x2878 | a1 = s4 + str._etc_addon_conf_addonautostart;
0x00001258 lw t9, -0x7f4c(gp) | t9 = sym.imp.rename;
0x0000125c addiu a0, s5, 0x2d68 | a0 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x00001260 jalr t9 | t9 ();
0x00001264 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00001268 beqz v0, 0x111c | goto label_0;
| }
0x0000126c lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001270 lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x00001274 addiu s4, s4, 0x2878 | s4 += str._etc_addon_conf_addonautostart;
0x00001278 sw s4, 0x10(sp) | *(var_10h_2) = s4;
0x0000127c addiu a3, s5, 0x2d68 | a3 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x00001280 addiu a2, a2, 0x2e3c | a2 += str.Rename__s_to__s_failed;
0x00001284 addiu a1, zero, 1 | a1 = 1;
0x00001288 addiu a0, zero, 4 | a0 = 4;
0x0000128c jalr t9 | t9 ();
0x00001290 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001294 b 0x111c | goto label_0;
| label_4:
0x00001298 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x0000129c lw t9, -0x7f6c(gp) | t9 = sym.imp.g_log;
0x000012a0 addiu a2, a2, 0x2d30 | a2 += str.Not_first_boot__nothing_to_do.;
0x000012a4 addiu a1, zero, 0x20 | a1 = 0x20;
0x000012a8 move a0, zero | a0 = 0;
0x000012ac jalr t9 | t9 ();
0x000012b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000012b4 b 0x115c | goto label_1;
| label_7:
0x000012b8 lw s3, -0x7fdc(gp) | s3 = *((gp - 8183));
0x000012bc lw t9, -0x7f04(gp) | t9 = sym.imp.fopen;
0x000012c0 addiu a1, s3, 0x28dc | a1 = s3 + 0x28dc;
0x000012c4 addiu a0, s4, 0x2878 | a0 = s4 + str._etc_addon_conf_addonautostart;
0x000012c8 jalr t9 | t9 ();
0x000012cc lw gp, 0x18(sp) | gp = *(var_18h);
0x000012d0 move a0, v0 | a0 = v0;
0x000012d4 lw t9, -0x7f68(gp) | t9 = sym.imp.fileno;
0x000012d8 move s7, v0 | s7 = v0;
0x000012dc jalr t9 | t9 ();
0x000012e0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000012e4 addiu a1, zero, 2 | a1 = 2;
0x000012e8 lw t9, -0x7f48(gp) | t9 = sym.imp.flock;
0x000012ec move a0, v0 | a0 = v0;
0x000012f0 jalr t9 | t9 ();
0x000012f4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x000012f8 bnez v0, 0x13e0 | goto label_11;
| }
0x000012fc lw t9, -0x7f04(gp) | t9 = sym.imp.fopen;
0x00001300 addiu a1, s3, 0x28dc | a1 = s3 + 0x28dc;
0x00001304 addiu a0, s4, 0x2878 | a0 = s4 + str._etc_addon_conf_addonautostart;
0x00001308 jalr t9 | t9 ();
0x0000130c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001310 move s3, v0 | s3 = v0;
0x00001314 lw s5, -0x7fdc(gp) | s5 = *((gp - 8183));
0x00001318 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x0000131c lw t9, -0x7f04(gp) | t9 = sym.imp.fopen;
0x00001320 addiu a1, a1, 0x2d64 | a1 += 0x2d64;
0x00001324 addiu a0, s5, 0x2d68 | a0 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x00001328 jalr t9 | t9 ();
0x0000132c move s6, v0 | s6 = v0;
0x00001330 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s3 == 0) {
0x00001334 beqz s3, 0x1498 | goto label_12;
| }
0x00001338 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
| if (v0 == 0) {
0x0000133c beqz v0, 0x149c | goto label_13;
| }
0x00001340 addiu fp, sp, 0xf4 | fp = sp + 0xf4;
0x00001344 b 0x135c |
| while (v0 != 0) {
0x00001348 lw t9, -0x7fa4(gp) | t9 = sym.imp.fputs;
0x0000134c move a1, s6 | a1 = s6;
0x00001350 move a0, fp | a0 = fp;
0x00001354 jalr t9 | t9 ();
0x00001358 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000135c lw t9, -0x7f18(gp) | t9 = sym.imp.fgets;
0x00001360 move a2, s3 | a2 = s3;
0x00001364 addiu a1, zero, 0x100 | a1 = 0x100;
0x00001368 move a0, fp | a0 = fp;
0x0000136c jalr t9 | t9 ();
0x00001370 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001374 bnez v0, 0x1348 |
| }
0x00001378 lw t9, -0x7f00(gp) | t9 = sym.imp.fflush;
0x0000137c move a0, s6 | a0 = s6;
0x00001380 jalr t9 | t9 ();
0x00001384 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001388 lw t9, -0x7f88(gp) | t9 = sym.imp.fclose;
0x0000138c move a0, s3 | a0 = s3;
0x00001390 jalr t9 | t9 ();
0x00001394 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001398 lw t9, -0x7f88(gp) | t9 = sym.imp.fclose;
0x0000139c move a0, s6 | a0 = s6;
0x000013a0 jalr t9 | t9 ();
0x000013a4 lw gp, 0x18(sp) | gp = *(var_18h);
| do {
0x000013a8 lw t9, -0x7f88(gp) | t9 = sym.imp.fclose;
0x000013ac move a0, s7 | a0 = s7;
0x000013b0 jalr t9 | t9 ();
0x000013b4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000013b8 lw t9, -0x7f68(gp) | t9 = sym.imp.fileno;
0x000013bc move a0, s7 | a0 = s7;
0x000013c0 jalr t9 | t9 ();
0x000013c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000013c8 addiu a1, zero, 8 | a1 = 8;
0x000013cc lw t9, -0x7f48(gp) | t9 = sym.imp.flock;
0x000013d0 move a0, v0 | a0 = v0;
0x000013d4 jalr t9 | t9 ();
0x000013d8 lw gp, 0x18(sp) | gp = *(var_18h);
0x000013dc b 0x11bc | goto label_2;
| label_11:
0x000013e0 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000013e4 lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x000013e8 addiu a3, s4, 0x2878 | a3 = s4 + str._etc_addon_conf_addonautostart;
0x000013ec addiu a2, a2, 0x2de0 | a2 += str.Flock:_s_failed__previous_entries_will_be_deleted;
0x000013f0 addiu a1, zero, 1 | a1 = 1;
0x000013f4 lw s5, -0x7fdc(gp) | s5 = *((gp - 8183));
0x000013f8 addiu a0, zero, 4 | a0 = 4;
0x000013fc jalr t9 | t9 ();
0x00001400 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001404 b 0x11bc | goto label_2;
| label_10:
0x00001408 lw t9, -0x7f64(gp) | t9 = sym.imp.__errno_location;
0x0000140c jalr t9 | t9 ();
0x00001410 nop |
0x00001414 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001418 lw t9, -0x7f3c(gp) | t9 = sym.imp.strerror;
0x0000141c lw a0, (v0) | a0 = *(v0);
0x00001420 jalr t9 | t9 ();
0x00001424 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001428 sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x0000142c addiu a3, s5, 0x2d68 | a3 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x00001430 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001434 lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x00001438 addiu a2, a2, 0x2e18 | a2 += str.Not_possible_to_fsync_file__s___s;
0x0000143c addiu a1, zero, 1 | a1 = 1;
0x00001440 addiu a0, zero, 4 | a0 = 4;
0x00001444 jalr t9 | t9 ();
0x00001448 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000144c b 0x1244 | goto label_3;
| label_8:
0x00001450 lw t9, -0x7f64(gp) | t9 = sym.imp.__errno_location;
0x00001454 jalr t9 | t9 ();
0x00001458 nop |
0x0000145c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001460 lw t9, -0x7f3c(gp) | t9 = sym.imp.strerror;
0x00001464 lw a0, (v0) | a0 = *(v0);
0x00001468 jalr t9 | t9 ();
0x0000146c lw gp, 0x18(sp) | gp = *(var_18h);
0x00001470 sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00001474 addiu a3, s5, 0x2d68 | a3 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x00001478 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x0000147c lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x00001480 addiu a2, a2, 0x2e54 | a2 += str.Not_possible_to_open_file_for_writing__s___s;
0x00001484 addiu a1, zero, 1 | a1 = 1;
0x00001488 addiu a0, zero, 3 | a0 = 3;
0x0000148c jalr t9 | t9 ();
0x00001490 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001494 b 0x111c | goto label_0;
| label_12:
0x00001498 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
| label_13:
0x0000149c lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x000014a0 addiu s3, s5, 0x2d68 | s3 = s5 + str._etc_addon_conf_addonautostart.tmp;
0x000014a4 addiu a3, s4, 0x2878 | a3 = s4 + str._etc_addon_conf_addonautostart;
0x000014a8 addiu a2, a2, 0x2d8c | a2 += str.Error_opening:__s_or__s_in_helper_function;
0x000014ac addiu a1, zero, 1 | a1 = 1;
0x000014b0 addiu a0, zero, 4 | a0 = 4;
0x000014b4 sw s3, 0x10(sp) | *(var_10h_2) = s3;
0x000014b8 jalr t9 | t9 ();
0x000014bc lw gp, 0x18(sp) | gp = *(var_18h);
0x000014c0 addiu v0, s4, 0x2878 | v0 = s4 + str._etc_addon_conf_addonautostart;
0x000014c4 sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x000014c8 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000014cc lw t9, -0x7f74(gp) | t9 = sym.imp.__syslog_chk;
0x000014d0 move a3, s3 | a3 = s3;
0x000014d4 addiu a2, a2, 0x2db8 | a2 += str.Failed_to_copy_original_file__s_to__s;
0x000014d8 addiu a1, zero, 1 | a1 = 1;
0x000014dc addiu a0, zero, 4 | a0 = 4;
0x000014e0 jalr t9 | t9 ();
0x000014e4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000014e8 b 0x13a8 |
| } while (1);
| label_6:
0x000014ec lw t9, -0x7f1c(gp) | t9 = sym.imp.__stack_chk_fail;
0x000014f0 jalr t9 | t9 ();
0x000014f4 nop |
0x000014f8 nop |
0x000014fc nop |
| }
[*] Function fprintf used 2 times addon-pre-installer