// // sub_BA03A8 from 0xba03a8 to 0xba0638 (656 bytes) // // 4 xrefs: // > sub_B907E4 @ 0xb90984 // > sub_B90C68 @ 0xb90d94 // > sub_B90C68 @ 0xb914d8 // > sub_B9ACF0 @ 0xb9b100 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // __int64 __fastcall sub_BA03A8(struct pollfd *fds, nfds_t nfds, int a3) { unsigned int v4; // w19 struct pollfd *v6; // x3 struct pollfd *v7; // x1 int fd; // t1 unsigned int v9; // w1 __time_t v10; // x22 __int64 v11; // x1 __int64 v12; // x23 int v13; // w2 int v14; // w1 __time_t v15; // x0 __int64 v16; // x1 int v17; // w0 __int64 result; // x0 __time_t v19; // x22 __int64 v20; // x1 __int64 v21; // x23 int v22; // w2 int v23; // w1 __time_t v24; // x0 __int64 v25; // x1 __int16 *p_revents; // x2 __int16 *v27; // x19 __int16 v28; // w1 __int16 v29; // w3 __int16 v30; // w1 int v31; // w0 int v32; // w0 _DWORD *v33; // x0 v4 = nfds; if ( !fds || !(_DWORD)nfds ) { LABEL_7: v9 = 0; if ( a3 ) { if ( a3 < 0 ) { v33 = (_DWORD *)__errno(); v9 = -1; *v33 = 22; } else { v10 = sub_B70B94(); v12 = v11; v13 = a3; while ( 1 ) { v17 = poll(nullptr, 0, v13); if ( v17 != -1 ) break; v14 = *(_DWORD *)__errno(); if ( v14 && (v14 != 4 || dword_1247840) ) return (unsigned int)-1; v15 = sub_B70B94(); v13 = a3 - sub_B70BFC(v15, v16, v10, v12); if ( v13 <= 0 ) return 0; } if ( v17 ) return (unsigned int)-1; else return 0; } } return v9; } if ( fds->fd == -1 ) { v6 = fds; v7 = &fds[(unsigned int)(nfds - 1)]; while ( v6 != v7 ) { fd = v6[1].fd; ++v6; if ( fd != -1 ) goto LABEL_19; } goto LABEL_7; } LABEL_19: if ( a3 <= 0 ) { if ( a3 ) { while ( 1 ) { LODWORD(result) = poll(fds, v4, -1); if ( (_DWORD)result != -1 ) break; v32 = *(_DWORD *)__errno(); if ( v32 ) { if ( v32 != 4 ) return (unsigned int)-1; if ( dword_1247840 ) return (unsigned int)-1; } } } else { while ( 1 ) { LODWORD(result) = poll(fds, v4, 0); if ( (_DWORD)result != -1 ) break; v31 = *(_DWORD *)__errno(); if ( v31 && (v31 != 4 || dword_1247840) ) return (unsigned int)-1; } } } else { v19 = sub_B70B94(); v21 = v20; v22 = a3; while ( 1 ) { LODWORD(result) = poll(fds, v4, v22); if ( (_DWORD)result != -1 ) break; v23 = *(_DWORD *)__errno(); if ( v23 && (v23 != 4 || dword_1247840) ) return (unsigned int)-1; v24 = sub_B70B94(); v22 = a3 - sub_B70BFC(v24, v25, v19, v21); if ( v22 <= 0 ) return 0; } } v9 = -1; if ( (int)result < 0 ) return v9; if ( !(_DWORD)result ) return 0; p_revents = &fds->revents; v27 = &fds[v4].revents; do { if ( *(_DWORD *)(p_revents - 3) != -1 ) { v28 = *p_revents; v29 = *p_revents; if ( (*p_revents & 0x10) != 0 ) { v28 |= 1u; *p_revents = v28; LOBYTE(v29) = v28; } v30 = v28 | 5; if ( (v29 & 8) != 0 ) *p_revents = v30; } p_revents += 4; } while ( p_revents != v27 ); return (unsigned int)result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source