[*] Binary protection state of syslog-ng-ctl
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of syslog-ng-ctl
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/syslog-ng-ctl @ 0x1ae0 */
| #include <stdint.h>
|
; (fcn) fcn.00001ae0 () | void fcn_00001ae0 () {
0x00001ae0 lui gp, 2 |
0x00001ae4 addiu gp, gp, -0x5790 |
0x00001ae8 addu gp, gp, t9 | gp += t9;
0x00001aec addiu sp, sp, -0x30 |
0x00001af0 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001af4 sw s2, 0x28(sp) | *(var_28h) = s2;
0x00001af8 lw s2, -0x7f90(gp) | s2 = *((gp - 8164));
0x00001afc move a3, a0 | a3 = a0;
0x00001b00 lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00001b04 sw s0, 0x20(sp) | *(var_20h) = s0;
0x00001b08 lw a0, (s2) | a0 = *(s2);
0x00001b0c move s0, a1 | s0 = a1;
0x00001b10 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00001b14 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00001b18 sw s1, 0x24(sp) | *(var_24h) = s1;
0x00001b1c addiu a2, a2, 0x34d4 | a2 += str.Syntax:__s__command___options__nPossible_commands_are:_n;
0x00001b20 addiu a1, zero, 1 | a1 = 1;
0x00001b24 jalr t9 | t9 ();
0x00001b28 lw a3, (s0) | a3 = *(s0);
0x00001b2c lw gp, 0x18(sp) | gp = *(var_18h);
| if (a3 == 0) {
0x00001b30 beqz a3, 0x1b6c | goto label_0;
| }
0x00001b34 lw s1, -0x7fdc(gp) | s1 = *((gp - 8183));
0x00001b38 addiu s0, s0, 0x14 | s0 += 0x14;
0x00001b3c addiu s1, s1, 0x350c | s1 += str.______20s__s_n;
| do {
0x00001b40 lw v0, -0xc(s0) | v0 = *((s0 - 3));
0x00001b44 lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00001b48 lw a0, (s2) | a0 = *(s2);
0x00001b4c addiu s0, s0, 0x14 | s0 += 0x14;
0x00001b50 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00001b54 move a2, s1 | a2 = s1;
0x00001b58 addiu a1, zero, 1 | a1 = 1;
0x00001b5c jalr t9 | t9 ();
0x00001b60 lw a3, -0x14(s0) | a3 = *((s0 - 5));
0x00001b64 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001b68 bnez a3, 0x1b40 |
| } while (a3 != 0);
| label_0:
0x00001b6c lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00001b70 lw s2, 0x28(sp) | s2 = *(var_28h);
0x00001b74 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00001b78 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00001b7c addiu sp, sp, 0x30 |
0x00001b80 jr ra | return v0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/syslog-ng-ctl @ 0x1b84 */
| #include <stdint.h>
|
; (fcn) fcn.00001b84 () | void fcn_00001b84 () {
0x00001b84 lui gp, 2 |
0x00001b88 addiu gp, gp, -0x5834 |
0x00001b8c addu gp, gp, t9 | gp += t9;
0x00001b90 addiu sp, sp, -0x60 |
0x00001b94 lw t9, -0x7eb8(gp) | t9 = sym.imp.isatty;
0x00001b98 sw s0, 0x50(sp) | *(var_50h) = s0;
0x00001b9c lw s0, -0x7ec0(gp) | s0 = *((gp - 8112));
0x00001ba0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00001ba4 sw s1, 0x54(sp) | *(var_54h) = s1;
0x00001ba8 lw v0, (s0) | v0 = *(s0);
0x00001bac sw ra, 0x5c(sp) | *(var_5ch) = ra;
0x00001bb0 sw s2, 0x58(sp) | *(var_58h) = s2;
0x00001bb4 move s1, a0 | s1 = a0;
0x00001bb8 sw v0, 0x4c(sp) | *(var_4ch) = v0;
0x00001bbc move a0, zero | a0 = 0;
0x00001bc0 jalr t9 | t9 ();
0x00001bc4 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001bc8 bnez v0, 0x1bf0 |
| while (v0 == 0) {
| label_0:
0x00001bcc lw v1, 0x4c(sp) | v1 = *(var_4ch);
0x00001bd0 lw v0, (s0) | v0 = *(s0);
0x00001bd4 lw ra, 0x5c(sp) | ra = *(var_5ch);
| if (v1 != v0) {
0x00001bd8 bne v1, v0, 0x1cd4 | goto label_2;
| }
0x00001bdc lw s2, 0x58(sp) | s2 = *(var_58h);
0x00001be0 lw s1, 0x54(sp) | s1 = *(var_54h);
0x00001be4 lw s0, 0x50(sp) | s0 = *(var_50h);
0x00001be8 addiu sp, sp, 0x60 |
0x00001bec jr ra | return v0;
0x00001bf0 lw t9, -0x7efc(gp) | t9 = sym.imp.tcgetattr;
0x00001bf4 addiu s2, sp, 0x18 | s2 = sp + 0x18;
0x00001bf8 move a1, s2 | a1 = s2;
0x00001bfc move a0, zero | a0 = 0;
0x00001c00 jalr t9 | t9 ();
0x00001c04 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x00001c08 bnez v0, 0x1c8c | goto label_3;
| }
0x00001c0c lw v0, 0x24(sp) | v0 = *(var_24h_2);
| if (s1 != 0) {
0x00001c10 bnez s1, 0x1c84 | goto label_4;
| }
0x00001c14 addiu v1, zero, -9 | v1 = -9;
0x00001c18 and v0, v0, v1 | v0 &= v1;
| label_1:
0x00001c1c lw t9, -0x7eac(gp) | t9 = sym.imp.tcsetattr;
0x00001c20 move a2, s2 | a2 = s2;
0x00001c24 addiu a1, zero, 0x540e | a1 = 0x540e;
0x00001c28 move a0, zero | a0 = 0;
0x00001c2c sw v0, 0x24(sp) | *(var_24h_2) = v0;
0x00001c30 jalr t9 | t9 ();
0x00001c34 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001c38 beqz v0, 0x1bcc |
| }
0x00001c3c lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x00001c40 lw t9, -0x7f0c(gp) | t9 = sym.imp.__errno_location;
0x00001c44 lw s1, (v0) | s1 = *(v0);
0x00001c48 jalr t9 | t9 ();
0x00001c4c lw gp, 0x10(sp) | gp = *(var_10h);
0x00001c50 lw t9, -0x7f48(gp) | t9 = sym.imp.strerror;
0x00001c54 lw a0, (v0) | a0 = *(v0);
0x00001c58 jalr t9 | t9 ();
0x00001c5c lw gp, 0x10(sp) | gp = *(var_10h);
0x00001c60 move a3, v0 | a3 = v0;
0x00001c64 addiu a1, zero, 1 | a1 = 1;
0x00001c68 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001c6c lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00001c70 addiu a2, a2, 0x3548 | a2 += str.syslog_ng_ctl:_error_while_tcsetattr:__s_n;
0x00001c74 move a0, s1 | a0 = s1;
0x00001c78 jalr t9 | t9 ();
0x00001c7c lw gp, 0x10(sp) | gp = *(var_10h);
0x00001c80 b 0x1bcc | goto label_0;
| label_4:
0x00001c84 ori v0, v0, 8 | v0 |= 8;
0x00001c88 b 0x1c1c | goto label_1;
| label_3:
0x00001c8c lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x00001c90 lw t9, -0x7f0c(gp) | t9 = sym.imp.__errno_location;
0x00001c94 lw s1, (v0) | s1 = *(v0);
0x00001c98 jalr t9 | t9 ();
0x00001c9c lw gp, 0x10(sp) | gp = *(var_10h);
0x00001ca0 lw t9, -0x7f48(gp) | t9 = sym.imp.strerror;
0x00001ca4 lw a0, (v0) | a0 = *(v0);
0x00001ca8 jalr t9 | t9 ();
0x00001cac lw gp, 0x10(sp) | gp = *(var_10h);
0x00001cb0 move a3, v0 | a3 = v0;
0x00001cb4 addiu a1, zero, 1 | a1 = 1;
0x00001cb8 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001cbc lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00001cc0 addiu a2, a2, 0x351c | a2 += str.syslog_ng_ctl:_error_while_tcgetattr:__s_n;
0x00001cc4 move a0, s1 | a0 = s1;
0x00001cc8 jalr t9 | t9 ();
0x00001ccc lw gp, 0x10(sp) | gp = *(var_10h);
0x00001cd0 b 0x1bcc | goto label_0;
| label_2:
0x00001cd4 lw t9, -0x7f20(gp) | t9 = sym.imp.__stack_chk_fail;
0x00001cd8 jalr t9 | t9 ();
0x00001cdc nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/syslog-ng-ctl @ 0x1660 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 6848 named .text */
0x00001660 lui gp, 2 |
0x00001664 addiu gp, gp, -0x5310 |
0x00001668 addu gp, gp, t9 | gp += t9;
0x0000166c addiu sp, sp, -0x48 |
0x00001670 lw t9, -0x7ee0(gp) | t9 = sym.imp.setlocale;
0x00001674 sw s3, 0x38(sp) | *(var_38h) = s3;
0x00001678 lw s3, -0x7ec0(gp) | s3 = *((gp - 8112));
0x0000167c sw a1, 0x1c(sp) | *(var_1ch) = a1;
0x00001680 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00001684 lw v0, (s3) | v0 = *(s3);
0x00001688 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0000168c sw ra, 0x44(sp) | *(var_44h) = ra;
0x00001690 sw s4, 0x3c(sp) | *(var_3ch) = s4;
0x00001694 sw a0, 0x48(sp) | *(envp) = a0;
0x00001698 addiu a1, a1, 0x36dc | a1 += 0x36dc;
0x0000169c addiu a0, zero, 6 | a0 = 6;
0x000016a0 sw s5, 0x40(sp) | *(var_40h) = s5;
0x000016a4 sw s2, 0x34(sp) | *(var_34h) = s2;
0x000016a8 sw s1, 0x30(sp) | *(var_30h) = s1;
0x000016ac sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x000016b0 sw v0, 0x24(sp) | *(var_24h) = v0;
0x000016b4 sw zero, 0x20(sp) | *(var_20h) = 0;
0x000016b8 jalr t9 | t9 ();
0x000016bc nop |
0x000016c0 lw gp, 0x10(sp) | gp = *(var_10h);
0x000016c4 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x000016c8 lw t9, -0x7f24(gp) | t9 = sym.imp.get_installation_path_for;
0x000016cc addiu a0, a0, 0x3748 | a0 += str._var_run_syslog_ng_syslog_ng.ctl;
0x000016d0 jalr t9 | t9 ();
0x000016d4 lw gp, 0x10(sp) | gp = *(var_10h);
0x000016d8 lw v1, 0x48(sp) | v1 = *(envp);
0x000016dc lw s4, -0x7fd4(gp) | s4 = *((gp - 8181));
0x000016e0 slti v1, v1, 2 | v1 = (v1 < 2) ? 1 : 0;
0x000016e4 sw v0, 0x450c(s4) | *((s4 + 4419)) = v0;
| if (v1 == 0) {
0x000016e8 bnez v1, 0x170c |
0x000016ec lw v0, 0x1c(sp) | v0 = *(var_1ch);
0x000016f0 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x000016f4 lw t9, -0x7ecc(gp) | t9 = sym.imp.g_str_equal;
0x000016f8 lw a0, 4(v0) | a0 = *((v0 + 1));
0x000016fc addiu a1, a1, 0x372c | a1 += str.__help;
0x00001700 jalr t9 | t9 ();
0x00001704 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x00001708 bnez v0, 0x18c8 | goto label_1;
| }
| }
0x0000170c lw v0, 0x1c(sp) | v0 = *(var_1ch);
0x00001710 lw t9, -0x7ec8(gp) | t9 = sym.imp.g_string_new;
0x00001714 lw s5, -0x7fd4(gp) | s5 = *((gp - 8181));
0x00001718 lw a0, (v0) | a0 = *(v0);
0x0000171c jalr t9 | t9 ();
0x00001720 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001724 lw a2, 0x1c(sp) | a2 = *(var_1ch);
0x00001728 move s2, v0 | s2 = v0;
0x0000172c lw t9, -0x7fdc(gp) | t9 = *((gp - 8183));
| /* esilref: 'stats' */
0x00001730 addiu a0, s5, 0x4010 | a0 = s5 + 0x4010;
0x00001734 move a3, v0 | a3 = v0;
0x00001738 addiu t9, t9, 0x2a64 | t9 += fcn.00002a64;
0x0000173c addiu a1, sp, 0x48 | a1 = sp + 0x48;
0x00001740 bal 0x2a64 | fcn_00002a64 ();
0x00001744 move s1, v0 | s1 = v0;
0x00001748 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000174c lw a0, (s2) | a0 = *(s2);
| if (v0 == 0) {
0x00001750 beqz v0, 0x18f4 | goto label_2;
| }
0x00001754 lw t9, -0x7ed4(gp) | t9 = sym.imp.g_option_context_new;
0x00001758 jalr t9 | t9 ();
0x0000175c nop |
0x00001760 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001764 lw a1, 8(s1) | a1 = *((s1 + 2));
0x00001768 move a0, v0 | a0 = v0;
0x0000176c lw t9, -0x7edc(gp) | t9 = sym.imp.g_option_context_set_summary;
0x00001770 move s0, v0 | s0 = v0;
0x00001774 jalr t9 | t9 ();
0x00001778 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000177c lw a1, 4(s1) | a1 = *((s1 + 1));
0x00001780 move a2, zero | a2 = 0;
0x00001784 lw t9, -0x7f3c(gp) | t9 = sym.imp.g_option_context_add_main_entries;
0x00001788 move a0, s0 | a0 = s0;
0x0000178c jalr t9 | t9 ();
0x00001790 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001794 move a2, zero | a2 = 0;
0x00001798 move a0, s0 | a0 = s0;
0x0000179c lw a1, -0x7fd4(gp) | a1 = *((gp - 8181));
0x000017a0 lw t9, -0x7f3c(gp) | t9 = sym.imp.g_option_context_add_main_entries;
| /* esilref: 'control' */
0x000017a4 addiu a1, a1, 0x41ac | a1 += 0x41ac;
0x000017a8 jalr t9 | t9 ();
0x000017ac lw gp, 0x10(sp) | gp = *(var_10h);
0x000017b0 addiu a1, zero, 1 | a1 = 1;
0x000017b4 lw t9, -0x7f44(gp) | t9 = sym.imp.g_string_free;
0x000017b8 move a0, s2 | a0 = s2;
0x000017bc jalr t9 | t9 ();
0x000017c0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s0 == 0) {
0x000017c4 beqz s0, 0x1908 | goto label_3;
| }
0x000017c8 lw t9, -0x7eb0(gp) | t9 = sym.imp.g_option_context_parse;
0x000017cc addiu s2, sp, 0x20 | s2 = sp + 0x20;
0x000017d0 move a3, s2 | a3 = s2;
0x000017d4 addiu a2, sp, 0x1c | a2 = sp + 0x1c;
0x000017d8 addiu a1, sp, 0x48 | a1 = sp + 0x48;
0x000017dc move a0, s0 | a0 = s0;
0x000017e0 jalr t9 | t9 ();
0x000017e4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x000017e8 bnez v0, 0x186c | goto label_4;
| }
0x000017ec lw v1, -0x7f90(gp) | v1 = *((gp - 8164));
0x000017f0 lw v0, 0x20(sp) | v0 = *(var_20h);
0x000017f4 lw a0, (v1) | a0 = *(v1);
| if (v0 == 0) {
0x000017f8 beqz v0, 0x1954 | goto label_5;
| }
0x000017fc lw a3, 8(v0) | a3 = *((v0 + 2));
| label_0:
0x00001800 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001804 lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00001808 addiu a2, a2, 0x3780 | a2 += str.Error_parsing_command_line_arguments:__s_n;
0x0000180c addiu a1, zero, 1 | a1 = 1;
0x00001810 jalr t9 | t9 ();
0x00001814 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001818 lw t9, -0x7f38(gp) | t9 = sym.imp.g_clear_error;
0x0000181c move a0, s2 | a0 = s2;
0x00001820 jalr t9 | t9 ();
0x00001824 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001828 lw t9, -0x7f1c(gp) | t9 = sym.imp.g_option_context_free;
0x0000182c move a0, s0 | a0 = s0;
0x00001830 jalr t9 | t9 ();
0x00001834 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001838 addiu v0, zero, 1 | v0 = 1;
| do {
0x0000183c lw a0, 0x24(sp) | a0 = *(var_24h);
0x00001840 lw v1, (s3) | v1 = *(s3);
0x00001844 lw ra, 0x44(sp) | ra = *(var_44h);
| if (a0 != v1) {
0x00001848 bne a0, v1, 0x1960 | goto label_6;
| }
0x0000184c lw s5, 0x40(sp) | s5 = *(var_40h);
0x00001850 lw s4, 0x3c(sp) | s4 = *(var_3ch);
0x00001854 lw s3, 0x38(sp) | s3 = *(var_38h);
0x00001858 lw s2, 0x34(sp) | s2 = *(var_34h);
0x0000185c lw s1, 0x30(sp) | s1 = *(var_30h);
0x00001860 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x00001864 addiu sp, sp, 0x48 |
0x00001868 jr ra | return v0;
| label_4:
0x0000186c lw t9, -0x7fc4(gp) | t9 = sym.control_client_new;
0x00001870 lw s2, -0x7fd4(gp) | s2 = *((gp - 8181));
0x00001874 lw a0, 0x450c(s4) | a0 = *((s4 + 4419));
0x00001878 bal 0x2c00 | sym_control_client_new ();
0x0000187c lw a2, (s1) | a2 = *(s1);
0x00001880 lw a1, 0x1c(sp) | a1 = *(var_1ch);
0x00001884 lw a0, 0x48(sp) | a0 = *(envp);
0x00001888 lw t9, 0xc(s1) | t9 = *((s1 + 3));
0x0000188c move a3, s0 | a3 = s0;
0x00001890 sw v0, 0x4508(s2) | *((s2 + 4418)) = v0;
0x00001894 jalr t9 | t9 ();
0x00001898 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000189c sw v0, 0x18(sp) | *(var_18h_2) = v0;
0x000018a0 lw t9, -0x7f1c(gp) | t9 = sym.imp.g_option_context_free;
0x000018a4 move a0, s0 | a0 = s0;
0x000018a8 jalr t9 | t9 ();
0x000018ac lw gp, 0x10(sp) | gp = *(var_10h);
0x000018b0 lw t9, -0x7fc0(gp) | t9 = sym.control_client_free;
0x000018b4 lw a0, 0x4508(s2) | a0 = *((s2 + 4418));
0x000018b8 bal 0x2ff8 | sym_control_client_free ();
0x000018bc lw gp, 0x10(sp) | gp = *(var_10h);
0x000018c0 lw v0, 0x18(sp) | v0 = *(var_18h_2);
0x000018c4 b 0x183c |
| } while (1);
| label_1:
0x000018c8 lw v0, 0x1c(sp) | v0 = *(var_1ch);
0x000018cc lw a1, -0x7fd4(gp) | a1 = *((gp - 8181));
0x000018d0 lw t9, -0x7fdc(gp) | t9 = *((gp - 8183));
0x000018d4 lw a0, (v0) | a0 = *(v0);
0x000018d8 addiu t9, t9, 0x1ae0 | t9 += fcn.00001ae0;
| /* esilref: 'stats' */
0x000018dc addiu a1, a1, 0x4010 | a1 += 0x4010;
0x000018e0 bal 0x1ae0 | fcn_00001ae0 ();
0x000018e4 lw gp, 0x10(sp) | gp = *(var_10h);
0x000018e8 lw t9, -0x7f40(gp) | t9 = sym.imp.exit;
0x000018ec move a0, zero | a0 = 0;
0x000018f0 jalr t9 | t9 ();
| label_2:
0x000018f4 lw t9, -0x7f44(gp) | t9 = sym.imp.g_string_free;
0x000018f8 addiu a1, zero, 1 | a1 = 1;
0x000018fc move a0, s2 | a0 = s2;
0x00001900 jalr t9 | t9 ();
0x00001904 lw gp, 0x10(sp) | gp = *(var_10h);
| label_3:
0x00001908 lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x0000190c lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00001910 lw t9, -0x7ee8(gp) | t9 = sym.imp.fwrite;
0x00001914 lw a3, (v0) | a3 = *(v0);
0x00001918 addiu a2, zero, 0x10 | a2 = 0x10;
0x0000191c addiu a1, zero, 1 | a1 = 1;
0x00001920 addiu a0, a0, 0x376c | a0 += str.Unknown_command_n;
0x00001924 jalr t9 | t9 ();
0x00001928 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000192c lw v0, 0x1c(sp) | v0 = *(var_1ch);
| /* esilref: 'stats' */
0x00001930 addiu a1, s5, 0x4010 | a1 = s5 + 0x4010;
0x00001934 lw t9, -0x7fdc(gp) | t9 = *((gp - 8183));
0x00001938 addiu t9, t9, 0x1ae0 | t9 += fcn.00001ae0;
0x0000193c lw a0, (v0) | a0 = *(v0);
0x00001940 bal 0x1ae0 | fcn_00001ae0 ();
0x00001944 lw gp, 0x10(sp) | gp = *(var_10h);
0x00001948 lw t9, -0x7f40(gp) | t9 = sym.imp.exit;
0x0000194c addiu a0, zero, 1 | a0 = 1;
0x00001950 jalr t9 | t9 ();
| label_5:
0x00001954 lw a3, -0x7fdc(gp) | a3 = *((gp - 8183));
0x00001958 addiu a3, a3, 0x3734 | a3 += str.Invalid_arguments;
0x0000195c b 0x1800 | goto label_0;
| label_6:
0x00001960 lw t9, -0x7f20(gp) | t9 = sym.imp.__stack_chk_fail;
0x00001964 jalr t9 | t9 ();
0x00001968 nop |
0x0000196c nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/syslog-ng-ctl @ 0x2c68 */
| #include <stdint.h>
|
; (fcn) sym.control_client_connect () | void control_client_connect () {
0x00002c68 lui gp, 2 |
0x00002c6c addiu gp, gp, -0x6918 |
0x00002c70 addu gp, gp, t9 | gp += t9;
0x00002c74 addiu sp, sp, -0x38 |
0x00002c78 addiu v0, zero, -1 | v0 = -1;
0x00002c7c sw s0, 0x20(sp) | *(var_20h) = s0;
0x00002c80 lw s0, 4(a0) | s0 = *((a0 + 1));
0x00002c84 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00002c88 sw ra, 0x34(sp) | *(var_34h) = ra;
0x00002c8c sw s4, 0x30(sp) | *(var_30h) = s4;
0x00002c90 sw s3, 0x2c(sp) | *(var_2ch) = s3;
0x00002c94 sw s2, 0x28(sp) | *(var_28h) = s2;
0x00002c98 sw s1, 0x24(sp) | *(var_24h) = s1;
0x00002c9c lw ra, 0x34(sp) | ra = *(var_34h);
| if (s0 != v0) {
0x00002ca0 beq s0, v0, 0x2cc4 |
0x00002ca4 lw s4, 0x30(sp) | s4 = *(var_30h);
0x00002ca8 lw s3, 0x2c(sp) | s3 = *(var_2ch);
0x00002cac lw s2, 0x28(sp) | s2 = *(var_28h);
0x00002cb0 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00002cb4 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00002cb8 addiu v0, zero, 1 | v0 = 1;
0x00002cbc addiu sp, sp, 0x38 |
0x00002cc0 jr ra | return v0;
| }
0x00002cc4 lw t9, -0x7f9c(gp) | t9 = sym.imp.g_sockaddr_unix_new;
0x00002cc8 move s1, a0 | s1 = a0;
0x00002ccc lw a0, (a0) | a0 = *(a0);
0x00002cd0 jalr t9 | t9 ();
0x00002cd4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002cd8 move a2, zero | a2 = 0;
0x00002cdc addiu a1, zero, 2 | a1 = 2;
0x00002ce0 lw t9, -0x7eb4(gp) | t9 = sym.imp.socket;
0x00002ce4 addiu a0, zero, 1 | a0 = 1;
0x00002ce8 move s2, v0 | s2 = v0;
0x00002cec jalr t9 | t9 ();
0x00002cf0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002cf4 sw v0, 4(s1) | *((s1 + 1)) = v0;
| if (v0 == s0) {
0x00002cf8 beq v0, s0, 0x2db4 | goto label_1;
| }
0x00002cfc lw t9, -0x7ed0(gp) | t9 = sym.imp.g_connect;
0x00002d00 move a1, s2 | a1 = s2;
0x00002d04 move a0, v0 | a0 = v0;
0x00002d08 jalr t9 | t9 ();
0x00002d0c addiu v1, zero, 1 | v1 = 1;
0x00002d10 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002d14 bne v0, v1, 0x2d50 |
| while (1) {
| label_0:
0x00002d18 lw t9, -0x7ef8(gp) | t9 = sym.imp.g_sockaddr_unref;
0x00002d1c move a0, s2 | a0 = s2;
0x00002d20 jalr t9 | t9 ();
0x00002d24 lw v0, 4(s1) | v0 = *((s1 + 1));
0x00002d28 lw ra, 0x34(sp) | ra = *(var_34h);
0x00002d2c addiu v0, v0, 1 | v0++;
0x00002d30 lw s4, 0x30(sp) | s4 = *(var_30h);
0x00002d34 lw s3, 0x2c(sp) | s3 = *(var_2ch);
0x00002d38 lw s2, 0x28(sp) | s2 = *(var_28h);
0x00002d3c lw s1, 0x24(sp) | s1 = *(var_24h);
0x00002d40 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00002d44 sltu v0, zero, v0 | v0 = (0 < v0) ? 1 : 0;
0x00002d48 addiu sp, sp, 0x38 |
0x00002d4c jr ra | return v0;
0x00002d50 lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x00002d54 lw t9, -0x7f0c(gp) | t9 = sym.imp.__errno_location;
0x00002d58 lw s4, (s1) | s4 = *(s1);
0x00002d5c lw s3, (v0) | s3 = *(v0);
0x00002d60 jalr t9 | t9 ();
0x00002d64 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002d68 lw t9, -0x7f48(gp) | t9 = sym.imp.strerror;
0x00002d6c lw a0, (v0) | a0 = *(v0);
0x00002d70 jalr t9 | t9 ();
0x00002d74 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002d78 move a3, s4 | a3 = s4;
0x00002d7c addiu a1, zero, 1 | a1 = 1;
0x00002d80 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00002d84 lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00002d88 addiu a2, a2, 0x3bc8 | a2 += str.Error_connecting_control_socket__socket_s__error_s_n;
0x00002d8c move a0, s3 | a0 = s3;
0x00002d90 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00002d94 jalr t9 | t9 ();
0x00002d98 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002d9c lw t9, -0x7f6c(gp) | t9 = sym.imp.close;
0x00002da0 lw a0, 4(s1) | a0 = *((s1 + 1));
0x00002da4 jalr t9 | t9 ();
0x00002da8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002dac sw s0, 4(s1) | *((s1 + 1)) = s0;
0x00002db0 b 0x2d18 |
| }
| label_1:
0x00002db4 lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x00002db8 lw t9, -0x7f0c(gp) | t9 = sym.imp.__errno_location;
0x00002dbc lw s3, (s1) | s3 = *(s1);
0x00002dc0 lw s0, (v0) | s0 = *(v0);
0x00002dc4 jalr t9 | t9 ();
0x00002dc8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002dcc lw t9, -0x7f48(gp) | t9 = sym.imp.strerror;
0x00002dd0 lw a0, (v0) | a0 = *(v0);
0x00002dd4 jalr t9 | t9 ();
0x00002dd8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002ddc sw v0, 0x10(sp) | *(var_10h) = v0;
0x00002de0 move a3, s3 | a3 = s3;
0x00002de4 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00002de8 lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00002dec addiu a2, a2, 0x3b90 | a2 += str.Error_opening_control_socket__socket_s__error_s_n;
0x00002df0 addiu a1, zero, 1 | a1 = 1;
0x00002df4 move a0, s0 | a0 = s0;
0x00002df8 jalr t9 | t9 ();
0x00002dfc lw gp, 0x18(sp) | gp = *(var_18h);
0x00002e00 b 0x2d18 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/syslog-ng-ctl @ 0x2e58 */
| #include <stdint.h>
|
; (fcn) sym.control_client_read_reply () | void control_client_read_reply () {
0x00002e58 lui gp, 2 |
0x00002e5c addiu gp, gp, -0x6b08 |
0x00002e60 addu gp, gp, t9 | gp += t9;
0x00002e64 addiu sp, sp, -0x2040 |
0x00002e68 lw t9, -0x7f18(gp) | t9 = sym.imp.g_string_sized_new;
0x00002e6c sw s4, 0x2034(sp) | *(arg_2034h) = s4;
0x00002e70 lw s4, -0x7ec0(gp) | s4 = *((gp - 8112));
0x00002e74 sw gp, 0x10(sp) | *(arg_10h) = gp;
0x00002e78 sw s5, 0x2038(sp) | *(arg_2038h) = s5;
0x00002e7c lw v0, (s4) | v0 = *(s4);
0x00002e80 sw s3, 0x2030(sp) | *(arg_2030h) = s3;
0x00002e84 sw s2, 0x202c(sp) | *(arg_202ch) = s2;
0x00002e88 sw s1, 0x2028(sp) | *(arg_2028h) = s1;
0x00002e8c sw s0, 0x2024(sp) | *(arg_2024h) = s0;
0x00002e90 sw ra, 0x203c(sp) | *(arg_203ch) = ra;
0x00002e94 move s2, a0 | s2 = a0;
0x00002e98 sw v0, 0x201c(sp) | *(arg_201ch) = v0;
0x00002e9c addiu a0, zero, 0x100 | a0 = 0x100;
0x00002ea0 jalr t9 | t9 ();
0x00002ea4 lw gp, 0x10(sp) | gp = *(arg_10h);
0x00002ea8 move s0, v0 | s0 = v0;
0x00002eac addiu s5, sp, 0x1c | s5 = sp + 0x1c;
0x00002eb0 addiu s1, zero, 0xa | s1 = 0xa;
0x00002eb4 addiu s3, zero, 0x2e | s3 = 0x2e;
| do {
0x00002eb8 lw t9, -0x7f70(gp) | t9 = sym.imp.read;
| label_0:
0x00002ebc lw a0, 4(s2) | a0 = *((s2 + 1));
| label_1:
0x00002ec0 addiu a2, zero, 0x1fff | a2 = 0x1fff;
0x00002ec4 move a1, s5 | a1 = s5;
0x00002ec8 jalr t9 | t9 ();
0x00002ecc lw gp, 0x10(sp) | gp = *(arg_10h);
| if (v0 < 0) {
0x00002ed0 bltz v0, 0x2f3c | goto label_2;
| }
| if (v0 == 0) {
0x00002ed4 beql v0, zero, 0x2fd0 | goto label_3;
| }
0x00002ed8 lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x00002edc lw t9, -0x7ed8(gp) | t9 = sym.imp.g_string_append_len;
0x00002ee0 move a1, s5 | a1 = s5;
0x00002ee4 move a0, s0 | a0 = s0;
0x00002ee8 move a2, v0 | a2 = v0;
0x00002eec jalr t9 | t9 ();
0x00002ef0 lw v0, (s0) | v0 = *(s0);
0x00002ef4 lw a1, 4(s0) | a1 = *((s0 + 1));
0x00002ef8 addu v1, v0, a1 | v1 = v0 + a1;
0x00002efc lb a0, -1(v1) | a0 = *((v1 - 1));
0x00002f00 lw gp, 0x10(sp) | gp = *(arg_10h);
0x00002f04 bne a0, s1, 0x2eb8 |
| } while (a0 != s1);
0x00002f08 lb v1, -2(v1) | v1 = *((v1 - 2));
0x00002f0c lw t9, -0x7f70(gp) | t9 = sym.imp.read;
| if (v1 != s3) {
0x00002f10 bne v1, s3, 0x2ebc | goto label_0;
| }
0x00002f14 addiu a1, a1, -3 | a1 += -3;
0x00002f18 addu v0, v0, a1 | v0 += a1;
0x00002f1c lb v0, (v0) | v0 = *(v0);
0x00002f20 lw a0, 4(s2) | a0 = *((s2 + 1));
| if (v0 == s1) {
0x00002f24 bnel v0, s1, 0x2ec0 | goto label_1;
| }
0x00002f28 lw t9, -0x7ebc(gp) | t9 = sym.imp.g_string_truncate;
0x00002f2c move a0, s0 | a0 = s0;
0x00002f30 jalr t9 | t9 ();
0x00002f34 lw gp, 0x10(sp) | gp = *(arg_10h);
0x00002f38 b 0x2f9c | goto label_4;
| label_2:
0x00002f3c lw v0, -0x7f90(gp) | v0 = *((gp - 8164));
0x00002f40 lw t9, -0x7f0c(gp) | t9 = sym.imp.__errno_location;
0x00002f44 lw s1, (v0) | s1 = *(v0);
0x00002f48 jalr t9 | t9 ();
0x00002f4c lw gp, 0x10(sp) | gp = *(arg_10h);
0x00002f50 lw t9, -0x7f48(gp) | t9 = sym.imp.strerror;
0x00002f54 lw a0, (v0) | a0 = *(v0);
0x00002f58 jalr t9 | t9 ();
0x00002f5c lw gp, 0x10(sp) | gp = *(arg_10h);
0x00002f60 move a3, v0 | a3 = v0;
0x00002f64 addiu a1, zero, 1 | a1 = 1;
0x00002f68 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00002f6c lw t9, -0x7f54(gp) | t9 = sym.imp.__fprintf_chk
0x00002f70 addiu a2, a2, 0x3c04 | a2 += str.Error_reading_control_socket__error_s_n;
0x00002f74 move a0, s1 | a0 = s1;
| do {
0x00002f78 jalr t9 | t9 ();
0x00002f7c nop |
0x00002f80 lw gp, 0x10(sp) | gp = *(arg_10h);
0x00002f84 move a0, s0 | a0 = s0;
0x00002f88 addiu a1, zero, 1 | a1 = 1;
0x00002f8c lw t9, -0x7f44(gp) | t9 = sym.imp.g_string_free;
0x00002f90 move s0, zero | s0 = 0;
0x00002f94 jalr t9 | t9 ();
0x00002f98 lw gp, 0x10(sp) | gp = *(arg_10h);
| label_4:
0x00002f9c lw a0, 0x201c(sp) | a0 = *(arg_201ch);
0x00002fa0 lw v1, (s4) | v1 = *(s4);
0x00002fa4 move v0, s0 | v0 = s0;
| if (a0 != v1) {
0x00002fa8 bne a0, v1, 0x2fec | goto label_5;
| }
0x00002fac lw ra, 0x203c(sp) | ra = *(arg_203ch);
0x00002fb0 lw s5, 0x2038(sp) | s5 = *(arg_2038h);
0x00002fb4 lw s4, 0x2034(sp) | s4 = *(arg_2034h);
0x00002fb8 lw s3, 0x2030(sp) | s3 = *(arg_2030h);
0x00002fbc lw s2, 0x202c(sp) | s2 = *(arg_202ch);
0x00002fc0 lw s1, 0x2028(sp) | s1 = *(arg_2028h);
0x00002fc4 lw s0, 0x2024(sp) | s0 = *(arg_2024h);
0x00002fc8 addiu sp, sp, 0x2040 |
0x00002fcc jr ra | return v0;
| label_3:
0x00002fd0 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00002fd4 lw t9, -0x7ee8(gp) | t9 = sym.imp.fwrite;
0x00002fd8 lw a3, (v0) | a3 = *(v0);
0x00002fdc addiu a2, zero, 0x2a | a2 = 0x2a;
0x00002fe0 addiu a1, zero, 1 | a1 = 1;
0x00002fe4 addiu a0, a0, 0x3c30 | a0 += str.EOF_occurred_while_reading_control_socket_n;
0x00002fe8 b 0x2f78 |
| } while (1);
| label_5:
0x00002fec lw t9, -0x7f20(gp) | t9 = sym.imp.__stack_chk_fail;
0x00002ff0 jalr t9 | t9 ();
0x00002ff4 nop |
| }
[*] Function fprintf used 9 times syslog-ng-ctl