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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
mov ebx, eax
mov eax, dword [ebp + 8]
lea ecx, [edi + 0x60]
mov dword [ebp - 8], ecx
call fcn.0040c2da
cmp byte [eax + 0x1c], 0
je 0x40b619
xor eax, eax
jmp 0x40b83d
mov eax, dword [eax + 0xc]
mov ecx, dword [edi + 0x58]
push esi
xor edx, edx
push edx
push eax
mov dword [ebp - 0x28], eax
xor esi, esi
call fcn.00405d8e
test al, al
pop ecx
pop ecx
jne 0x40b654
mov ecx, dword [ebx + 4]
cmp ecx, esi
je 0x40b64c
mov edx, dword [ecx]
xor eax, eax
push eax
push dword [ebp - 0x28]
push dword [edi + 0x58]
call dword [edx]
test eax, eax
jne 0x40b654
push 0xa
pop eax
jmp 0x40b83c
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040c2da
cmp dword [eax + 4], 0xc
mov eax, dword [edi + 0x58]
sete byte [ebp - 1]
sub eax, 0x10
call fcn.00401773
mov ecx, dword [ebp - 8]
add eax, 0x10
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
call fcn.0040c2da
add eax, 0x18
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.00401cb8
mov ebx, dword [ebx]
cmp ebx, esi
je 0x40b6d1
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
mov esi, dword [ebx]
call fcn.0040c2da
push 0
push dword [eax + 0xc]
mov ecx, ebx
call dword [esi + 0x1c]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040c2da
push dword [eax]
mov esi, dword [ebx]
lea eax, [ebp - 0xc]
call fcn.0040cd46
push eax
mov ecx, ebx
call dword [esi + 0x14]
xor esi, esi
cmp byte [ebp - 1], 0
je 0x40b6e8
lea eax, [ebp - 0xc]
push eax
lea esi, [edi + 0x90]
call fcn.004058ad
xor esi, esi
lea eax, [edi + 0x9c]
push eax
lea eax, [ebp - 0xc]
push esi
push eax
call fcn.0040cee1
add esp, 0xc
push esi
push 0x80
push 2
push esi
push esi
push 0x40000000
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x28], eax
jne 0x40b71f
push eax
jmp 0x40b752
mov eax, dword [edi + 0x6c]
mov ecx, dword [ebp - 8]
push esi
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
push esi
call fcn.0040c2da
mov eax, dword [eax + 0x10]
add eax, dword [edi + 0x80]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40b760
cmp dword [ebp - 0x28], esi
je 0x40b758
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
pop esi
jmp 0x40b82f
push 0x10000
call fcn.004222b8
pop ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
call fcn.0040c2da
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], esi
cmp ebx, esi
je 0x40b795
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x24]
test al, al
jne 0x40b842
mov ecx, dword [ebp - 0x14]
mov eax, 0x10000
cmp ecx, eax
jbe 0x40b7a3
mov ecx, eax
mov eax, dword [edi + 0x6c]
push esi
lea edx, [ebp - 0x10]
push edx
push ecx
push dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40b800
cmp dword [ebp - 0x10], esi
je 0x40b800
push esi
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x18]
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40b800
mov eax, dword [ebp - 0x10]
cmp eax, esi
je 0x40b800
sub dword [ebp - 0x14], eax
add dword [ebp - 0x1c], eax
cmp ebx, esi
je 0x40b7fb
mov eax, dword [ebx]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
cdq
push edx
push eax
mov eax, dword [ebp - 0x20]
mov ecx, ebx
call dword [eax + 0x20]
cmp dword [ebp - 0x14], esi
jg 0x40b782
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040c2da
push dword [ebp - 0x18]
mov byte [eax + 0x1c], 1
call fcn.004222bd
cmp dword [ebp - 0x28], esi
pop ecx
je 0x40b82f
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff0
call fcn.0040175b
mov eax, esi
pop esi
pop ebx
leave
ret 4
push dword [ebp - 0x18]
call fcn.004222bd
cmp dword [ebp - 0x28], esi
pop ecx
je 0x40b859
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
jmp 0x40b75a