[*] Binary protection state of netd
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function popen tear down of netd
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/netd @ 0x42c8c */
| #include <stdint.h>
|
; (fcn) sym.netd_legacy_setter_call_getter () | void netd_legacy_setter_call_getter () {
0x00042c8c lui gp, 5 |
0x00042c90 addiu gp, gp, 0x4fb4 |
0x00042c94 addu gp, gp, t9 | gp += t9;
0x00042c98 addiu sp, sp, -0x40 |
0x00042c9c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00042ca0 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x00042ca4 sw s6, 0x38(sp) | *(var_38h) = s6;
0x00042ca8 sw s5, 0x34(sp) | *(var_34h) = s5;
0x00042cac sw s4, 0x30(sp) | *(var_30h) = s4;
0x00042cb0 sw s3, 0x2c(sp) | *(var_2ch) = s3;
0x00042cb4 sw s2, 0x28(sp) | *(var_28h) = s2;
0x00042cb8 sw s1, 0x24(sp) | *(var_24h) = s1;
0x00042cbc sw s0, 0x20(sp) | *(var_20h) = s0;
0x00042cc0 lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
| if (a0 == 0) {
0x00042cc4 beqz a0, 0x42e38 | goto label_3;
| }
0x00042cc8 lb v0, (a0) | v0 = *(a0);
0x00042ccc move s3, a0 | s3 = a0;
| if (v0 == 0) {
0x00042cd0 beqz v0, 0x42e38 | goto label_3;
| }
0x00042cd4 lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
0x00042cd8 lw t9, -0x7604(gp) | t9 = sym.imp.popen
0x00042cdc addiu a1, a1, -0x5ffc | a1 += -0x5ffc;
0x00042ce0 jalr t9 | t9 ();
0x00042ce4 move s2, v0 | s2 = v0;
0x00042ce8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00042cec beqz v0, 0x42eb0 | goto label_4;
| }
0x00042cf0 lw t9, -0x783c(gp) | t9 = sym.imp.g_malloc0;
0x00042cf4 addiu a0, zero, 0x10 | a0 = 0x10;
0x00042cf8 jalr t9 | t9 ();
0x00042cfc move s6, v0 | s6 = v0;
0x00042d00 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00042d04 beqz v0, 0x42d6c | goto label_5;
| }
0x00042d08 move s0, zero | s0 = 0;
0x00042d0c addiu s1, zero, 0x10 | s1 = 0x10;
0x00042d10 addiu s4, zero, -1 | s4 = -1;
0x00042d14 b 0x42d24 | goto label_6;
| label_0:
0x00042d18 addu v0, s6, s0 | v0 = s6 + s0;
| do {
0x00042d1c addiu s0, s0, 1 | s0++;
0x00042d20 sb s5, (v0) | *(v0) = s5;
| label_6:
0x00042d24 lw t9, -0x7728(gp) | t9 = sym.imp.fgetc;
0x00042d28 move a0, s2 | a0 = s2;
0x00042d2c jalr t9 | t9 ();
0x00042d30 addiu v1, s1, -1 | v1 = s1 + -1;
0x00042d34 lw gp, 0x18(sp) | gp = *(var_18h);
0x00042d38 move s5, v0 | s5 = v0;
0x00042d3c slt v1, s0, v1 | v1 = (s0 < v1) ? 1 : 0;
| if (v0 == s4) {
0x00042d40 beq v0, s4, 0x42dc0 | goto label_7;
| }
0x00042d44 addu v0, s6, s0 | v0 = s6 + s0;
0x00042d48 bnez v1, 0x42d1c |
| } while (v1 != 0);
0x00042d4c lw t9, -0x77b0(gp) | t9 = sym.imp.g_realloc;
0x00042d50 addiu s1, s1, 0x10 | s1 += 0x10;
0x00042d54 move a0, s6 | a0 = s6;
0x00042d58 move a1, s1 | a1 = s1;
0x00042d5c jalr t9 | t9 ();
0x00042d60 move s6, v0 | s6 = v0;
0x00042d64 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00042d68 bnez v0, 0x42d18 | goto label_0;
| }
| label_5:
0x00042d6c lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
0x00042d70 lw t9, -0x7fdc(gp) | t9 = sym.netd_log_esc;
0x00042d74 move a2, s3 | a2 = s3;
| /* str.Out_of_memory_when_trying_to_call_getter__s */
0x00042d78 addiu a1, a1, -0x5fdc | a1 += -0x5fdc;
0x00042d7c addiu a0, zero, 3 | a0 = 3;
0x00042d80 bal 0x434d0 | sym_netd_log_esc ();
0x00042d84 lw gp, 0x18(sp) | gp = *(var_18h);
0x00042d88 lw t9, -0x77dc(gp) | t9 = sym.imp.pclose;
0x00042d8c move a0, s2 | a0 = s2;
0x00042d90 jalr t9 | t9 ();
| label_1:
0x00042d94 lw ra, 0x3c(sp) | ra = *(var_3ch);
| do {
| label_2:
0x00042d98 move v0, s6 | v0 = s6;
0x00042d9c lw s5, 0x34(sp) | s5 = *(var_34h);
0x00042da0 lw s6, 0x38(sp) | s6 = *(var_38h);
0x00042da4 lw s4, 0x30(sp) | s4 = *(var_30h);
0x00042da8 lw s3, 0x2c(sp) | s3 = *(var_2ch);
0x00042dac lw s2, 0x28(sp) | s2 = *(var_28h);
0x00042db0 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00042db4 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00042db8 addiu sp, sp, 0x40 |
0x00042dbc jr ra | return v0;
| label_7:
0x00042dc0 addu s0, s6, s0 | s0 = s6 + s0;
0x00042dc4 lw t9, -0x7488(gp) | t9 = sym.imp.__errno_location;
0x00042dc8 sb zero, (s0) | *(s0) = 0;
0x00042dcc jalr t9 | t9 ();
0x00042dd0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00042dd4 sw zero, (v0) | *(v0) = 0;
0x00042dd8 move a0, s2 | a0 = s2;
0x00042ddc lw t9, -0x77dc(gp) | t9 = sym.imp.pclose;
0x00042de0 move s0, v0 | s0 = v0;
0x00042de4 jalr t9 | t9 ();
0x00042de8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00042dec bltz v0, 0x42ed0 | goto label_8;
| }
0x00042df0 lw t9, -0x7fdc(gp) | t9 = sym.netd_log_esc;
| if (v0 == 0) {
0x00042df4 bnez v0, 0x42e78 |
0x00042df8 lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
0x00042dfc move a2, s6 | a2 = s6;
| /* str.got_response___s_ */
0x00042e00 addiu a1, a1, -0x5f50 | a1 += -0x5f50;
0x00042e04 addiu a0, zero, 1 | a0 = 1;
0x00042e08 bal 0x434d0 | sym_netd_log_esc ();
0x00042e0c lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00042e10 move v0, s6 | v0 = s6;
0x00042e14 lw s5, 0x34(sp) | s5 = *(var_34h);
0x00042e18 lw s6, 0x38(sp) | s6 = *(var_38h);
0x00042e1c lw s4, 0x30(sp) | s4 = *(var_30h);
0x00042e20 lw s3, 0x2c(sp) | s3 = *(var_2ch);
0x00042e24 lw s2, 0x28(sp) | s2 = *(var_28h);
0x00042e28 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00042e2c lw s0, 0x20(sp) | s0 = *(var_20h);
0x00042e30 addiu sp, sp, 0x40 |
0x00042e34 jr ra | return v0;
| label_3:
0x00042e38 lw t9, -0x7fdc(gp) | t9 = sym.netd_log_esc;
| /* str.Getter_is_an_empty_string */
0x00042e3c addiu a1, a1, -0x6018 | a1 += -0x6018;
0x00042e40 addiu a0, zero, 2 | a0 = 2;
0x00042e44 bal 0x434d0 | sym_netd_log_esc ();
0x00042e48 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00042e4c move s6, zero | s6 = 0;
0x00042e50 move v0, s6 | v0 = s6;
0x00042e54 lw s5, 0x34(sp) | s5 = *(var_34h);
0x00042e58 lw s6, 0x38(sp) | s6 = *(var_38h);
0x00042e5c lw s4, 0x30(sp) | s4 = *(var_30h);
0x00042e60 lw s3, 0x2c(sp) | s3 = *(var_2ch);
0x00042e64 lw s2, 0x28(sp) | s2 = *(var_28h);
0x00042e68 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00042e6c lw s0, 0x20(sp) | s0 = *(var_20h);
0x00042e70 addiu sp, sp, 0x40 |
0x00042e74 jr ra | return v0;
| }
0x00042e78 lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
0x00042e7c sw s6, 0x10(sp) | *(var_10h) = s6;
0x00042e80 move a3, v0 | a3 = v0;
0x00042e84 move a2, s3 | a2 = s3;
| /* str.Getter__s_returned_non_zero_exit_value__d___s_ */
0x00042e88 addiu a1, a1, -0x5f84 | a1 += -0x5f84;
0x00042e8c addiu a0, zero, 3 | a0 = 3;
0x00042e90 bal 0x434d0 | sym_netd_log_esc ();
0x00042e94 lw gp, 0x18(sp) | gp = *(var_18h);
0x00042e98 move a0, s6 | a0 = s6;
0x00042e9c lw t9, -0x748c(gp) | t9 = *((gp - 7459));
0x00042ea0 move s6, zero | s6 = 0;
0x00042ea4 jalr t9 | t9 ();
0x00042ea8 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00042eac b 0x42d98 |
| } while (1);
| label_4:
0x00042eb0 lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
0x00042eb4 lw t9, -0x7fdc(gp) | t9 = sym.netd_log_esc;
0x00042eb8 move a2, s3 | a2 = s3;
| /* str.Unable_to_call_getter__s */
0x00042ebc addiu a1, a1, -0x5ff8 | a1 += -0x5ff8;
0x00042ec0 addiu a0, zero, 3 | a0 = 3;
0x00042ec4 bal 0x434d0 | sym_netd_log_esc ();
0x00042ec8 move s6, zero | s6 = 0;
0x00042ecc b 0x42d94 | goto label_1;
| label_8:
0x00042ed0 lw t9, -0x74c4(gp) | t9 = sym.imp.strerror;
0x00042ed4 lw a0, (s0) | a0 = *(s0);
0x00042ed8 jalr t9 | t9 ();
0x00042edc lw gp, 0x18(sp) | gp = *(var_18h);
0x00042ee0 sw s6, 0x10(sp) | *(var_10h) = s6;
0x00042ee4 move a3, v0 | a3 = v0;
0x00042ee8 lw a1, -0x7bf4(gp) | a1 = *((gp - 7933));
0x00042eec lw t9, -0x7fdc(gp) | t9 = sym.netd_log_esc;
0x00042ef0 move a2, s3 | a2 = s3;
| /* str.Getter__s_call_returned_error__s___s__ */
0x00042ef4 addiu a1, a1, -0x5fb0 | a1 += -0x5fb0;
0x00042ef8 addiu a0, zero, 3 | a0 = 3;
0x00042efc bal 0x434d0 | sym_netd_log_esc ();
0x00042f00 lw gp, 0x18(sp) | gp = *(var_18h);
0x00042f04 move a0, s6 | a0 = s6;
0x00042f08 sw zero, (s0) | *(s0) = 0;
0x00042f0c lw t9, -0x748c(gp) | t9 = *((gp - 7459));
0x00042f10 move s6, zero | s6 = 0;
0x00042f14 jalr t9 | t9 ();
0x00042f18 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00042f1c b 0x42d98 | goto label_2;
| }
[*] Function popen used 2 times netd