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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x443004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
push edi
test esi, esi
jne 0x4035a0
push 0x3f2
push str.....IORequestGeneratorIORequestGenerator.cpp
push str.NULL___p
call fcn.0042231d
add esp, 0xc
mov eax, dword [esi + 4]
xor ebx, ebx
mov ecx, dword [esi + 0xc]
sub ecx, dword [esi + 8]
mov byte [ebp - 0xd], 1
mov al, byte [eax + 0x31]
mov byte [ebp - 0xe], al
mov eax, 0x2e8ba2e9
imul ecx
mov dword [ebp - 0x14], ebx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x403775
xor ecx, ecx
mov dword [ebp - 0x1c], ecx
mov eax, dword [esi + 8]
xor edi, edi
add eax, ecx
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x18], eax
cmp dword [eax + 0x1c], edi
jbe 0x4036ff
lea eax, [ebx + ebx*4]
shl eax, 2
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x18]
cmp byte [ebp - 0xe], 0
je 0x403619
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ecx, dword [esi + 0x68]
mov eax, dword [ebp - 0xc]
mov dword [ecx + ebx*8], eax
mov eax, dword [ebp - 8]
mov dword [ecx + ebx*8 + 4], eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x68]
mov dword [ebp - 0x28], eax
call fcn.00420963
cdq
mov ecx, 0x64
idiv ecx
lea eax, [edx + 1]
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 0x28]
cmp edx, eax
mov dword [ebp - 0x2c], eax
mov eax, dword [esi + 0x5c]
sbb ecx, ecx
add ecx, 2
mov dword [eax + ebx*4], ecx
cmp dword [ebp - 0x2c], edx
jbe 0x40368f
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x1c]
lea ecx, [eax*4]
mov eax, dword [esi + 8]
mov edi, dword [esi + 0x38]
add edi, dword [ebp - 0x24]
push 0x4032a0
mov edx, dword [eax + edx + 0x18]
imul edx, dword [ebp - 0x20]
mov eax, dword [esi + 0x2c]
push edi
add edx, dword [eax + ecx]
mov eax, dword [esi + 0x14]
add eax, ecx
mov ecx, dword [ebp - 0x18]
push dword [ecx + 0x18]
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFileEx]
mov edi, dword [ebp - 0x20]
jmp 0x4036e3
mov ecx, dword [ebp - 0x18]
mov eax, dword [esi + 0x38]
add eax, dword [ebp - 0x24]
mov dword [ebp - 0x20], eax
mov eax, dword [ecx + 0x18]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [esi + 8]
mov dword [ebp - 0x30], eax
cmp dword [ecx + 0x88], 0
jne 0x4036c1
mov ecx, dword [ecx + 0x18]
mov eax, dword [esi + 0x2c]
mov edx, dword [ebp - 0x14]
imul ecx, edi
add ecx, dword [eax + edx*4]
jmp 0x4036c8
call fcn.00414860
mov ecx, eax
mov eax, dword [esi + 0x14]
push 0x4032a0
push dword [ebp - 0x20]
push dword [ebp - 0x30]
push ecx
mov ecx, dword [ebp - 0x14]
push dword [eax + ecx*4]
call dword [sym.imp.KERNEL32.dll_WriteFileEx]
test eax, eax
je 0x403732
mov eax, dword [ebp - 0x18]
inc edi
add dword [ebp - 0x24], 0x14
inc ebx
mov dword [ebp - 0x20], edi
cmp edi, dword [eax + 0x1c]
jb 0x4035f6
mov ecx, dword [ebp - 0x1c]
mov edi, dword [ebp - 0x14]
add ecx, 0xb0
mov dword [ebp - 0x1c], ecx
mov eax, 0x2e8ba2e9
mov ecx, dword [esi + 0xc]
inc edi
sub ecx, dword [esi + 8]
imul ecx
mov dword [ebp - 0x14], edi
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp edi, eax
jae 0x403775
mov ecx, dword [ebp - 0x1c]
jmp 0x4035d4
mov eax, dword [ebp - 0x28]
mov edi, str.read
cmp dword [ebp - 0x2c], eax
ja 0x403744
mov edi, str.write
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push dword [ebp - 0x14]
push dword [esi + 0x88]
push str.t__u:_u__error_during__s_error_code:__u__n
call fcn.00402820
add esp, 0x14
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041a002
mov esp, ebp
pop ebp
ret
cmp dword [0x4444fc], 0
je 0x4037db
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
cmp dword [0x4444f8], 0
jne 0x4037db
push 1
push 0xffffffffffffffff
push dword [esi + 0xb4]
call ebx
mov edi, eax
cmp edi, 0xc0
je 0x4037d2
test edi, edi
jne 0x4037b7
cmp dword [0x4444fc], eax
je 0x4037db
cmp dword [0x4444f8], eax
jne 0x4037d2
push 0x41f
push str.....IORequestGeneratorIORequestGenerator.cpp
push str.WAIT_IO_COMPLETION__dwWaitResult___WAIT_OBJECT_0__dwWaitResult____g_bRun__g_bThreadError__
call fcn.0042231d
add esp, 0xc
test edi, edi
jne 0x4037ef
cmp dword [0x4444fc], 0
jne 0x403784
mov al, byte [ebp - 0xd]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041a002
mov esp, ebp
pop ebp
ret
push dword [esi + 0x88]
push str.Error_in_thread__u_during_WaitForSingleObjectEx__in_completion_routines__n
call fcn.00402820
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
xor al, al
pop edi
pop esi
pop ebx
call fcn.0041a002
mov esp, ebp
pop ebp
ret