[*] Binary protection state of encode
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of encode
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/encode @ 0x8b0 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 2256 named .text */
0x000008b0 lui gp, 2 |
0x000008b4 addiu gp, gp, -0x6860 |
0x000008b8 addu gp, gp, t9 | gp += t9;
0x000008bc addiu sp, sp, -0x1c8 |
0x000008c0 lw t9, -0x7f98(gp) | t9 = sym.imp.memset;
0x000008c4 sw s1, 0x1a4(sp) | *(var_1a4h) = s1;
0x000008c8 lw s1, -0x7f70(gp) | s1 = *((gp - 8156));
0x000008cc sw gp, 0x18(sp) | *(var_18h) = gp;
0x000008d0 sw s4, 0x1b0(sp) | *(var_1b0h) = s4;
0x000008d4 lw v0, (s1) | v0 = *(s1);
0x000008d8 sw s3, 0x1ac(sp) | *(var_1ach) = s3;
0x000008dc sw s2, 0x1a8(sp) | *(var_1a8h) = s2;
0x000008e0 sw ra, 0x1c4(sp) | *(var_1c4h) = ra;
0x000008e4 sw fp, 0x1c0(sp) | *(var_1c0h) = fp;
0x000008e8 sw s7, 0x1bc(sp) | *(var_1bch) = s7;
0x000008ec sw s6, 0x1b8(sp) | *(var_1b8h) = s6;
0x000008f0 sw s5, 0x1b4(sp) | *(var_1b4h) = s5;
0x000008f4 sw s0, 0x1a0(sp) | *(var_1a0h) = s0;
0x000008f8 move s4, a0 | s4 = a0;
0x000008fc move s3, a1 | s3 = a1;
0x00000900 addiu a0, sp, 0x60 | a0 = sp + 0x60;
0x00000904 addiu a2, zero, 0x108 | a2 = 0x108;
0x00000908 move a1, zero | a1 = 0;
0x0000090c sw v0, 0x19c(sp) | *(var_19ch) = v0;
0x00000910 addiu s2, sp, 0x20 | s2 = sp + 0x20;
0x00000914 jalr t9 | t9 ();
0x00000918 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000091c move v1, s2 | v1 = s2;
0x00000920 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
| /* esilref: 'mime' */
0x00000924 addiu v0, v0, 0x2010 | v0 += 0x2010;
0x00000928 addiu a0, v0, 0x40 | a0 = v0 + 0x40;
| do {
0x0000092c lw t0, (v0) | t0 = *(v0);
0x00000930 lw a3, 4(v0) | a3 = *((v0 + 1));
0x00000934 lw a2, 8(v0) | a2 = *((v0 + 2));
0x00000938 lw a1, 0xc(v0) | a1 = *((v0 + 3));
0x0000093c addiu v0, v0, 0x10 | v0 += 0x10;
0x00000940 sw t0, (v1) | *(v1) = t0;
0x00000944 sw a3, 4(v1) | *((v1 + 1)) = a3;
0x00000948 sw a2, 8(v1) | *((v1 + 2)) = a2;
0x0000094c sw a1, 0xc(v1) | *((v1 + 3)) = a1;
0x00000950 addiu v1, v1, 0x10 | v1 += 0x10;
0x00000954 bne v0, a0, 0x92c |
| } while (v0 != a0);
0x00000958 lw s0, -0x7fd8(gp) | s0 = *((gp - 8182));
0x0000095c lw s7, -0x7fac(gp) | s7 = *((gp - 8171));
0x00000960 addiu s6, zero, -1 | s6 = -1;
0x00000964 addiu s0, s0, 0x126c | s0 += str.mqc:;
0x00000968 addiu s5, zero, 0x6d | s5 = 0x6d;
0x0000096c addiu fp, sp, 0x68 | fp = sp + 0x68;
| do {
| label_0:
0x00000970 lw t9, -0x7f8c(gp) | t9 = sym.imp.getopt_long;
0x00000974 sw zero, 0x10(sp) | *(var_10h) = 0;
0x00000978 move a3, s2 | a3 = s2;
0x0000097c move a2, s0 | a2 = s0;
0x00000980 move a1, s3 | a1 = s3;
0x00000984 move a0, s4 | a0 = s4;
0x00000988 jalr t9 | t9 ();
0x0000098c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == s6) {
0x00000990 beq v0, s6, 0xa68 | goto label_3;
| }
0x00000994 addiu v1, zero, 0x71 | v1 = 0x71;
| if (v0 == s5) {
0x00000998 beq v0, s5, 0xa5c | goto label_4;
| }
0x0000099c addiu v1, zero, 0x63 | v1 = 0x63;
| if (v0 == v1) {
0x000009a0 beq v0, v1, 0xa50 | goto label_5;
| }
0x000009a4 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
| if (v0 != v1) {
0x000009a8 beq v0, v1, 0xa30 |
0x000009ac lw s0, -0x7f6c(gp) | s0 = *((gp - 8155));
0x000009b0 lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x000009b4 lw a0, (s0) | a0 = *(s0);
0x000009b8 move a3, v0 | a3 = v0;
0x000009bc addiu a2, a2, 0x1258 | a2 += str.Unknown_option__c_n;
0x000009c0 addiu a1, zero, 1 | a1 = 1;
0x000009c4 jalr t9 | t9 ();
0x000009c8 lw gp, 0x18(sp) | gp = *(var_18h);
| label_2:
0x000009cc lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x000009d0 lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x000009d4 lw a0, (s0) | a0 = *(s0);
0x000009d8 lw a3, (s3) | a3 = *(s3);
0x000009dc addiu a2, a2, 0x12c8 | a2 += str.Usage:__s___mq___c__charset__n;
0x000009e0 addiu a1, zero, 1 | a1 = 1;
0x000009e4 jalr t9 | t9 ();
0x000009e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x000009ec addiu s0, zero, 1 | s0 = 1;
| label_1:
0x000009f0 lw a0, 0x19c(sp) | a0 = *(var_19ch);
0x000009f4 lw v1, (s1) | v1 = *(s1);
0x000009f8 move v0, s0 | v0 = s0;
| if (a0 != v1) {
0x000009fc bne a0, v1, 0xb44 | goto label_6;
| }
0x00000a00 lw ra, 0x1c4(sp) | ra = *(var_1c4h);
0x00000a04 lw fp, 0x1c0(sp) | fp = *(var_1c0h);
0x00000a08 lw s7, 0x1bc(sp) | s7 = *(var_1bch);
0x00000a0c lw s6, 0x1b8(sp) | s6 = *(var_1b8h);
0x00000a10 lw s5, 0x1b4(sp) | s5 = *(var_1b4h);
0x00000a14 lw s4, 0x1b0(sp) | s4 = *(var_1b0h);
0x00000a18 lw s3, 0x1ac(sp) | s3 = *(var_1ach);
0x00000a1c lw s2, 0x1a8(sp) | s2 = *(var_1a8h);
0x00000a20 lw s1, 0x1a4(sp) | s1 = *(var_1a4h);
0x00000a24 lw s0, 0x1a0(sp) | s0 = *(var_1a0h);
0x00000a28 addiu sp, sp, 0x1c8 |
0x00000a2c jr ra | return v0;
| }
0x00000a30 lw t9, -0x7f9c(gp) | t9 = sym.imp.strncpy;
0x00000a34 lw a1, (s7) | a1 = *(s7);
0x00000a38 addiu a2, zero, 0xff | a2 = 0xff;
0x00000a3c move a0, fp | a0 = fp;
0x00000a40 jalr t9 | t9 ();
0x00000a44 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a48 sb zero, 0x166(sp) | *(var_166h) = 0;
0x00000a4c b 0x970 |
| } while (1);
| label_5:
0x00000a50 addiu v0, zero, 1 | v0 = 1;
0x00000a54 sw v0, 0x64(sp) | *(var_64h) = v0;
0x00000a58 b 0x970 | goto label_0;
| label_4:
0x00000a5c addiu v0, zero, 1 | v0 = 1;
0x00000a60 sw v0, 0x60(sp) | *(var_60h) = v0;
0x00000a64 b 0x970 | goto label_0;
| label_3:
0x00000a68 lw s0, 0x64(sp) | s0 = *(var_64h);
0x00000a6c lw v0, 0x60(sp) | v0 = *(var_60h);
| if (s0 != 0) {
0x00000a70 beqz s0, 0xacc |
0x00000a74 lw v0, -0x7f94(gp) | v0 = *((gp - 8165));
| if (v0 != 0) {
0x00000a78 bnez v0, 0xaf4 | goto label_7;
| }
0x00000a7c lw t9, -0x7f84(gp) | t9 = sym.imp.fread;
0x00000a80 addiu s0, sp, 0x168 | s0 = sp + 0x168;
0x00000a84 lw a3, (v0) | a3 = *(v0);
0x00000a88 move a0, s0 | a0 = s0;
0x00000a8c addiu a2, zero, 0x32 | a2 = 0x32;
0x00000a90 addiu a1, zero, 1 | a1 = 1;
0x00000a94 jalr t9 | t9 ();
0x00000a98 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a9c addiu v1, sp, 0x1a0 | v1 = sp + 0x1a0;
0x00000aa0 addu v0, v1, v0 | v0 = v1 + v0;
0x00000aa4 lw v1, -0x7fa0(gp) | v1 = *((gp - 8168));
0x00000aa8 lw t9, -0x7fd4(gp) | t9 = sym.mime_toq;
0x00000aac move a0, s0 | a0 = s0;
0x00000ab0 lw a1, (v1) | a1 = *(v1);
0x00000ab4 addiu a2, sp, 0x68 | a2 = sp + 0x68;
0x00000ab8 sb zero, -0x38(v0) | *((v0 - 56)) = 0;
0x00000abc bal 0xf80 | sym_mime_toq ();
0x00000ac0 move s0, zero | s0 = 0;
0x00000ac4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000ac8 b 0x9f0 | goto label_1;
| }
0x00000acc lw v0, -0x7fa0(gp) | v0 = *((gp - 8168));
| if (v0 != 0) {
0x00000ad0 beqz v0, 0xb1c |
0x00000ad4 lw t9, -0x7fd0(gp) | t9 = sym.mime_base64_encode;
0x00000ad8 addiu a2, sp, 0x68 | a2 = sp + 0x68;
0x00000adc lw a1, (v0) | a1 = *(v0);
0x00000ae0 lw v0, -0x7f94(gp) | v0 = *((gp - 8165));
0x00000ae4 lw a0, (v0) | a0 = *(v0);
0x00000ae8 bal 0xcc0 | sym_mime_base64_encode ();
0x00000aec lw gp, 0x18(sp) | gp = *(var_18h);
0x00000af0 b 0x9f0 | goto label_1;
| label_7:
0x00000af4 lw s0, -0x7f6c(gp) | s0 = *((gp - 8155));
0x00000af8 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00000afc lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x00000b00 lw a3, (s0) | a3 = *(s0);
0x00000b04 addiu a2, zero, 0x24 | a2 = 0x24;
0x00000b08 addiu a1, zero, 1 | a1 = 1;
0x00000b0c addiu a0, a0, 0x1274 | a0 += str.Cant_both_Q_encode_and_MIME_encode_n;
0x00000b10 jalr t9 | t9 ();
0x00000b14 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000b18 b 0x9cc | goto label_2;
| }
0x00000b1c lw s0, -0x7f6c(gp) | s0 = *((gp - 8155));
0x00000b20 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00000b24 lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x00000b28 lw a3, (s0) | a3 = *(s0);
0x00000b2c addiu a2, zero, 0x2a | a2 = 0x2a;
0x00000b30 addiu a1, zero, 1 | a1 = 1;
0x00000b34 addiu a0, a0, 0x129c | a0 += str.You_must_choose_either_Q_or_MIME_encoding_n;
0x00000b38 jalr t9 | t9 ();
0x00000b3c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000b40 b 0x9cc | goto label_2;
| label_6:
0x00000b44 lw t9, -0x7f78(gp) | t9 = sym.imp.__stack_chk_fail;
0x00000b48 jalr t9 | t9 ();
0x00000b4c nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/encode @ 0xcc0 */
| #include <stdint.h>
|
; (fcn) sym.mime_base64_encode () | void mime_base64_encode () {
0x00000cc0 lui gp, 2 |
0x00000cc4 addiu gp, gp, -0x6c70 |
0x00000cc8 addu gp, gp, t9 | gp += t9;
0x00000ccc addiu sp, sp, -0x58 |
0x00000cd0 move a3, a2 | a3 = a2;
0x00000cd4 sw s5, 0x44(sp) | *(var_44h) = s5;
0x00000cd8 lw s5, -0x7f70(gp) | s5 = *((gp - 8156));
0x00000cdc lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000ce0 lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x00000ce4 lw v0, (s5) | v0 = *(s5);
0x00000ce8 sw s2, 0x38(sp) | *(var_38h) = s2;
0x00000cec move s2, a1 | s2 = a1;
0x00000cf0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00000cf4 sw ra, 0x54(sp) | *(var_54h) = ra;
0x00000cf8 sw s7, 0x4c(sp) | *(var_4ch) = s7;
0x00000cfc sw s6, 0x48(sp) | *(var_48h) = s6;
0x00000d00 sw s4, 0x40(sp) | *(var_40h) = s4;
0x00000d04 sw s3, 0x3c(sp) | *(var_3ch) = s3;
0x00000d08 sw s1, 0x34(sp) | *(var_34h) = s1;
0x00000d0c sw s0, 0x30(sp) | *(var_30h) = s0;
0x00000d10 addiu a1, zero, 1 | a1 = 1;
0x00000d14 addiu a2, a2, 0x1300 | a2 += str.Content_Type:_text_plain__charset_s_r_n;
0x00000d18 sw fp, 0x50(sp) | *(var_50h) = fp;
0x00000d1c move s3, a0 | s3 = a0;
0x00000d20 sw v0, 0x2c(sp) | *(var_2ch) = v0;
0x00000d24 move a0, s2 | a0 = s2;
0x00000d28 jalr t9 | t9 ();
0x00000d2c lw gp, 0x10(sp) | gp = *(var_10h);
0x00000d30 move a3, s2 | a3 = s2;
0x00000d34 addiu a2, zero, 0x25 | a2 = 0x25;
0x00000d38 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00000d3c lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x00000d40 addiu a1, zero, 1 | a1 = 1;
0x00000d44 addiu a0, a0, 0x1328 | a0 += str.Content_Transfer_Encoding:_base64_r_n_r_n;
0x00000d48 jalr t9 | t9 ();
0x00000d4c lw gp, 0x10(sp) | gp = *(var_10h);
0x00000d50 move s0, zero | s0 = 0;
0x00000d54 addiu s7, sp, 0x24 | s7 = sp + 0x24;
0x00000d58 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
0x00000d5c lw s1, -0x7fd8(gp) | s1 = *((gp - 8182));
0x00000d60 lw s6, -0x7fd8(gp) | s6 = *((gp - 8182));
0x00000d64 lw s4, -0x7fd8(gp) | s4 = *((gp - 8182));
0x00000d68 sw v0, 0x18(sp) | *(var_18h) = v0;
0x00000d6c addiu s1, s1, 0x1350 | s1 += str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_;
0x00000d70 addiu s6, s6, 0x1394 | s6 += str.mime:mime_base64_encode____error_occurred_in_call_to_fwrite____return_code__zd_n;
0x00000d74 lw t9, -0x7f84(gp) | t9 = sym.imp.fread;
| do {
0x00000d78 move a3, s3 | a3 = s3;
0x00000d7c addiu a2, zero, 3 | a2 = 3;
0x00000d80 addiu a1, zero, 1 | a1 = 1;
0x00000d84 move a0, s7 | a0 = s7;
0x00000d88 jalr t9 | t9 ();
0x00000d8c move fp, v0 | fp = v0;
0x00000d90 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 <= 0) {
0x00000d94 bgtz v0, 0xdf0 |
0x00000d98 lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
| label_0:
0x00000d9c move a3, s2 | a3 = s2;
0x00000da0 addiu a2, zero, 2 | a2 = 2;
0x00000da4 addiu a1, zero, 1 | a1 = 1;
0x00000da8 addiu a0, s4, 0x1324 | a0 = s4 + 0x1324;
0x00000dac jalr t9 | t9 ();
0x00000db0 lw v1, 0x2c(sp) | v1 = *(var_2ch);
0x00000db4 lw v0, (s5) | v0 = *(s5);
0x00000db8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v1 != v0) {
0x00000dbc bne v1, v0, 0xf74 | goto label_4;
| }
0x00000dc0 lw ra, 0x54(sp) | ra = *(var_54h);
0x00000dc4 lw fp, 0x50(sp) | fp = *(var_50h);
0x00000dc8 lw s7, 0x4c(sp) | s7 = *(var_4ch);
0x00000dcc lw s6, 0x48(sp) | s6 = *(var_48h);
0x00000dd0 lw s5, 0x44(sp) | s5 = *(var_44h);
0x00000dd4 lw s4, 0x40(sp) | s4 = *(var_40h);
0x00000dd8 lw s3, 0x3c(sp) | s3 = *(var_3ch);
0x00000ddc lw s2, 0x38(sp) | s2 = *(var_38h);
0x00000de0 lw s1, 0x34(sp) | s1 = *(var_34h);
0x00000de4 lw s0, 0x30(sp) | s0 = *(var_30h);
0x00000de8 addiu sp, sp, 0x58 |
0x00000dec jr ra | return v1;
| }
0x00000df0 lbu v0, 0x24(sp) | v0 = *(var_24h);
0x00000df4 lbu v1, 0x25(sp) | v1 = *(var_25h);
0x00000df8 srl a0, v0, 2 | a0 = v0 >> 2;
0x00000dfc addu a0, s1, a0 | a0 = s1 + a0;
0x00000e00 sll v0, v0, 4 | v0 <<= 4;
0x00000e04 lbu a2, (a0) | a2 = *(a0);
0x00000e08 addiu a1, zero, 1 | a1 = 1;
0x00000e0c sll a0, v1, 2 | a0 = v1 << 2;
0x00000e10 sb a2, 0x28(sp) | *(var_28h) = a2;
0x00000e14 andi v0, v0, 0x30 | v0 &= 0x30;
0x00000e18 andi a0, a0, 0x3c | a0 &= 0x3c;
| if (fp == a1) {
0x00000e1c beq fp, a1, 0xec0 | goto label_5;
| }
0x00000e20 srl v1, v1, 4 | v1 >>= 4;
0x00000e24 or v0, v1, v0 | v0 = v1 | v0;
0x00000e28 addu v0, s1, v0 | v0 = s1 + v0;
0x00000e2c addiu v1, zero, 2 | v1 = 2;
0x00000e30 lbu v0, (v0) | v0 = *(v0);
0x00000e34 sb v0, 0x29(sp) | *(var_29h) = v0;
| if (fp == v1) {
0x00000e38 beq fp, v1, 0xf60 | goto label_6;
| }
0x00000e3c lbu v0, 0x26(sp) | v0 = *(var_26h);
0x00000e40 srl v1, v0, 6 | v1 = v0 >> 6;
0x00000e44 or a0, v1, a0 | a0 = v1 | a0;
0x00000e48 addu a0, s1, a0 | a0 = s1 + a0;
0x00000e4c andi v0, v0, 0x3f | v0 &= 0x3f;
0x00000e50 lbu v1, (a0) | v1 = *(a0);
0x00000e54 lbux v0, v0(s1) | __asm ("lbux v0, v0(s1)");
0x00000e58 sb v1, 0x2a(sp) | *(var_2ah) = v1;
| label_1:
0x00000e5c lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x00000e60 sb v0, 0x2b(sp) | *(var_2bh) = v0;
0x00000e64 move a3, s2 | a3 = s2;
0x00000e68 addiu a2, zero, 1 | a2 = 1;
0x00000e6c addiu a1, zero, 4 | a1 = 4;
0x00000e70 addiu a0, sp, 0x28 | a0 = sp + 0x28;
0x00000e74 jalr t9 | t9 ();
0x00000e78 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 <= 0) {
0x00000e7c blez v0, 0xef8 | goto label_7;
| }
| label_3:
0x00000e80 lui v0, 0x38e3 | v0 = 0x38e38e39;
0x00000e84 ori v0, v0, 0x8e39 |
0x00000e88 addiu s0, s0, 1 | s0++;
0x00000e8c multu s0, v0 | __asm ("multu s0, v0");
0x00000e90 mfhi v0 | __asm ("mfhi v0");
0x00000e94 srl v0, v0, 2 | v0 >>= 2;
0x00000e98 sll v1, v0, 3 | v1 = v0 << 3;
0x00000e9c addu v0, v1, v0 | v0 = v1 + v0;
0x00000ea0 sll v0, v0, 1 | v0 <<= 1;
0x00000ea4 lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
| if (s0 == v0) {
0x00000ea8 beq s0, v0, 0xedc | goto label_8;
| }
| label_2:
0x00000eac addiu v0, zero, 3 | v0 = 3;
0x00000eb0 beql fp, v0, 0xd78 |
| } while (fp == v0);
0x00000eb4 lw t9, -0x7f84(gp) | t9 = sym.imp.fread;
0x00000eb8 lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x00000ebc b 0xd9c | goto label_0;
| label_5:
0x00000ec0 addu v0, s1, v0 | v0 = s1 + v0;
0x00000ec4 addiu v1, zero, 0x3d | v1 = 0x3d;
0x00000ec8 lbu v0, (v0) | v0 = *(v0);
0x00000ecc sb v1, 0x2a(sp) | *(var_2ah) = v1;
0x00000ed0 sb v0, 0x29(sp) | *(var_29h) = v0;
0x00000ed4 addiu v0, zero, 0x3d | v0 = 0x3d;
0x00000ed8 b 0xe5c | goto label_1;
| label_8:
0x00000edc move a3, s2 | a3 = s2;
0x00000ee0 addiu a2, zero, 2 | a2 = 2;
0x00000ee4 addiu a1, zero, 1 | a1 = 1;
0x00000ee8 addiu a0, s4, 0x1324 | a0 = s4 + 0x1324;
0x00000eec jalr t9 | t9 ();
0x00000ef0 lw gp, 0x10(sp) | gp = *(var_10h);
0x00000ef4 b 0xeac | goto label_2;
| label_7:
0x00000ef8 lw v1, -0x7f6c(gp) | v1 = *((gp - 8155));
0x00000efc lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x00000f00 move a3, v0 | a3 = v0;
0x00000f04 lw a0, (v1) | a0 = *(v1);
0x00000f08 move a2, s6 | a2 = s6;
0x00000f0c addiu a1, zero, 1 | a1 = 1;
0x00000f10 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00000f14 jalr t9 | t9 ();
0x00000f18 lw v1, 0x1c(sp) | v1 = *(var_1ch);
0x00000f1c lw gp, 0x10(sp) | gp = *(var_10h);
0x00000f20 move a0, s2 | a0 = s2;
0x00000f24 lw v1, (v1) | v1 = *(v1);
0x00000f28 lw t9, -0x7f74(gp) | t9 = sym.imp.ferror;
0x00000f2c sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00000f30 jalr t9 | t9 ();
0x00000f34 lw gp, 0x10(sp) | gp = *(var_10h);
0x00000f38 move a3, v0 | a3 = v0;
0x00000f3c lw v1, 0x1c(sp) | v1 = *(var_1ch);
0x00000f40 lw v0, 0x18(sp) | v0 = *(var_18h);
0x00000f44 lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x00000f48 addiu a2, v0, 0x13e4 | a2 = v0 + str.mime:mime_base64_encode____ferror___returned__d_n;
0x00000f4c addiu a1, zero, 1 | a1 = 1;
0x00000f50 move a0, v1 | a0 = v1;
0x00000f54 jalr t9 | t9 ();
0x00000f58 lw gp, 0x10(sp) | gp = *(var_10h);
0x00000f5c b 0xe80 | goto label_3;
| label_6:
0x00000f60 addu a0, s1, a0 | a0 = s1 + a0;
0x00000f64 addiu v0, zero, 0x3d | v0 = 0x3d;
0x00000f68 lbu v1, (a0) | v1 = *(a0);
0x00000f6c sb v1, 0x2a(sp) | *(var_2ah) = v1;
0x00000f70 b 0xe5c | goto label_1;
| label_4:
0x00000f74 lw t9, -0x7f78(gp) | t9 = sym.imp.__stack_chk_fail;
0x00000f78 jalr t9 | t9 ();
0x00000f7c nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/encode @ 0xf80 */
| #include <stdint.h>
|
; (fcn) sym.mime_toq () | void mime_toq () {
0x00000f80 lui gp, 2 |
0x00000f84 addiu gp, gp, -0x6f30 |
0x00000f88 addu gp, gp, t9 | gp += t9;
0x00000f8c addiu sp, sp, -0x38 |
0x00000f90 sw gp, 0x10(sp) | *(var_10h_2) = gp;
0x00000f94 sw s1, 0x20(sp) | *(var_20h) = s1;
0x00000f98 sw ra, 0x34(sp) | *(var_34h_2) = ra;
0x00000f9c sw s5, 0x30(sp) | *(var_30h_2) = s5;
0x00000fa0 sw s4, 0x2c(sp) | *(var_2ch_2) = s4;
0x00000fa4 sw s3, 0x28(sp) | *(var_28h_2) = s3;
0x00000fa8 sw s2, 0x24(sp) | *(var_24h_2) = s2;
0x00000fac sw s0, 0x1c(sp) | *(var_1ch_2) = s0;
0x00000fb0 move s1, a1 | s1 = a1;
| if (a0 == 0) {
0x00000fb4 beqz a0, 0x108c | goto label_3;
| }
0x00000fb8 move a3, a2 | a3 = a2;
0x00000fbc lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00000fc0 lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x00000fc4 move s0, a0 | s0 = a0;
0x00000fc8 addiu a2, a2, 0x1418 | a2 += str.__s_Q_;
0x00000fcc addiu a1, zero, 1 | a1 = 1;
0x00000fd0 move a0, s1 | a0 = s1;
0x00000fd4 jalr t9 | t9 ();
0x00000fd8 lbu a3, (s0) | a3 = *(s0);
0x00000fdc lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (a3 == 0) {
0x00000fe0 beqz a3, 0x106c | goto label_4;
| }
0x00000fe4 lw s2, -0x7fd8(gp) | s2 = *((gp - 8182));
0x00000fe8 addiu s4, zero, 0x5f | s4 = 0x5f;
0x00000fec addiu s2, s2, 0x1420 | s2 += 0x1420;
0x00000ff0 addiu s3, zero, -3 | s3 = -3;
0x00000ff4 addiu s5, zero, 0x3d | s5 = 0x3d;
0x00000ff8 b 0x101c |
| while (v0 != 0) {
| label_0:
0x00000ffc addiu s0, s0, 1 | s0++;
| label_1:
0x00001000 move a2, s2 | a2 = s2;
0x00001004 addiu a1, zero, 1 | a1 = 1;
0x00001008 move a0, s1 | a0 = s1;
0x0000100c jalr t9 | t9 ();
0x00001010 lbu a3, (s0) | a3 = *(s0);
0x00001014 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (a3 == 0) {
0x00001018 beqz a3, 0x106c | goto label_4;
| }
| label_2:
0x0000101c slti v0, a3, 0x21 | v0 = (a3 < 0x21) ? 1 : 0;
0x00001020 lw t9, -0x7fa4(gp) | t9 = sym.imp.__fprintf_chk
0x00001024 bnez v0, 0xffc |
| }
0x00001028 and v0, a3, s3 | v0 = a3 & s3;
0x0000102c slti v1, a3, 0x7f | v1 = (a3 < 0x7f) ? 1 : 0;
| if (a3 == s4) {
0x00001030 beq a3, s4, 0xffc | goto label_0;
| }
0x00001034 addiu a2, zero, 0x2e | a2 = 0x2e;
| if (v0 == s5) {
0x00001038 beq v0, s5, 0xffc | goto label_0;
| }
0x0000103c lw v0, -0x7f7c(gp) | v0 = sym.imp._IO_putc;
0x00001040 move a1, s1 | a1 = s1;
0x00001044 move a0, a3 | a0 = a3;
| if (v1 == 0) {
0x00001048 beqz v1, 0xffc | goto label_0;
| }
0x0000104c addiu s0, s0, 1 | s0++;
| if (a3 == a2) {
0x00001050 beq a3, a2, 0x1000 | goto label_1;
| }
0x00001054 move t9, v0 | t9 = v0;
0x00001058 jalr t9 | t9 ();
0x0000105c nop |
0x00001060 lbu a3, (s0) | a3 = *(s0);
0x00001064 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (a3 != 0) {
0x00001068 bnez a3, 0x101c | goto label_2;
| }
| label_4:
0x0000106c lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00001070 lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x00001074 move a3, s1 | a3 = s1;
0x00001078 addiu a2, zero, 2 | a2 = 2;
0x0000107c addiu a1, zero, 1 | a1 = 1;
0x00001080 addiu a0, a0, 0x1424 | a0 += 0x1424;
0x00001084 jalr t9 | t9 ();
0x00001088 lw gp, 0x10(sp) | gp = *(var_10h_2);
| label_3:
0x0000108c lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00001090 lw ra, 0x34(sp) | ra = *(var_34h_2);
0x00001094 lw s5, 0x30(sp) | s5 = *(var_30h_2);
0x00001098 lw s4, 0x2c(sp) | s4 = *(var_2ch_2);
0x0000109c lw s3, 0x28(sp) | s3 = *(var_28h_2);
0x000010a0 lw s2, 0x24(sp) | s2 = *(var_24h_2);
0x000010a4 lw s0, 0x1c(sp) | s0 = *(var_1ch_2);
0x000010a8 move a3, s1 | a3 = s1;
0x000010ac lw t9, -0x7f80(gp) | t9 = sym.imp.fwrite;
0x000010b0 lw s1, 0x20(sp) | s1 = *(var_20h);
0x000010b4 addiu a2, zero, 2 | a2 = 2;
0x000010b8 addiu a1, zero, 1 | a1 = 1;
0x000010bc addiu a0, a0, 0x1324 | a0 += 0x1324;
0x000010c0 addiu sp, sp, 0x38 |
0x000010c4 jr t9 | return t9 ();
| }
[*] Function fprintf used 8 times encode