// // sub_9E6E44 from 0x9e6e44 to 0x9e731c (1240 bytes) // // 1 xrefs: // > @ 0xc77a3c // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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 12:07:24 +0000 // ssize_t __fastcall sub_9E6E44(_DWORD *a1, void *a2, size_t a3) { struct addrinfo **v3; // r4 struct addrinfo *v5; // r1 struct addrinfo *v8; // r6 ssize_t v9; // r11 struct addrinfo *v10; // r3 int v12; // r0 unsigned int v13; // r3 struct addrinfo *v14; // r3 int v15; // r11 int v16; // r0 int v17; // r0 int v18; // r11 unsigned __int16 *v19; // r0 int v20; // r0 int v21; // r0 _BOOL4 v22; // r0 _DWORD *v23; // r0 _DWORD *v24; // r0 int v25; // r0 struct addrinfo **v26; // [sp+8h] [bp-Ch] int v27; // [sp+Ch] [bp-8h] v3 = (struct addrinfo **)a1[8]; v5 = *v3; if ( *v3 == (struct addrinfo *)&byte_5 ) { v9 = 0; goto LABEL_14; } v8 = v3[7]; v9 = -1; while ( 2 ) { switch ( (unsigned int)v5 ) { case 1u: if ( !v3[2] && !v3[3] ) { ERR_put_error(32, 115, 144, "crypto/bio/bss_conn.c", 83); ERR_add_error_data(4, "hostname=", v3[2]); goto LABEL_10; } *v3 = (struct addrinfo *)(&dword_0 + 2); if ( v8 ) goto LABEL_30; goto LABEL_6; case 2u: LABEL_6: v10 = v3[1]; if ( v10 == (struct addrinfo *)&byte_6 ) { v13 = 10; } else if ( v10 == (struct addrinfo *)&dword_100 ) { v13 = 0; } else { if ( v10 != (struct addrinfo *)&byte_4 ) { ERR_put_error(32, 115, 146, "crypto/bio/bss_conn.c", 116); goto LABEL_10; } v13 = 2; } if ( !BIO_lookup((const char *)v3[2], (const char *)v3[3], 0, v13, 1, v3 + 5) ) goto LABEL_10; v14 = v3[5]; if ( v14 ) { v3[6] = v14; *v3 = (struct addrinfo *)(&dword_0 + 3); if ( v8 ) goto LABEL_30; LABEL_24: v27 = BIO_ADDRINFO_family((int)v3[6]); v15 = BIO_ADDRINFO_socktype((int)v3[6]); v16 = BIO_ADDRINFO_protocol(v3[6]); v17 = BIO_socket(v27, v15, v16); v9 = v17; if ( v17 == -1 ) { v23 = (_DWORD *)_errno(); ERR_put_error(2, 4, *v23, "crypto/bio/bss_conn.c", 137); ERR_add_error_data(4, "hostname=", v3[2]); ERR_put_error(32, 115, 118, "crypto/bio/bss_conn.c", 141); goto LABEL_46; } a1[7] = v17; *v3 = (struct addrinfo *)&byte_4; if ( v8 ) { LABEL_30: v9 = ((int (__fastcall *)(_DWORD *))v8)(a1); if ( !v9 ) return v9; v5 = *v3; } else { LABEL_26: BIO_clear_flags((int)a1, 15); v18 = a1[7]; v19 = (unsigned __int16 *)BIO_ADDRINFO_address((int)v3[6]); v20 = BIO_connect(v18, v19, *((_BYTE *)v3 + 16) | 4); a1[6] = 0; v9 = v20; if ( v20 ) { LABEL_18: *v3 = (struct addrinfo *)&byte_5; if ( !v8 ) { LABEL_19: v9 = 1; goto LABEL_14; } goto LABEL_30; } if ( BIO_sock_should_retry(0) ) { v25 = BIO_set_flags((int)a1, 12); *v3 = (struct addrinfo *)&byte_6; a1[6] = 2; ERR_clear_error(v25); LABEL_46: if ( v8 ) goto LABEL_11; return v9; } v21 = BIO_ADDRINFO_next((int)v3[6]); v3[6] = (struct addrinfo *)v21; if ( !v21 ) { v24 = (_DWORD *)_errno(); ERR_put_error(2, 2, *v24, "crypto/bio/bss_conn.c", 169); ERR_add_error_data(4, "hostname=", v3[2]); ERR_put_error(32, 115, 103, "crypto/bio/bss_conn.c", 173); goto LABEL_46; } v22 = BIO_closesocket(a1[7]); *v3 = (struct addrinfo *)(&dword_0 + 3); ERR_clear_error(v22); v5 = *v3; if ( v8 ) goto LABEL_30; } continue; } ERR_put_error(32, 115, 142, "crypto/bio/bss_conn.c", 125); LABEL_10: if ( v8 ) { LABEL_11: v5 = *v3; LABEL_12: v9 = ((int (__fastcall *)(_DWORD *, struct addrinfo *, ssize_t))v8)(a1, v5, v9); } if ( v9 > 0 ) { LABEL_14: if ( a2 ) { *(_DWORD *)_errno() = 0; v9 = read(a1[7], a2, a3); BIO_clear_flags((int)a1, 15); if ( v9 <= 0 ) { if ( BIO_sock_should_retry(v9) ) BIO_set_flags((int)a1, 9); } } } return v9; case 3u: goto LABEL_24; case 4u: goto LABEL_26; case 5u: if ( !v8 ) goto LABEL_19; v9 = 1; goto LABEL_12; case 6u: v12 = BIO_sock_error(a1[7]); if ( !v12 ) goto LABEL_18; v26 = (struct addrinfo **)v12; BIO_clear_flags((int)a1, 15); ERR_put_error(2, 2, v26, "crypto/bio/bss_conn.c", 185); ERR_add_error_data(4, "hostname=", v3[2]); ERR_put_error(32, 115, 110, "crypto/bio/bss_conn.c", 189); v9 = 0; goto LABEL_46; default: goto LABEL_10; } } }
GD Web Decomp Icon

GD Web Decomp

Raw Source