// // sub_845B88 from 0x845b88 to 0x845cc0 (312 bytes) // // 1 xrefs: // > sub_84272C @ 0x8427ac // // 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:24 +0000 // int __fastcall sub_845B88(const char *a1, const char *a2, const struct addrinfo *a3, int **a4) { int result; // r0 struct addrinfo *v5; // r4 int *v6; // r8 int *v7; // r7 int v8; // r6 size_t v9; // r11 int ai_family; // r3 int ai_addrlen; // r3 int *v12; // r5 void *(*v13)(size_t); // r1 int ai_protocol; // r2 void *v15; // r0 const char *ai_canonname; // r0 char *v17; // r0 int *v18; // r5 struct addrinfo *v20; // [sp+Ch] [bp-8h] BYREF *a4 = nullptr; result = getaddrinfo(a1, a2, a3, &v20); if ( result ) return result; v5 = v20; if ( !v20 ) { v7 = nullptr; result = 8; goto LABEL_25; } v6 = nullptr; v7 = nullptr; while ( 1 ) { while ( 1 ) { ai_family = v5->ai_family; if ( ai_family == 2 ) { v8 = 16; v9 = 16; goto LABEL_9; } if ( ai_family == 10 ) break; LABEL_6: v5 = v5->ai_next; if ( !v5 ) goto LABEL_20; } v8 = 28; v9 = 28; LABEL_9: if ( !v5->ai_addr ) goto LABEL_6; ai_addrlen = v5->ai_addrlen; if ( ai_addrlen <= 0 || v9 > ai_addrlen ) goto LABEL_6; v12 = (int *)off_D200AC(0x20u); if ( !v12 ) goto LABEL_29; *v12 = v5->ai_flags; v13 = off_D200AC; v12[1] = v5->ai_family; v12[2] = v5->ai_socktype; ai_protocol = v5->ai_protocol; v12[4] = v8; v12[6] = 0; v12[3] = ai_protocol; v12[5] = 0; v12[7] = 0; v15 = v13(v9); v12[6] = (int)v15; if ( !v15 ) { off_D200B0(v12); goto LABEL_29; } memcpy(v15, v5->ai_addr, v9); ai_canonname = v5->ai_canonname; if ( ai_canonname ) { v17 = off_D200B8(ai_canonname); v12[5] = (int)v17; if ( !v17 ) break; } if ( !v7 ) v7 = v12; if ( !v6 ) { v6 = v12; goto LABEL_6; } v6[7] = (int)v12; v6 = v12; v5 = v5->ai_next; if ( !v5 ) { LABEL_20: if ( v20 ) freeaddrinfo(v20); if ( v7 ) result = 0; else result = 8; goto LABEL_25; } } off_D200B0((void *)v12[6]); off_D200B0(v12); LABEL_29: if ( v20 ) freeaddrinfo(v20); if ( v7 ) { do { off_D200B0((void *)v7[6]); off_D200B0((void *)v7[5]); v18 = (int *)v7[7]; off_D200B0(v7); v7 = v18; } while ( v18 ); } result = 6; v7 = nullptr; LABEL_25: *a4 = v7; return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source