[*] Binary protection state of ifupdown_config
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function popen tear down of ifupdown_config
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/ifupdown_config @ 0x4058f4 */
| #include <stdint.h>
|
; (fcn) sym.isMtkWifi__ () | void isMtkWifi_ () {
| /* isMtkWifi() */
0x004058f4 lui gp, 2 |
0x004058f8 addiu gp, gp, -0x8d4 |
0x004058fc addu gp, gp, t9 | gp += t9;
0x00405900 addiu sp, sp, -0xb0 |
0x00405904 sw ra, 0xac(sp) | *(var_ach) = ra;
0x00405908 sw fp, 0xa8(sp) | *(var_a8h) = fp;
0x0040590c move fp, sp | fp = sp;
0x00405910 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00405914 lw t8, -0x7e68(gp) | t8 = *((gp - 8090));
0x00405918 lw t8, (t8) | t8 = *(t8);
0x0040591c sw t8, 0xa4(fp) | *(arg_a4h) = t8;
0x00405920 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str._proc_bus_usb_devices */
0x00405924 addiu t8, t8, -0x4b98 | t8 += -0x4b98;
0x00405928 sw t8, 0x1c(fp) | *(arg_1ch) = t8;
0x0040592c sw zero, 0x18(fp) | *(arg_18h) = 0;
0x00405930 lw a0, 0x1c(fp) | a0 = *(arg_1ch);
0x00405934 move a1, zero | a1 = 0;
0x00405938 lw t8, -0x7eb8(gp) | t8 = sym.imp.access;
0x0040593c move t9, t8 | t9 = t8;
0x00405940 jalr t9 | t9 ();
0x00405944 nop |
0x00405948 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040594c move t8, v0 | t8 = v0;
0x00405950 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x00405954 andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 == 0) {
0x00405958 beqz t8, 0x405a48 | goto label_0;
| }
0x0040595c nop |
0x00405960 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.lsusb */
0x00405964 addiu a0, t8, -0x4b80 | a0 = t8 + -0x4b80;
0x00405968 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x0040596c addiu a1, t8, -0x4b78 | a1 = t8 + -0x4b78;
0x00405970 lw t8, -0x7f50(gp) | t8 = sym.imp.popen
0x00405974 move t9, t8 | t9 = t8;
0x00405978 jalr t9 | t9 ();
0x0040597c nop |
0x00405980 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405984 move t8, v0 | t8 = v0;
0x00405988 sw t8, 0x20(fp) | *(arg_20h) = t8;
0x0040598c lw t8, 0x20(fp) | t8 = *(arg_20h);
| if (t8 == 0) {
0x00405990 bnez t8, 0x4059a4 |
0x00405994 nop |
0x00405998 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x0040599c b 0x405b2c | goto label_1;
0x004059a0 nop |
| }
0x004059a4 b 0x4059ec | goto label_2;
0x004059a8 nop |
| do {
0x004059ac addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x004059b0 move a0, t8 | a0 = t8;
0x004059b4 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.148f */
0x004059b8 addiu a1, t8, -0x4b74 | a1 = t8 + -0x4b74;
0x004059bc lw t8, -0x7f30(gp) | t8 = sym.imp.strstr;
0x004059c0 move t9, t8 | t9 = t8;
0x004059c4 jalr t9 | t9 ();
0x004059c8 nop |
0x004059cc lw gp, 0x10(fp) | gp = *(arg_10h);
0x004059d0 move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x004059d4 beqz t8, 0x4059ec |
0x004059d8 nop |
0x004059dc addiu t8, zero, 1 | t8 = 1;
0x004059e0 sw t8, 0x18(fp) | *(arg_18h) = t8;
0x004059e4 b 0x405a24 | goto label_3;
0x004059e8 nop |
| }
| label_2:
0x004059ec addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x004059f0 move a0, t8 | a0 = t8;
0x004059f4 addiu a1, zero, 0x80 | a1 = 0x80;
0x004059f8 lw a2, 0x20(fp) | a2 = *(arg_20h);
0x004059fc lw t8, -0x7ef0(gp) | t8 = sym.imp.fgets;
0x00405a00 move t9, t8 | t9 = t8;
0x00405a04 jalr t9 | t9 ();
0x00405a08 nop |
0x00405a0c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405a10 move t8, v0 | t8 = v0;
0x00405a14 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x00405a18 andi t8, t8, 0xff | t8 &= 0xff;
0x00405a1c bnez t8, 0x4059ac |
| } while (t8 != 0);
0x00405a20 nop |
| label_3:
0x00405a24 lw a0, 0x20(fp) | a0 = *(arg_20h);
0x00405a28 lw t8, -0x7ec0(gp) | t8 = sym.imp.pclose;
0x00405a2c move t9, t8 | t9 = t8;
0x00405a30 jalr t9 | t9 ();
0x00405a34 nop |
0x00405a38 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405a3c lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00405a40 b 0x405b2c | goto label_1;
0x00405a44 nop |
| label_0:
0x00405a48 lw a0, 0x1c(fp) | a0 = *(arg_1ch);
0x00405a4c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x00405a50 addiu a1, t8, -0x4b78 | a1 = t8 + -0x4b78;
0x00405a54 lw t8, -0x7e90(gp) | t8 = sym.imp.fopen64;
0x00405a58 move t9, t8 | t9 = t8;
0x00405a5c jalr t9 | t9 ();
0x00405a60 nop |
0x00405a64 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405a68 move t8, v0 | t8 = v0;
0x00405a6c sw t8, 0x20(fp) | *(arg_20h) = t8;
0x00405a70 lw t8, 0x20(fp) | t8 = *(arg_20h);
0x00405a74 sltiu t8, t8, 1 | t8 = (t8 < 1) ? 1 : 0;
0x00405a78 andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 != 0) {
0x00405a7c beqz t8, 0x405a90 |
0x00405a80 nop |
0x00405a84 move t8, zero | t8 = 0;
0x00405a88 b 0x405b2c | goto label_1;
0x00405a8c nop |
| }
0x00405a90 b 0x405ad8 | goto label_4;
0x00405a94 nop |
| do {
0x00405a98 addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x00405a9c move a0, t8 | a0 = t8;
0x00405aa0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.Vendor148f */
0x00405aa4 addiu a1, t8, -0x4b6c | a1 = t8 + -0x4b6c;
0x00405aa8 lw t8, -0x7f30(gp) | t8 = sym.imp.strstr;
0x00405aac move t9, t8 | t9 = t8;
0x00405ab0 jalr t9 | t9 ();
0x00405ab4 nop |
0x00405ab8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405abc move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x00405ac0 beqz t8, 0x405ad8 |
0x00405ac4 nop |
0x00405ac8 addiu t8, zero, 1 | t8 = 1;
0x00405acc sw t8, 0x18(fp) | *(arg_18h) = t8;
0x00405ad0 b 0x405b10 | goto label_5;
0x00405ad4 nop |
| }
| label_4:
0x00405ad8 addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x00405adc move a0, t8 | a0 = t8;
0x00405ae0 addiu a1, zero, 0x80 | a1 = 0x80;
0x00405ae4 lw a2, 0x20(fp) | a2 = *(arg_20h);
0x00405ae8 lw t8, -0x7ef0(gp) | t8 = sym.imp.fgets;
0x00405aec move t9, t8 | t9 = t8;
0x00405af0 jalr t9 | t9 ();
0x00405af4 nop |
0x00405af8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405afc move t8, v0 | t8 = v0;
0x00405b00 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x00405b04 andi t8, t8, 0xff | t8 &= 0xff;
0x00405b08 bnez t8, 0x405a98 |
| } while (t8 != 0);
0x00405b0c nop |
| label_5:
0x00405b10 lw a0, 0x20(fp) | a0 = *(arg_20h);
0x00405b14 lw t8, -0x7ec4(gp) | t8 = sym.imp.fclose;
0x00405b18 move t9, t8 | t9 = t8;
0x00405b1c jalr t9 | t9 ();
0x00405b20 nop |
0x00405b24 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00405b28 lw t8, 0x18(fp) | t8 = *(arg_18h);
| label_1:
0x00405b2c move v0, t8 | v0 = t8;
0x00405b30 lw t8, -0x7e68(gp) | t8 = *((gp - 8090));
0x00405b34 lw v1, 0xa4(fp) | v1 = *(arg_a4h);
0x00405b38 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x00405b3c beq v1, t8, 0x405b54 |
0x00405b40 nop |
0x00405b44 lw t8, -0x7ecc(gp) | t8 = sym.imp.__stack_chk_fail;
0x00405b48 move t9, t8 | t9 = t8;
0x00405b4c jalr t9 | t9 ();
0x00405b50 nop |
| }
0x00405b54 move sp, fp |
0x00405b58 lw ra, 0xac(sp) | ra = *(var_ach);
0x00405b5c lw fp, 0xa8(sp) | fp = *(var_a8h);
0x00405b60 addiu sp, sp, 0xb0 |
0x00405b64 jr ra | return v1;
0x00405b68 nop |
| }
[*] Function popen used 2 times ifupdown_config