// // sub_854B9C from 0x854b9c to 0x854d08 (364 bytes) // // 1 xrefs: // > sub_855AE8 @ 0x855aee // // 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:02:35 +0000 // int __fastcall sub_854B9C(size_t *a1, int a2) { size_t v3; // r8 int v5; // r10 int v6; // r6 int v7; // r0 int v8; // r0 int error; // r0 int v10; // r6 size_t *v11; // r4 int shutdown; // r0 int v14; // r0 int v15; // r7 _DWORD *v16; // r0 _DWORD *v17; // r0 char v18[260]; // [sp+8h] [bp-104h] BYREF v3 = *a1; v5 = 2 * a2; if ( *(_DWORD *)(*a1 + 928) == 2 ) SSL_shutdown(a1[6 * a2 + 117]); v6 = 2 * (v5 + a2); if ( !a1[v6 + 117] ) return 0; while ( 2 ) { v7 = sub_842E08(a1[a2 + 104], -1, -1, 10000); if ( v7 <= 0 ) { if ( v7 ) { v17 = (_DWORD *)_errno(); v10 = -1; sub_828178(v3, "select/poll on SSL socket, errno: %d", *v17); } else { v10 = 0; sub_828178(v3, "SSL shutdown timeout"); } LABEL_7: if ( *(_BYTE *)(v3 + 912) ) { LABEL_10: shutdown = SSL_get_shutdown(a1[2 * v5 + 117 + 2 * a2]); switch ( shutdown ) { case 2: sub_8280FC(v3, "SSL_get_shutdown() returned SSL_RECEIVED_SHUTDOWN\n"); break; case 3: sub_8280FC(v3, "SSL_get_shutdown() returned SSL_SENT_SHUTDOWN|SSL_RECEIVED__SHUTDOWN\n"); break; case 1: sub_8280FC(v3, "SSL_get_shutdown() returned SSL_SENT_SHUTDOWN\n"); break; } } } else { ERR_clear_error(); v8 = SSL_read(a1[v6 + 117], v18, 256); error = SSL_get_error(a1[v6 + 117], v8); switch ( error ) { case 0: case 6: v10 = 0; goto LABEL_7; case 2: sub_8280FC(v3, "SSL_ERROR_WANT_READ\n"); continue; case 3: v10 = 0; sub_8280FC(v3, "SSL_ERROR_WANT_WRITE\n"); if ( *(_BYTE *)(v3 + 912) ) goto LABEL_10; break; default: v14 = ERR_get_error(error); v15 = *a1; ERR_error_string_n(v14, v18, 256); v10 = 0; v16 = (_DWORD *)_errno(); sub_828178(v15, "OpenSSL SSL read: %s, errno %d", v18, *v16); goto LABEL_7; } } break; } v11 = &a1[2 * a2 + 2 * v5]; SSL_free(v11[117]); v11[117] = 0; return v10; }
GD Web Decomp Icon

GD Web Decomp

Raw Source