Function at 0x680d40
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x10
mov eax, dword [esp + 0x18]
push esi
mov esi, dword [esp + 0x34]
mov ecx, eax
and eax, 0xfffffdff
push edi
xor edi, edi
and ecx, 0x200
cmp eax, 0x18
mov dword [esp + 0x10], 1
mov dword [esp + 8], esi
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], ecx
mov dword [esp + 0x20], eax
jne 0x680e31
cmp dword [0x978ee0], edi
jne 0x680e31
mov eax, dword [esp + 0x1c]
cmp eax, 0xa
jne 0x680db5
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
push esi
push eax
mov eax, dword [esp + 0x30]
push ecx
push edx
push eax
call fcn.0067e270
add esp, 0x14
pop edi
pop esi
add esp, 0x10
ret
xor ecx, ecx
cmp eax, 0xb
mov eax, dword [0x977b10]
sete cl
add ecx, eax
jne 0x680def
push 0xd5e
push str..osos0file.c
push str.type__OS_FILE_WRITE
call fcn.00651650
mov edx, dword [0x977b18]
mov eax, dword [edx]
add esp, 0xc
cmp eax, edi
je 0x680def
mov dword [0x977b18], edi
cmp dword [0x977b14], edi
je 0x680e09
push 0xd5e
push str..osos0file.c
call fcn.006516c0
add esp, 8
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
push esi
push eax
mov eax, dword [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x30]
push edx
push eax
push ecx
call fcn.0067e710
add esp, 0x18
pop edi
pop esi
add esp, 0x10
ret
push ebx
mov ebx, dword [esp + 0x20]
push ebp
mov ebp, dword [esp + 0x34]
jmp 0x680e40
cmp eax, 0x15
jne 0x680e5a
cmp ebx, 0xa
jne 0x680e52
mov edi, dword [0x978eec]
jmp 0x680eaa
mov edi, dword [0x978ef0]
jmp 0x680eaa
cmp eax, 0x16
jne 0x680e6b
mov dword [esp + 0x14], edi
mov edi, dword [0x978ef4]
jmp 0x680eaa
cmp eax, 0x17
jne 0x680e78
mov edi, dword [0x978ef8]
jmp 0x680eaa
cmp eax, 0x18
jne 0x680e85
mov edi, dword [0x978efc]
jmp 0x680eaa
push 0xd79
push str..osos0file.c
push edi
call fcn.00651650
mov edx, dword [0x977b18]
mov eax, dword [edx]
add esp, 0xc
cmp eax, edi
je 0x680eaa
mov dword [0x977b18], edi
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
push eax
mov eax, dword [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x54]
push ebp
push eax
mov eax, dword [esp + 0x58]
push ecx
push edx
push eax
push ebx
call fcn.00680ba0
add esp, 0x24
cmp ebx, 0xa
mov esi, eax
jne 0x680f45
mov eax, dword [0x978ee0]
test eax, eax
je 0x680f27
mov ecx, dword [esp + 0x10]
mov edx, dword [0x978f08]
mov eax, dword [0x978f04]
add edx, ecx
mov ecx, dword [esp + 0x40]
inc eax
mov dword [0x978f08], edx
lea edx, [esi + 0x3c]
push edx
mov edx, dword [esp + 0x34]
mov dword [0x978f04], eax
lea eax, [esp + 0x14]
push eax
push ecx
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [esp + 0x18], eax
jmp 0x680faa
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x680fe0
mov eax, edi
call fcn.0067efe0
push eax
call fcn.0067f1b0
add esp, 4
jmp 0x680faa
cmp ebx, 0xb
jne 0x680f80
mov eax, dword [0x978ee0]
test eax, eax
je 0x680f27
mov edx, dword [0x978f0c]
inc edx
lea eax, [esi + 0x3c]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x14]
push ecx
mov dword [0x978f0c], edx
mov edx, dword [esp + 0x48]
push edx
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x18], eax
jmp 0x680faa
push 0xda3
push str..osos0file.c
push 0
call fcn.00651650
mov ecx, dword [0x977b18]
mov eax, dword [ecx]
add esp, 0xc
test eax, eax
je 0x680faa
mov dword [0x977b18], 0
mov eax, dword [0x978ee0]
test eax, eax
je 0x680fe0
mov eax, dword [esp + 0x18]
test eax, eax
je 0x680fc5
mov edx, dword [esp + 0x40]
cmp dword [esp + 0x10], edx
jmp 0x680fd0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x68106d
mov dword [esp + 0x1c], 1
jmp 0x680fec
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x681099
mov eax, dword [edi]
push eax
call fcn.00687ff0
mov dword [esi + 8], 0
mov eax, dword [edi + 0x14]
mov ecx, dword [edi + 0xc]
add esp, 4
dec eax
dec ecx
cmp eax, ecx
mov dword [edi + 0x14], eax
jne 0x681019
mov edx, dword [edi + 4]
push edx
call fcn.00687a10
add esp, 4
mov eax, dword [edi + 0x14]
test eax, eax
jne 0x68102c
mov eax, dword [edi + 8]
push eax
call fcn.00687a10
add esp, 4
mov ecx, dword [esi + 0x38]
push ecx
call fcn.00687ac0
mov edx, dword [edi]
push edx
call fcn.00688110
add esp, 8
cmp ebx, 0xa
mov eax, str.aio_read
je 0x68104f
mov eax, str.aio_write
mov esi, dword [esp + 0x2c]
push 1
push eax
call fcn.0067d580
add esp, 8
test eax, eax
je 0x6810a6
mov eax, dword [esp + 0x28]
xor edi, edi
jmp 0x680e40
cmp dword [esp + 0x28], 0x18
jne 0x681099
lea eax, [esp + 0x40]
push eax
mov eax, dword [esi + 4]
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x24]
push edx
push eax
push 0xffffffffffffffff
call fcn.0067f350
add esp, 0x14
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x10
ret
pop ebp
pop ebx
pop edi
mov eax, 1
pop esi
add esp, 0x10
ret
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x10
ret