// // sub_E3A3A0 from 0xe3a3a0 to 0xe3a618 (632 bytes) // // 1 xrefs: // > sub_E395A4 @ 0xe39804 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 13:10:00 +0000 // __int64 __fastcall sub_E3A3A0(__int64 a1, __int64 a2) { const char *v4; // x23 const char *v5; // x0 int v6; // w0 int v7; // w22 _BYTE *v8; // x24 void *v9; // x0 char *v10; // x20 char *v11; // x5 int v12; // w0 unsigned int v13; // w20 char *v14; // x4 __int64 v15; // x0 unsigned int (__fastcall *v16)(__int64, _QWORD, _QWORD, _QWORD, _QWORD); // x5 int v18; // w0 char *v19; // [xsp+48h] [xbp+48h] BYREF unsigned __int8 v20[24]; // [xsp+50h] [xbp+50h] BYREF if ( !(unsigned int)lws_hdr_total_length(a2, 3u) || !(unsigned int)lws_hdr_total_length(a2, 0x20u) ) goto LABEL_15; if ( (int)lws_hdr_total_length(a2, 0x20u) > 127 ) { lws_log(2, "Client key too long %d\n", 128); goto LABEL_15; } v4 = (const char *)(a1 + 440); v5 = (const char *)sub_E341E0(a2, 0x20u); v6 = sprintf((char *)(a1 + 440), "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", v5); lws_SHA1(a1 + 440, v6, v20); v7 = lws_b64_encode_string(v20, 20, (_BYTE *)(a1 + 440), 4096); if ( v7 < 0 ) { lws_log(2, "Base64 encoded hash too long\n"); goto LABEL_15; } if ( (unsigned int)sub_E3218C(a2) ) goto LABEL_15; v8 = (_BYTE *)(a1 + 592); v9 = (void *)(a1 + 592); v10 = (char *)(a1 + 689); memcpy( v9, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ", 0x62u); strcpy(v10, v4); v19 = &v10[v7]; if ( !(unsigned int)lws_hdr_total_length(a2, 0xCu) ) goto LABEL_9; v11 = v19; *(_QWORD *)v19 = *(_QWORD *)"\r\nSec-WebSocket-Protocol: "; strcpy(v11 + 8, "bSocket-Protocol: "); v19 += 26; v12 = lws_hdr_copy(a2, v19, 128, 0xCu); if ( v12 < 0 ) { LABEL_15: v13 = -1; sub_E33FF8(a2); return v13; } v19 += v12; LABEL_9: v13 = lws_extension_server_handshake(a2, &v19); if ( v13 ) goto LABEL_15; v14 = v19; *(_DWORD *)v19 = *(_DWORD *)"\r\n\r\n"; v14[4] = aContentTypeTex[28]; v19 += 4; if ( !(unsigned int)sub_E3A90C(a2, 14, v8, v19 - v8) ) { v18 = lws_write(a2, v8, v19 - v8, 8); if ( v19 - v8 != v18 ) goto LABEL_15; } v15 = *(_QWORD *)(a2 + 8); *(_WORD *)(a2 + 73) = 5; v16 = *(unsigned int (__fastcall **)(__int64, _QWORD, _QWORD, _QWORD, _QWORD))(v15 + 8); if ( v16 ) { if ( v16(a2, 0, *(_QWORD *)(a2 + 144), 0, 0) ) goto LABEL_15; } return v13; }
GD Web Decomp Icon

GD Web Decomp

Raw Source