// // sub_E19A3C from 0xe19a3c to 0xe1a3a0 (2404 bytes) // // 1 xrefs: // > sub_DFD970 @ 0xdfda78 // // 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:09:43 +0000 // __int64 __fastcall sub_E19A3C(const char *a1, const char *a2, char *a3, int a4, int a5, __int64 a6) { unsigned int v7; // w24 unsigned int v11; // w25 size_t v12; // x0 _QWORD *v13; // x21 size_t v14; // x26 __int64 v15; // x22 int v16; // w0 __int64 v17; // x2 char v18; // w4 unsigned int v19; // w19 __int64 v21; // x0 __int64 v22; // x0 __int64 v23; // x0 int v24; // w0 __int64 v25; // x0 __int64 v26; // x0 __int64 v27; // x0 __int64 v28; // x22 __int64 v29; // x22 int v30; // w0 __int64 v31; // x5 __int64 v32; // x0 __int64 v33; // x5 __int64 v34; // x0 size_t v35; // x22 size_t v36; // x3 size_t v37; // x0 __int64 v38; // x22 const char *v39; // x1 size_t v40; // x22 __int64 v41; // x22 int v42; // w5 size_t v43; // [xsp+D0h] [xbp+70h] char *v45; // [xsp+E8h] [xbp+88h] __int64 v46; // [xsp+F8h] [xbp+98h] BYREF ssize_t v47; // [xsp+100h] [xbp+A0h] BYREF char *v48; // [xsp+108h] [xbp+A8h] BYREF char buf[64]; // [xsp+110h] [xbp+B0h] BYREF __int16 v50; // [xsp+150h] [xbp+F0h] BYREF char v51; // [xsp+152h] [xbp+F2h] BYREF char v52; // [xsp+153h] [xbp+F3h] unsigned __int8 v53; // [xsp+154h] [xbp+F4h] unsigned __int8 v54; // [xsp+155h] [xbp+F5h] BYREF unsigned __int8 v55; // [xsp+156h] [xbp+F6h] unsigned __int8 v56; // [xsp+157h] [xbp+F7h] unsigned __int8 v57; // [xsp+158h] [xbp+F8h] unsigned __int8 v58; // [xsp+159h] [xbp+F9h] char v59[590]; // [xsp+15Ah] [xbp+FAh] BYREF v7 = *(_DWORD *)(a6 + 4LL * a5 + 608); v11 = *(_DWORD *)(a6 + 320) == 5; v12 = strlen(a3); v13 = *(_QWORD **)a6; v14 = v12; if ( *(_BYTE *)(a6 + 958) ) sub_DF16E0(*(_QWORD *)a6, "SOCKS5: connecting to HTTP proxy %s port %d\n", a3, a4); if ( (v14 > 0xFF) > v11 ) { v11 = 1; sub_DF16E0(*(_QWORD *)a6, "SOCKS5: server resolving disabled for hostnames of length > 255 [actual len=%zu]\n", v14); } v15 = sub_E0E488(v13, nullptr, 1u); if ( v15 < 0 ) { v19 = 28; sub_DF1848((__int64)v13, "Connection time-out"); return v19; } sub_E1AE64(v7, 1); v16 = sub_E16180(-1, -1, v7, v15); if ( v16 == -1 ) { v21 = *(_QWORD *)a6; v19 = 7; sub_DF1848(v21, "SOCKS5: no connection here"); return v19; } if ( !v16 ) { v23 = *(_QWORD *)a6; v19 = 28; sub_DF1848(v23, "SOCKS5: connection timeout"); return v19; } v17 = v16 & 4; if ( (v16 & 4) != 0 ) { v22 = *(_QWORD *)a6; v19 = 7; sub_DF1848(v22, "SOCKS5: error occurred during connection", v17); return v19; } if ( a1 ) v18 = 2; else v18 = 1; HIBYTE(v50) = v18; LOBYTE(v50) = 5; v51 = v16 & 4; v52 = 2; sub_E1AE64(v7, v16 & 4); sub_DF16E0((__int64)v13, "SOCKS5 communication to %s:%d\n", a3, a4); if ( (unsigned int)sub_DF1E3C(a6, v7, &v50, HIBYTE(v50) + 2LL, &v47) || HIBYTE(v50) + 2LL != v47 ) { v19 = 7; sub_DF1848((__int64)v13, "Unable to send initial SOCKS5 request."); return v19; } sub_E1AE64(v7, 1); v24 = sub_E16180(v7, -1, 0xFFFFFFFF, v15); if ( v24 == -1 ) { v27 = *(_QWORD *)a6; v19 = 7; sub_DF1848(v27, "SOCKS5 nothing to read"); return v19; } if ( !v24 ) { v26 = *(_QWORD *)a6; v19 = 28; sub_DF1848(v26, "SOCKS5 read timeout"); return v19; } if ( (v24 & 4) != 0 ) { v25 = *(_QWORD *)a6; v19 = 56; sub_DF1848(v25, "SOCKS5 read error occurred"); return v19; } sub_E1AE64(v7, v24 & 4); if ( (unsigned int)sub_E19398((_QWORD **)a6, v7, (char *)&v50, 2u, &v46) || v46 != 2 ) { v19 = 7; sub_DF1848((__int64)v13, "Unable to receive initial SOCKS5 response."); return v19; } if ( (unsigned __int8)v50 != 5 ) { v19 = 7; sub_DF1848((__int64)v13, "Received invalid version in initial SOCKS5 response."); return v19; } if ( HIBYTE(v50) ) { if ( HIBYTE(v50) != 2 ) { if ( HIBYTE(v50) == 1 ) { v19 = 7; sub_DF1848((__int64)v13, "SOCKS5 GSSAPI per-message authentication is not supported."); } else if ( HIBYTE(v50) == 255 ) { if ( a1 && *a1 ) { v19 = 7; sub_DF1848((__int64)v13, "No authentication method was acceptable."); } else { v19 = 7; sub_DF1848( (__int64)v13, "No authentication method was acceptable. (It is quite likely that the SOCKS5 server wanted a username/passwo" "rd, since none was supplied to the server on this connection.)"); } } else { v19 = 7; sub_DF1848((__int64)v13, "Undocumented SOCKS5 mode attempted to be used by server."); } return v19; } if ( a1 && a2 ) { v35 = strlen(a1); v36 = strlen(a2); HIBYTE(v50) = v35; LOBYTE(v50) = 1; if ( v35 ) { v43 = v36; memcpy(&v51, a1, v35); v36 = v43; } v37 = v35 + 2; v38 = v35 + 3; *((_BYTE *)&v50 + v37) = v36; if ( v36 ) { v39 = a2; v45 = (char *)v36; memcpy((char *)&v50 + v38, v39, v36); v36 = (size_t)v45; } } else { v50 = 1; v36 = 0; v51 = 0; v38 = 3; } v40 = v38 + v36; if ( (unsigned int)sub_DF1E3C(a6, v7, &v50, v40, &v47) || v40 != v47 ) { v19 = 7; sub_DF1848((__int64)v13, "Failed to send SOCKS5 sub-negotiation request."); return v19; } if ( (unsigned int)sub_E19398((_QWORD **)a6, v7, (char *)&v50, 2u, &v46) || v46 != 2 ) { v19 = 7; sub_DF1848((__int64)v13, "Unable to receive SOCKS5 sub-negotiation response."); return v19; } if ( HIBYTE(v50) ) { v19 = 7; sub_DF1848((__int64)v13, "User was rejected by the SOCKS5 server (%d %d).", (unsigned __int8)v50, HIBYTE(v50)); return v19; } } v50 = 261; v51 = 0; if ( v11 ) { if ( (((unsigned int)sub_DE7794((__int64 *)a6, a3, a4, &v48) + 1) & 0xFFFFFFFD) != 0 ) { if ( v48 ) { v29 = *(_QWORD *)v48; if ( *(_QWORD *)v48 ) { sub_DE73B0(*(_QWORD *)v48, buf, 0x40u); v30 = *(_DWORD *)(v29 + 4); if ( v30 == 2 ) { v52 = 1; v33 = 4; v34 = *(_QWORD *)(v29 + 32); do { *((_BYTE *)&v50 + v33) = *(_BYTE *)(v34 + v33); ++v33; } while ( v33 != 8 ); v28 = 8; sub_DF16E0((__int64)v13, "SOCKS5 connect to IPv4 %s (locally resolved)\n", buf); goto LABEL_49; } if ( v30 == 10 ) { v52 = 4; v31 = 4; v32 = *(_QWORD *)(v29 + 32); do { *((_BYTE *)&v50 + v31) = *(_BYTE *)(v32 + v31 + 4); ++v31; } while ( v31 != 20 ); v28 = 20; sub_DF16E0((__int64)v13, "SOCKS5 connect to IPv6 %s (locally resolved)\n", buf); LABEL_49: sub_DE7C28((__int64)v13, v48); goto LABEL_38; } sub_DF1848((__int64)v13, "SOCKS5 connection to %s not supported\n", buf); sub_DE7C28((__int64)v13, v48); } } sub_DF1848((__int64)v13, "Failed to resolve \"%s\" for SOCKS5 connect.", a3); } return 6; } v53 = v14; v28 = v14 + 5; v52 = 3; memcpy(&v54, a3, v14); LABEL_38: *((_BYTE *)&v50 + v28) = BYTE1(a4); *((_BYTE *)&v50 + v28 + 1) = a4; if ( (unsigned int)sub_DF1E3C(a6, v7, &v50, v28 + 2, &v47) || v28 + 2 != v47 ) { v19 = 7; sub_DF1848((__int64)v13, "Failed to send SOCKS5 connect request."); return v19; } if ( (unsigned int)sub_E19398((_QWORD **)a6, v7, (char *)&v50, 0xAu, &v46) || (v41 = v46, v46 != 10) ) { LABEL_77: v19 = 7; sub_DF1848((__int64)v13, "Failed to receive SOCKS5 connect request ack."); return v19; } if ( (unsigned __int8)v50 != 5 ) { v19 = 7; sub_DF1848((__int64)v13, "SOCKS5 reply has wrong version, version should be 5."); return v19; } if ( v52 == 3 ) { v41 = v53 + 7; if ( (int)v41 <= 10 ) { if ( HIBYTE(v50) ) { LABEL_90: v42 = *((unsigned __int8 *)&v50 + v41 - 2); v19 = 7; *((_BYTE *)&v50 + v41 - 2) = 0; sub_DF1848( (__int64)v13, "Can't complete SOCKS5 connection to %s:%d. (%d)", (const char *)&v54, *((unsigned __int8 *)&v50 + v41 - 1) | (v42 << 8), HIBYTE(v50)); return v19; } LABEL_91: v19 = 0; sub_DF16E0((__int64)v13, "SOCKS5 request granted.\n"); sub_E1AE64(v7, 1); return v19; } } else { if ( v52 != 4 ) goto LABEL_83; v41 = 22; } if ( (unsigned int)sub_E19398((_QWORD **)a6, v7, v59, v41 - 10, &v46) || v41 - 10 != v46 ) goto LABEL_77; LABEL_83: if ( !HIBYTE(v50) ) goto LABEL_91; if ( v52 == 1 ) { v19 = 7; sub_DF1848( (__int64)v13, "Can't complete SOCKS5 connection to %d.%d.%d.%d:%d. (%d)", v53, v54, v55, v56, v58 | (v57 << 8), HIBYTE(v50)); return v19; } if ( v52 == 3 ) goto LABEL_90; v19 = 7; if ( v52 == 4 ) sub_DF1848( (__int64)v13, "Can't complete SOCKS5 connection to %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%d. (%d)", v53, v54, v55, v56, v57, v58, (unsigned __int8)v59[0], (unsigned __int8)v59[1], (unsigned __int8)v59[2], (unsigned __int8)v59[3], (unsigned __int8)v59[4], (unsigned __int8)v59[5], (unsigned __int8)v59[6], (unsigned __int8)v59[7], (unsigned __int8)v59[8], (unsigned __int8)v59[9], (unsigned __int8)v59[11] | ((unsigned __int8)v59[10] << 8), HIBYTE(v50)); return v19; }
GD Web Decomp Icon

GD Web Decomp

Raw Source