[*] Binary protection state of network_setup
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function popen tear down of network_setup
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/network_setup @ 0x40c354 */
| #include <stdint.h>
|
; (fcn) sym.isMtkWifi__ () | void isMtkWifi_ () {
| /* isMtkWifi() */
0x0040c354 lui gp, 2 |
0x0040c358 addiu gp, gp, -0x314 |
0x0040c35c addu gp, gp, t9 | gp += t9;
0x0040c360 addiu sp, sp, -0xb0 |
0x0040c364 sw ra, 0xac(sp) | *(var_ach) = ra;
0x0040c368 sw fp, 0xa8(sp) | *(var_a8h) = fp;
0x0040c36c move fp, sp | fp = sp;
0x0040c370 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040c374 lw t8, -0x7dd0(gp) | t8 = *((gp - 8052));
0x0040c378 lw t8, (t8) | t8 = *(t8);
0x0040c37c sw t8, 0xa4(fp) | *(arg_a4h) = t8;
0x0040c380 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str._proc_bus_usb_devices */
0x0040c384 addiu t8, t8, 0x2328 | t8 += 0x2328;
0x0040c388 sw t8, 0x1c(fp) | *(arg_1ch) = t8;
0x0040c38c sw zero, 0x18(fp) | *(arg_18h) = 0;
0x0040c390 lw a0, 0x1c(fp) | a0 = *(arg_1ch);
0x0040c394 move a1, zero | a1 = 0;
0x0040c398 lw t8, -0x7e44(gp) | t8 = sym.imp.access;
0x0040c39c move t9, t8 | t9 = t8;
0x0040c3a0 jalr t9 | t9 ();
0x0040c3a4 nop |
0x0040c3a8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c3ac move t8, v0 | t8 = v0;
0x0040c3b0 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x0040c3b4 andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 == 0) {
0x0040c3b8 beqz t8, 0x40c4a8 | goto label_0;
| }
0x0040c3bc nop |
0x0040c3c0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.lsusb */
0x0040c3c4 addiu a0, t8, 0x2340 | a0 = t8 + 0x2340;
0x0040c3c8 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x0040c3cc addiu a1, t8, 0x2348 | a1 = t8 + 0x2348;
0x0040c3d0 lw t8, -0x7f08(gp) | t8 = sym.imp.popen
0x0040c3d4 move t9, t8 | t9 = t8;
0x0040c3d8 jalr t9 | t9 ();
0x0040c3dc nop |
0x0040c3e0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c3e4 move t8, v0 | t8 = v0;
0x0040c3e8 sw t8, 0x20(fp) | *(arg_20h) = t8;
0x0040c3ec lw t8, 0x20(fp) | t8 = *(arg_20h);
| if (t8 == 0) {
0x0040c3f0 bnez t8, 0x40c404 |
0x0040c3f4 nop |
0x0040c3f8 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x0040c3fc b 0x40c58c | goto label_1;
0x0040c400 nop |
| }
0x0040c404 b 0x40c44c | goto label_2;
0x0040c408 nop |
| do {
0x0040c40c addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x0040c410 move a0, t8 | a0 = t8;
0x0040c414 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.148f */
0x0040c418 addiu a1, t8, 0x234c | a1 = t8 + 0x234c;
0x0040c41c lw t8, -0x7edc(gp) | t8 = sym.imp.strstr;
0x0040c420 move t9, t8 | t9 = t8;
0x0040c424 jalr t9 | t9 ();
0x0040c428 nop |
0x0040c42c lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c430 move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x0040c434 beqz t8, 0x40c44c |
0x0040c438 nop |
0x0040c43c addiu t8, zero, 1 | t8 = 1;
0x0040c440 sw t8, 0x18(fp) | *(arg_18h) = t8;
0x0040c444 b 0x40c484 | goto label_3;
0x0040c448 nop |
| }
| label_2:
0x0040c44c addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x0040c450 move a0, t8 | a0 = t8;
0x0040c454 addiu a1, zero, 0x80 | a1 = 0x80;
0x0040c458 lw a2, 0x20(fp) | a2 = *(arg_20h);
0x0040c45c lw t8, -0x7e84(gp) | t8 = sym.imp.fgets;
0x0040c460 move t9, t8 | t9 = t8;
0x0040c464 jalr t9 | t9 ();
0x0040c468 nop |
0x0040c46c lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c470 move t8, v0 | t8 = v0;
0x0040c474 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x0040c478 andi t8, t8, 0xff | t8 &= 0xff;
0x0040c47c bnez t8, 0x40c40c |
| } while (t8 != 0);
0x0040c480 nop |
| label_3:
0x0040c484 lw a0, 0x20(fp) | a0 = *(arg_20h);
0x0040c488 lw t8, -0x7e50(gp) | t8 = sym.imp.pclose;
0x0040c48c move t9, t8 | t9 = t8;
0x0040c490 jalr t9 | t9 ();
0x0040c494 nop |
0x0040c498 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c49c lw t8, 0x18(fp) | t8 = *(arg_18h);
0x0040c4a0 b 0x40c58c | goto label_1;
0x0040c4a4 nop |
| label_0:
0x0040c4a8 lw a0, 0x1c(fp) | a0 = *(arg_1ch);
0x0040c4ac lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x0040c4b0 addiu a1, t8, 0x2348 | a1 = t8 + 0x2348;
0x0040c4b4 lw t8, -0x7e08(gp) | t8 = sym.imp.fopen64;
0x0040c4b8 move t9, t8 | t9 = t8;
0x0040c4bc jalr t9 | t9 ();
0x0040c4c0 nop |
0x0040c4c4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c4c8 move t8, v0 | t8 = v0;
0x0040c4cc sw t8, 0x20(fp) | *(arg_20h) = t8;
0x0040c4d0 lw t8, 0x20(fp) | t8 = *(arg_20h);
0x0040c4d4 sltiu t8, t8, 1 | t8 = (t8 < 1) ? 1 : 0;
0x0040c4d8 andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 != 0) {
0x0040c4dc beqz t8, 0x40c4f0 |
0x0040c4e0 nop |
0x0040c4e4 move t8, zero | t8 = 0;
0x0040c4e8 b 0x40c58c | goto label_1;
0x0040c4ec nop |
| }
0x0040c4f0 b 0x40c538 | goto label_4;
0x0040c4f4 nop |
| do {
0x0040c4f8 addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x0040c4fc move a0, t8 | a0 = t8;
0x0040c500 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.Vendor148f */
0x0040c504 addiu a1, t8, 0x2354 | a1 = t8 + 0x2354;
0x0040c508 lw t8, -0x7edc(gp) | t8 = sym.imp.strstr;
0x0040c50c move t9, t8 | t9 = t8;
0x0040c510 jalr t9 | t9 ();
0x0040c514 nop |
0x0040c518 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c51c move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x0040c520 beqz t8, 0x40c538 |
0x0040c524 nop |
0x0040c528 addiu t8, zero, 1 | t8 = 1;
0x0040c52c sw t8, 0x18(fp) | *(arg_18h) = t8;
0x0040c530 b 0x40c570 | goto label_5;
0x0040c534 nop |
| }
| label_4:
0x0040c538 addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x0040c53c move a0, t8 | a0 = t8;
0x0040c540 addiu a1, zero, 0x80 | a1 = 0x80;
0x0040c544 lw a2, 0x20(fp) | a2 = *(arg_20h);
0x0040c548 lw t8, -0x7e84(gp) | t8 = sym.imp.fgets;
0x0040c54c move t9, t8 | t9 = t8;
0x0040c550 jalr t9 | t9 ();
0x0040c554 nop |
0x0040c558 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c55c move t8, v0 | t8 = v0;
0x0040c560 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x0040c564 andi t8, t8, 0xff | t8 &= 0xff;
0x0040c568 bnez t8, 0x40c4f8 |
| } while (t8 != 0);
0x0040c56c nop |
| label_5:
0x0040c570 lw a0, 0x20(fp) | a0 = *(arg_20h);
0x0040c574 lw t8, -0x7e54(gp) | t8 = sym.imp.fclose;
0x0040c578 move t9, t8 | t9 = t8;
0x0040c57c jalr t9 | t9 ();
0x0040c580 nop |
0x0040c584 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040c588 lw t8, 0x18(fp) | t8 = *(arg_18h);
| label_1:
0x0040c58c move v0, t8 | v0 = t8;
0x0040c590 lw t8, -0x7dd0(gp) | t8 = *((gp - 8052));
0x0040c594 lw v1, 0xa4(fp) | v1 = *(arg_a4h);
0x0040c598 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x0040c59c beq v1, t8, 0x40c5b4 |
0x0040c5a0 nop |
0x0040c5a4 lw t8, -0x7e5c(gp) | t8 = sym.imp.__stack_chk_fail;
0x0040c5a8 move t9, t8 | t9 = t8;
0x0040c5ac jalr t9 | t9 ();
0x0040c5b0 nop |
| }
0x0040c5b4 move sp, fp |
0x0040c5b8 lw ra, 0xac(sp) | ra = *(var_ach);
0x0040c5bc lw fp, 0xa8(sp) | fp = *(var_a8h);
0x0040c5c0 addiu sp, sp, 0xb0 |
0x0040c5c4 jr ra | return v1;
0x0040c5c8 nop |
| }
[*] Function popen used 2 times network_setup