// // sub_1006185B0 from 0x1006185b0 to 0x100618878 (712 bytes) // // 2 xrefs: // > sub_1006183B0 @ 0x10061842c // > sub_1006183B0 @ 0x100618518 // // 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_1006185B0(__int64 a1, __int64 a2, int a3, int a4) { sigaction *v8; // x23 __int64 v9; // x26 int v11; // w0 char *v12; // x0 _BOOL4 v13; // w8 FILE *v14; // x23 char *v15; // x0 __int64 v16; // x20 __int64 v17; // x1 int v18; // w8 int v19; // w0 int v20; // w0 const sigaction *v21; // x19 __int64 v22; // x21 sigaction v24; // [xsp+8h] [xbp-468h] BYREF char __s[1024]; // [xsp+18h] [xbp-458h] BYREF dword_100884ED8 = 0; dword_100884ED4 = 0; *(_QWORD *)&v24.sa_mask = 0; v24.__sigaction_u.__sa_handler = (void (__cdecl *)(int))sub_100618878; v8 = (sigaction *)&unk_100884F90; v9 = -31; do { if ( (unsigned int)(v9 + 32) > 0x1F || ((1 << (v9 + 32)) & 0xC0000200) == 0 ) sigaction(v9 + 32, &v24, v8); ++v8; ++v9; } while ( v9 ); signal(28, nullptr); dword_100884ED4 = 1; if ( !a3 && (memcpy(&unk_100884F38, &stru_100884EF0, 0x48u), qword_100884F50 &= ~8uLL, byte_100884ED0 == 1) && (v11 = fileno((FILE *)qword_100884EE0), tcsetattr(v11, 0, (const termios *)&unk_100884F38) == -1) ) { if ( dword_100884ED8 == 2 ) v16 = 0xFFFFFFFFLL; else v16 = 0; } else { dword_100884ED4 = 2; __s[0] = 0; v12 = fgets(__s, 1023, (FILE *)qword_100884EE0); v13 = 0; if ( v12 ) { if ( feof((FILE *)qword_100884EE0) ) { v13 = 0; } else { v14 = (FILE *)qword_100884EE0; if ( ferror((FILE *)qword_100884EE0) ) { v13 = 0; } else { v15 = strchr(__s, 10); if ( v15 ) { if ( a4 ) *v15 = 0; LABEL_22: v13 = (int)sub_100617FF4(a1, a2, __s) >= 0; } else { while ( fgets((char *)&v24, 4, v14) ) { if ( strchr((char *)&v24, 10) ) goto LABEL_22; } v13 = 0; } } } } if ( dword_100884ED8 == 2 ) v16 = 0xFFFFFFFFLL; else v16 = v13; v17 = v16; if ( a3 ) goto LABEL_36; } fputc(10, (FILE *)qword_100884EE8); v18 = dword_100884ED4; if ( dword_100884ED4 > 1 ) { memcpy(&unk_100884F38, &stru_100884EF0, 0x48u); qword_100884F50 |= 8uLL; if ( byte_100884ED0 != 1 || (v19 = fileno((FILE *)qword_100884EE0), v20 = tcsetattr(v19, 0, (const termios *)&unk_100884F38), v17 = 0, v20 != -1) ) { v17 = v16; } LABEL_36: v18 = dword_100884ED4; v16 = v17; } if ( v18 >= 1 ) { v21 = (const sigaction *)&unk_100884F90; v22 = -31; do { if ( (((_DWORD)v22 + 32) & 0xFFFFFFFE) != 0x1E ) sigaction(v22 + 32, v21, nullptr); ++v22; ++v21; } while ( v22 ); } sub_10058A3A8(__s, 0x400u); return v16; }
GD Web Decomp Icon

GD Web Decomp

Raw Source