// // _write from 0x180140260 to 0x18014034b (235 bytes) // // 7 xrefs: // > __acrt_stdio_flush_nolock @ 0x1801389d2 // > write_buffer_nolock @ 0x18013f4f9 // > write_buffer_nolock @ 0x18013f571 // > write_buffer_nolock @ 0x18013f5df // > write_buffer_nolock @ 0x18013f659 // > @ 0x180203bfc // > @ 0x180203c08 // // 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 // int __cdecl write(int FileHandle, const void *Buf, unsigned int MaxCharCount) { __int64 v6; // rsi int v7; // edi if ( FileHandle == -2 ) { *_doserrno() = 0; *errno() = 9; return -1; } if ( FileHandle < 0 || FileHandle >= (unsigned int)dword_1801F5560 || (v6 = (__int64)FileHandle >> 6, (*(_BYTE *)(qword_1801F5160[v6] + 72LL * (FileHandle & 0x3F) + 56) & 1) == 0) ) { *_doserrno() = 0; *errno() = 9; invalid_parameter_noinfo(); return -1; } sub_180136164(FileHandle); v7 = -1; if ( (*(_BYTE *)(qword_1801F5160[v6] + 72LL * (FileHandle & 0x3F) + 56) & 1) != 0 ) { v7 = write_nolock((unsigned int)FileHandle, Buf, MaxCharCount); } else { *errno() = 9; *_doserrno() = 0; } sub_18013618C(FileHandle); return v7; }