[*] Binary protection state of event_switch
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of event_switch
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/event_switch @ 0x6e58 */
| #include <stdint.h>
|
; (fcn) sym.connection_get_unique_id_from_dbus () | void connection_get_unique_id_from_dbus () {
0x00006e58 lui gp, 2 |
0x00006e5c addiu gp, gp, -0x3e48 |
0x00006e60 addu gp, gp, t9 | gp += t9;
0x00006e64 addiu sp, sp, -0x28 |
0x00006e68 move a2, a1 | a2 = a1;
0x00006e6c move a1, a0 | a1 = a0;
0x00006e70 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00006e74 lw t9, -0x7d4c(gp) | t9 = sym.imp.g_strdup_printf
0x00006e78 sw ra, 0x24(sp) | *(var_24h) = ra;
0x00006e7c sw s0, 0x20(sp) | *(var_20h) = s0;
0x00006e80 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00006e84 addiu a0, a0, -0x5d6c | a0 += -0x5d6c;
0x00006e88 jalr t9 | t9 ();
0x00006e8c lw gp, 0x10(sp) | gp = *(var_10h);
0x00006e90 move s0, v0 | s0 = v0;
0x00006e94 move a1, s0 | a1 = s0;
0x00006e98 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
0x00006e9c lw t9, -0x7e30(gp) | t9 = sym.imp.g_hash_table_lookup;
0x00006ea0 lw a0, -0x4c1c(v0) | a0 = *((v0 - 4871));
0x00006ea4 jalr t9 | t9 ();
0x00006ea8 lw gp, 0x10(sp) | gp = *(var_10h);
0x00006eac sw v0, 0x1c(sp) | *(var_1ch) = v0;
0x00006eb0 lw t9, -0x7c60(gp) | t9 = *((gp - 7960));
0x00006eb4 move a0, s0 | a0 = s0;
0x00006eb8 jalr t9 | t9 ();
0x00006ebc lw ra, 0x24(sp) | ra = *(var_24h);
0x00006ec0 lw v0, 0x1c(sp) | v0 = *(var_1ch);
0x00006ec4 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00006ec8 addiu sp, sp, 0x28 |
0x00006ecc jr ra | return v0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/event_switch @ 0x6b10 */
| #include <stdint.h>
|
; (fcn) sym.connection_init () | void connection_init () {
0x00006b10 lui gp, 2 |
0x00006b14 addiu gp, gp, -0x3b00 |
0x00006b18 addu gp, gp, t9 | gp += t9;
0x00006b1c addiu sp, sp, -0x60 |
0x00006b20 lw t9, -0x7e14(gp) | t9 = sym.imp.sd_bus_get_name_creds;
0x00006b24 sw s3, 0x44(sp) | *(var_44h) = s3;
0x00006b28 lw s3, -0x7db0(gp) | s3 = *((gp - 8044));
0x00006b2c lw v1, 0x80(sp) | v1 = *(arg_80h);
0x00006b30 sw s2, 0x40(sp) | *(var_40h) = s2;
0x00006b34 lw v0, (s3) | v0 = *(s3);
0x00006b38 sw s1, 0x3c(sp) | *(var_3ch) = s1;
0x00006b3c move s2, a2 | s2 = a2;
0x00006b40 move s1, a3 | s1 = a3;
0x00006b44 sw gp, 0x20(sp) | *(var_20h) = gp;
0x00006b48 sw fp, 0x58(sp) | *(var_58h) = fp;
0x00006b4c sw s7, 0x54(sp) | *(var_54h) = s7;
0x00006b50 sw s5, 0x4c(sp) | *(var_4ch) = s5;
0x00006b54 sw s0, 0x38(sp) | *(var_38h) = s0;
0x00006b58 sw ra, 0x5c(sp) | *(var_5ch) = ra;
0x00006b5c sw s6, 0x50(sp) | *(var_50h) = s6;
0x00006b60 sw s4, 0x48(sp) | *(var_48h) = s4;
0x00006b64 move s0, a0 | s0 = a0;
0x00006b68 move s7, a1 | s7 = a1;
0x00006b6c sw zero, 0x10(sp) | *(var_10h) = 0;
0x00006b70 move a2, zero | a2 = 0;
0x00006b74 move a3, zero | a3 = 0;
0x00006b78 move a1, s1 | a1 = s1;
0x00006b7c move a0, s2 | a0 = s2;
0x00006b80 sw v1, 0x28(sp) | *(var_28h) = v1;
0x00006b84 sw v0, 0x34(sp) | *(var_34h) = v0;
0x00006b88 sw zero, 0x30(sp) | *(var_30h) = 0;
0x00006b8c lw s5, 0x70(sp) | s5 = *(arg_70h);
0x00006b90 lw fp, 0x78(sp) | fp = *(arg_78h);
0x00006b94 jalr t9 | t9 ();
0x00006b98 lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 < 0) {
0x00006b9c bltz v0, 0x6d2c | goto label_2;
| }
0x00006ba0 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00006ba4 lw t9, -0x7d4c(gp) | t9 = sym.imp.g_strdup_printf
0x00006ba8 move a1, s1 | a1 = s1;
0x00006bac addiu a0, a0, -0x5e30 | a0 += -0x5e30;
0x00006bb0 jalr t9 | t9 ();
0x00006bb4 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006bb8 move a2, v0 | a2 = v0;
0x00006bbc addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x00006bc0 lw a3, -0x7fc8(gp) | a3 = *((gp - 8178));
0x00006bc4 lw t9, -0x7d38(gp) | t9 = sym.imp.sd_bus_add_match;
0x00006bc8 addiu a3, a3, 0x6a50 | a3 += 0x6a50;
0x00006bcc move a0, s2 | a0 = s2;
0x00006bd0 sw s0, 0x10(sp) | *(var_10h) = s0;
0x00006bd4 move s6, v0 | s6 = v0;
0x00006bd8 jalr t9 | t9 ();
0x00006bdc lw gp, 0x20(sp) | gp = *(var_20h);
0x00006be0 move s4, v0 | s4 = v0;
0x00006be4 lw t9, -0x7c60(gp) | t9 = *((gp - 7960));
0x00006be8 move a0, s6 | a0 = s6;
0x00006bec jalr t9 | t9 ();
0x00006bf0 lw gp, 0x20(sp) | gp = *(var_20h);
| if (s4 < 0) {
0x00006bf4 bltz s4, 0x6d34 | goto label_3;
| }
0x00006bf8 lw s6, -0x7fdc(gp) | s6 = *((gp - 8183));
0x00006bfc lw t9, -0x7cdc(gp) | t9 = sym.imp.g_strdup;
0x00006c00 move a0, s1 | a0 = s1;
0x00006c04 sw s6, 0x2c(sp) | *(var_2ch) = s6;
0x00006c08 jalr t9 | t9 ();
0x00006c0c lw gp, 0x20(sp) | gp = *(var_20h);
0x00006c10 sw v0, 4(s0) | *((s0 + 1)) = v0;
0x00006c14 lw t9, -0x7cdc(gp) | t9 = sym.imp.g_strdup;
0x00006c18 move a0, s5 | a0 = s5;
0x00006c1c jalr t9 | t9 ();
0x00006c20 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006c24 lw s6, -0x4c20(s6) | s6 = *((s6 - 4872));
0x00006c28 sw v0, 8(s0) | *((s0 + 2)) = v0;
0x00006c2c lw s4, -0x7fdc(gp) | s4 = *((gp - 8183));
| do {
0x00006c30 lw t9, -0x7e30(gp) | t9 = sym.imp.g_hash_table_lookup;
| label_0:
0x00006c34 addiu s6, s6, 1 | s6++;
0x00006c38 lw a0, -0x4c18(s4) | a0 = *((s4 - 4870));
0x00006c3c move a1, s6 | a1 = s6;
0x00006c40 jalr t9 | t9 ();
0x00006c44 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006c48 beqz s6, 0x6c30 |
| } while (s6 == 0);
0x00006c4c lw t9, -0x7e30(gp) | t9 = sym.imp.g_hash_table_lookup;
| if (v0 != 0) {
0x00006c50 bnez v0, 0x6c34 | goto label_0;
| }
0x00006c54 lw v0, 0x2c(sp) | v0 = *(var_2ch);
0x00006c58 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00006c5c lw t9, -0x7d4c(gp) | t9 = sym.imp.g_strdup_printf
0x00006c60 move a1, s1 | a1 = s1;
0x00006c64 move a2, s5 | a2 = s5;
0x00006c68 addiu a0, a0, -0x5d6c | a0 += -0x5d6c;
0x00006c6c sw s6, -0x4c20(v0) | *((v0 - 4872)) = s6;
0x00006c70 jalr t9 | t9 ();
0x00006c74 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006c78 lw a0, -0x4c18(s4) | a0 = *((s4 - 4870));
0x00006c7c move a2, v0 | a2 = v0;
0x00006c80 lw t9, -0x7cf4(gp) | t9 = sym.imp.g_hash_table_insert;
0x00006c84 move a1, s6 | a1 = s6;
0x00006c88 move s1, v0 | s1 = v0;
0x00006c8c jalr t9 | t9 ();
0x00006c90 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006c94 move a2, s6 | a2 = s6;
0x00006c98 move a1, s1 | a1 = s1;
0x00006c9c lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
0x00006ca0 lw t9, -0x7cf4(gp) | t9 = sym.imp.g_hash_table_insert;
0x00006ca4 lw a0, -0x4c1c(v0) | a0 = *((v0 - 4871));
0x00006ca8 jalr t9 | t9 ();
0x00006cac lw gp, 0x20(sp) | gp = *(var_20h);
0x00006cb0 sw s1, 0xc(s0) | *((s0 + 3)) = s1;
0x00006cb4 sw s6, (s0) | *(s0) = s6;
0x00006cb8 lw t9, -0x7cdc(gp) | t9 = sym.imp.g_strdup;
0x00006cbc move a0, fp | a0 = fp;
0x00006cc0 jalr t9 | t9 ();
0x00006cc4 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006cc8 sw v0, 0x10(s0) | *((s0 + 4)) = v0;
0x00006ccc lw v0, 0x28(sp) | v0 = *(var_28h);
0x00006cd0 sw s7, 0x20(s0) | *((s0 + 8)) = s7;
0x00006cd4 sw v0, 0x24(s0) | *((s0 + 9)) = v0;
0x00006cd8 lw v0, 0x7c(sp) | v0 = *(arg_7ch);
0x00006cdc sw s2, 0x14(s0) | *((s0 + 5)) = s2;
0x00006ce0 sw v0, 0x1c(s0) | *((s0 + 7)) = v0;
0x00006ce4 lw v0, 0x30(sp) | v0 = *(var_30h);
0x00006ce8 sw v0, 0x18(s0) | *((s0 + 6)) = v0;
0x00006cec addiu v0, zero, 1 | v0 = 1;
| do {
| label_1:
0x00006cf0 lw a0, 0x34(sp) | a0 = *(var_34h);
0x00006cf4 lw v1, (s3) | v1 = *(s3);
0x00006cf8 lw ra, 0x5c(sp) | ra = *(var_5ch);
| if (a0 != v1) {
0x00006cfc bne a0, v1, 0x6d80 | goto label_4;
| }
0x00006d00 lw fp, 0x58(sp) | fp = *(var_58h);
0x00006d04 lw s7, 0x54(sp) | s7 = *(var_54h);
0x00006d08 lw s6, 0x50(sp) | s6 = *(var_50h);
0x00006d0c lw s5, 0x4c(sp) | s5 = *(var_4ch);
0x00006d10 lw s4, 0x48(sp) | s4 = *(var_48h);
0x00006d14 lw s3, 0x44(sp) | s3 = *(var_44h);
0x00006d18 lw s2, 0x40(sp) | s2 = *(var_40h);
0x00006d1c lw s1, 0x3c(sp) | s1 = *(var_3ch);
0x00006d20 lw s0, 0x38(sp) | s0 = *(var_38h);
0x00006d24 addiu sp, sp, 0x60 |
0x00006d28 jr ra | return v0;
| label_2:
0x00006d2c move v0, zero | v0 = 0;
0x00006d30 b 0x6cf0 |
| } while (1);
| label_3:
0x00006d34 lw t9, -0x7c78(gp) | t9 = sym.imp.strerror;
0x00006d38 negu s4, s4 | __asm ("negu s4, s4");
0x00006d3c move a0, s4 | a0 = s4;
0x00006d40 jalr t9 | t9 ();
0x00006d44 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006d48 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00006d4c sw s4, 0x18(sp) | *(var_18h_2) = s4;
0x00006d50 lw a3, -0x7fd8(gp) | a3 = *((gp - 8182));
0x00006d54 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00006d58 lw t9, -0x7ecc(gp) | t9 = sym.imp.g_log;
0x00006d5c sw s1, 0x10(sp) | *(var_10h) = s1;
0x00006d60 addiu a3, a3, -0x65e0 | a3 += -0x65e0;
0x00006d64 addiu a2, a2, -0x5da0 | a2 += -0x5da0;
0x00006d68 addiu a1, zero, 0x10 | a1 = 0x10;
0x00006d6c move a0, zero | a0 = 0;
0x00006d70 jalr t9 | t9 ();
0x00006d74 lw gp, 0x20(sp) | gp = *(var_20h);
0x00006d78 move v0, zero | v0 = 0;
0x00006d7c b 0x6cf0 | goto label_1;
| label_4:
0x00006d80 lw t9, -0x7e00(gp) | t9 = sym.imp.__stack_chk_fail;
0x00006d84 jalr t9 | t9 ();
0x00006d88 nop |
| }
[*] Function printf used 4 times event_switch