[*] Binary protection state of netd_migrate
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of netd_migrate
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/libexec/netd_migrate @ 0x8b1c */
| #include <stdint.h>
|
; (fcn) sym.netd_util_write_to_file_full () | void netd_util_write_to_file_full () {
0x00008b1c lui gp, 2 |
0x00008b20 addiu gp, gp, -0x2dbc |
0x00008b24 addu gp, gp, t9 | gp += t9;
0x00008b28 addiu sp, sp, -0x40 |
0x00008b2c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00008b30 sw s4, 0x38(sp) | *(var_38h) = s4;
0x00008b34 sw s3, 0x34(sp) | *(var_34h) = s3;
0x00008b38 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x00008b3c sw s2, 0x30(sp) | *(var_30h) = s2;
0x00008b40 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x00008b44 sw s0, 0x28(sp) | *(var_28h) = s0;
0x00008b48 lw s3, 0x50(sp) | s3 = *(arg_50h);
0x00008b4c lw v0, 0x54(sp) | v0 = *(arg_54h);
0x00008b50 lw s4, 0x58(sp) | s4 = *(arg_58h);
| if (a0 == 0) {
0x00008b54 beqz a0, 0x8cd0 | goto label_3;
| }
0x00008b58 move s1, a1 | s1 = a1;
| if (a1 == 0) {
0x00008b5c beqz a1, 0x8d54 | goto label_4;
| }
0x00008b60 move s0, a0 | s0 = a0;
| if (v0 != 0) {
0x00008b64 bnez v0, 0x8cf8 | goto label_5;
| }
0x00008b68 lw t9, -0x7e98(gp) | t9 = sym.imp.__errno_location;
0x00008b6c jalr t9 | t9 ();
0x00008b70 nop |
0x00008b74 lw gp, 0x18(sp) | gp = *(var_18h);
0x00008b78 lui a1, 2 | a1 = 0x20000;
0x00008b7c move a0, s0 | a0 = s0;
0x00008b80 lw t9, -0x7e70(gp) | t9 = sym.imp.open;
0x00008b84 sw zero, (v0) | *(v0) = 0;
0x00008b88 move a2, s3 | a2 = s3;
0x00008b8c addiu a1, a1, 0x101 | a1 += 0x101;
0x00008b90 move s2, v0 | s2 = v0;
0x00008b94 jalr t9 | t9 ();
0x00008b98 move s0, v0 | s0 = v0;
0x00008b9c addiu v0, zero, -1 | v0 = -1;
0x00008ba0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s0 == v0) {
0x00008ba4 beq s0, v0, 0x8c7c | goto label_6;
| }
0x00008ba8 lw a1, -0x7fd0(gp) | a1 = *((gp - 8180));
0x00008bac lw t9, -0x7dc4(gp) | t9 = sym.imp.fdopen;
0x00008bb0 addiu a1, a1, -0x3a00 | a1 += -0x3a00;
0x00008bb4 move a0, s0 | a0 = s0;
0x00008bb8 jalr t9 | t9 ();
0x00008bbc move s3, v0 | s3 = v0;
0x00008bc0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00008bc4 beqz v0, 0x8c7c | goto label_6;
| }
0x00008bc8 lw a2, -0x7fd0(gp) | a2 = *((gp - 8180));
0x00008bcc lw t9, -0x7efc(gp) | t9 = sym.imp.__fprintf_chk
0x00008bd0 move a3, s1 | a3 = s1;
0x00008bd4 addiu a2, a2, -0x39fc | a2 += -0x39fc;
0x00008bd8 addiu a1, zero, 1 | a1 = 1;
0x00008bdc move a0, v0 | a0 = v0;
0x00008be0 jalr t9 | t9 ();
0x00008be4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00008be8 bltz v0, 0x8d80 | goto label_7;
| }
0x00008bec lw t9, -0x7edc(gp) | t9 = sym.imp.fclose;
0x00008bf0 move a0, s3 | a0 = s3;
0x00008bf4 jalr t9 | t9 ();
0x00008bf8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00008bfc beqz v0, 0x8de0 | goto label_8;
| }
0x00008c00 lw t9, -0x7ebc(gp) | t9 = sym.imp.g_unix_error_quark;
0x00008c04 jalr t9 | t9 ();
0x00008c08 nop |
0x00008c0c lw gp, 0x18(sp) | gp = *(var_18h);
0x00008c10 lw a0, (s2) | a0 = *(s2);
0x00008c14 lw t9, -0x7e34(gp) | t9 = sym.imp.g_strerror;
0x00008c18 move s1, v0 | s1 = v0;
0x00008c1c jalr t9 | t9 ();
0x00008c20 lw gp, 0x18(sp) | gp = *(var_18h);
0x00008c24 move a3, v0 | a3 = v0;
0x00008c28 move a2, zero | a2 = 0;
0x00008c2c lw t9, -0x7f18(gp) | t9 = sym.imp.g_set_error_literal;
0x00008c30 move a1, s1 | a1 = s1;
0x00008c34 move a0, s4 | a0 = s4;
0x00008c38 jalr t9 | t9 ();
0x00008c3c lw gp, 0x18(sp) | gp = *(var_18h);
| label_1:
0x00008c40 lw t9, -0x7f38(gp) | t9 = sym.imp.close;
| label_0:
0x00008c44 move a0, s0 | a0 = s0;
0x00008c48 jalr t9 | t9 ();
0x00008c4c addiu v1, zero, -1 | v1 = -1;
0x00008c50 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == v1) {
0x00008c54 beq v0, v1, 0x8de8 | goto label_9;
| }
| do {
0x00008c58 move v0, zero | v0 = 0;
| label_2:
0x00008c5c lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00008c60 lw s4, 0x38(sp) | s4 = *(var_38h);
0x00008c64 lw s3, 0x34(sp) | s3 = *(var_34h);
0x00008c68 lw s2, 0x30(sp) | s2 = *(var_30h);
0x00008c6c lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x00008c70 lw s0, 0x28(sp) | s0 = *(var_28h);
0x00008c74 addiu sp, sp, 0x40 |
0x00008c78 jr ra | return v0;
| label_6:
0x00008c7c lw t9, -0x7ebc(gp) | t9 = sym.imp.g_unix_error_quark;
0x00008c80 jalr t9 | t9 ();
0x00008c84 nop |
0x00008c88 lw gp, 0x18(sp) | gp = *(var_18h);
0x00008c8c lw a0, (s2) | a0 = *(s2);
0x00008c90 lw t9, -0x7e34(gp) | t9 = sym.imp.g_strerror;
0x00008c94 move s1, v0 | s1 = v0;
0x00008c98 jalr t9 | t9 ();
0x00008c9c lw gp, 0x18(sp) | gp = *(var_18h);
0x00008ca0 move a3, v0 | a3 = v0;
0x00008ca4 move a2, zero | a2 = 0;
0x00008ca8 lw t9, -0x7f18(gp) | t9 = sym.imp.g_set_error_literal;
0x00008cac move a1, s1 | a1 = s1;
0x00008cb0 move a0, s4 | a0 = s4;
0x00008cb4 jalr t9 | t9 ();
0x00008cb8 addiu v0, zero, -1 | v0 = -1;
0x00008cbc lw gp, 0x18(sp) | gp = *(var_18h);
0x00008cc0 sw zero, (s2) | *(s2) = 0;
0x00008cc4 beq s0, v0, 0x8c58 |
| } while (s0 == v0);
0x00008cc8 lw t9, -0x7f38(gp) | t9 = sym.imp.close;
0x00008ccc b 0x8c44 | goto label_0;
| label_3:
0x00008cd0 lw v0, -0x7fd0(gp) | v0 = *((gp - 8180));
0x00008cd4 lw a3, -0x7fd0(gp) | a3 = *((gp - 8180));
0x00008cd8 lw a1, -0x7fd0(gp) | a1 = *((gp - 8180));
0x00008cdc addiu v0, v0, -0x3a20 | v0 += -0x3a20;
0x00008ce0 lw t9, -0x7e28(gp) | t9 = sym.imp.g_assertion_message_expr;
0x00008ce4 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00008ce8 addiu a3, a3, -0x36cc | a3 += -0x36cc;
0x00008cec addiu a2, zero, 0x198 | a2 = aav.0x00000198;
0x00008cf0 addiu a1, a1, -0x3afc | a1 += -0x3afc;
0x00008cf4 jalr t9 | t9 ();
| label_5:
0x00008cf8 lw t9, -0x7e7c(gp) | t9 = sym.imp.strlen;
0x00008cfc sw a3, 0x24(sp) | *(var_24h) = a3;
0x00008d00 sw a2, 0x20(sp) | *(var_20h) = a2;
0x00008d04 move a0, a1 | a0 = a1;
0x00008d08 jalr t9 | t9 ();
0x00008d0c lw gp, 0x18(sp) | gp = *(var_18h);
0x00008d10 lw a3, 0x24(sp) | a3 = *(var_24h);
0x00008d14 lw a2, 0x20(sp) | a2 = *(var_20h);
0x00008d18 sw s3, 0x54(sp) | *(arg_54h) = s3;
0x00008d1c lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00008d20 lw s4, 0x38(sp) | s4 = *(var_38h);
0x00008d24 lw s3, 0x34(sp) | s3 = *(var_34h);
0x00008d28 lw s2, 0x30(sp) | s2 = *(var_30h);
0x00008d2c move a1, s1 | a1 = s1;
0x00008d30 move a0, s0 | a0 = s0;
0x00008d34 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x00008d38 lw s0, 0x28(sp) | s0 = *(var_28h);
0x00008d3c lw t9, -0x7f00(gp) | t9 = sym.imp.confutils_set_file_contents_with_sync_full;
0x00008d40 sw a3, 0x50(sp) | *(arg_50h) = a3;
0x00008d44 move a3, a2 | a3 = a2;
0x00008d48 move a2, v0 | a2 = v0;
0x00008d4c addiu sp, sp, 0x40 |
0x00008d50 jr t9 | t9 ();
| label_4:
0x00008d54 lw v0, -0x7fd0(gp) | v0 = *((gp - 8180));
0x00008d58 lw a3, -0x7fd0(gp) | a3 = *((gp - 8180));
0x00008d5c lw a1, -0x7fd0(gp) | a1 = *((gp - 8180));
0x00008d60 addiu v0, v0, -0x3a10 | v0 += -0x3a10;
0x00008d64 lw t9, -0x7e28(gp) | t9 = sym.imp.g_assertion_message_expr;
0x00008d68 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00008d6c addiu a3, a3, -0x36cc | a3 += -0x36cc;
0x00008d70 addiu a2, zero, 0x199 | a2 = 0x199;
0x00008d74 addiu a1, a1, -0x3afc | a1 += -0x3afc;
0x00008d78 move a0, zero | a0 = 0;
0x00008d7c jalr t9 | t9 ();
| label_7:
0x00008d80 lw t9, -0x7ebc(gp) | t9 = sym.imp.g_unix_error_quark;
0x00008d84 jalr t9 | t9 ();
0x00008d88 nop |
0x00008d8c lw gp, 0x18(sp) | gp = *(var_18h);
0x00008d90 lw a0, (s2) | a0 = *(s2);
0x00008d94 lw t9, -0x7e34(gp) | t9 = sym.imp.g_strerror;
0x00008d98 move s1, v0 | s1 = v0;
0x00008d9c jalr t9 | t9 ();
0x00008da0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00008da4 move a3, v0 | a3 = v0;
0x00008da8 move a2, zero | a2 = 0;
0x00008dac lw t9, -0x7f18(gp) | t9 = sym.imp.g_set_error_literal;
0x00008db0 move a1, s1 | a1 = s1;
0x00008db4 move a0, s4 | a0 = s4;
0x00008db8 jalr t9 | t9 ();
0x00008dbc lw gp, 0x18(sp) | gp = *(var_18h);
0x00008dc0 sw zero, (s2) | *(s2) = 0;
0x00008dc4 lw t9, -0x7edc(gp) | t9 = sym.imp.fclose;
0x00008dc8 move a0, s3 | a0 = s3;
0x00008dcc jalr t9 | t9 ();
0x00008dd0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00008dd4 bnez v0, 0x8c40 | goto label_1;
| }
0x00008dd8 move v0, zero | v0 = 0;
0x00008ddc b 0x8c5c | goto label_2;
| label_8:
0x00008de0 addiu v0, zero, 1 | v0 = 1;
0x00008de4 b 0x8c5c | goto label_2;
| label_9:
0x00008de8 lw t9, -0x7e34(gp) | t9 = sym.imp.g_strerror;
0x00008dec lw a0, (s2) | a0 = *(s2);
0x00008df0 jalr t9 | t9 ();
0x00008df4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00008df8 move a2, v0 | a2 = v0;
0x00008dfc addiu a0, zero, 3 | a0 = 3;
0x00008e00 lw a1, -0x7fd0(gp) | a1 = *((gp - 8180));
0x00008e04 lw t9, -0x7fcc(gp) | t9 = sym.netd_log_esc;
0x00008e08 addiu a1, a1, -0x39f8 | a1 += -0x39f8;
0x00008e0c bal 0x5f90 | sym_netd_log_esc ();
0x00008e10 move v0, zero | v0 = 0;
0x00008e14 b 0x8c5c | goto label_2;
| }
[*] Function printf used 2 times netd_migrate