Function at 0x40c73d
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.0040d387
cmp byte [eax + 0x1c], 0
je 0x40c761
xor eax, eax
jmp 0x40c970
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.00406ec0
test al, al
pop ecx
pop ecx
jne 0x40c79c
mov ecx, dword [ebx + 4]
cmp ecx, esi
je 0x40c794
mov edx, dword [ecx]
xor eax, eax
push eax
push dword [ebp - 0x28]
push dword [edi + 0x58]
call dword [edx]
test eax, eax
jne 0x40c79c
push 0xa
pop eax
jmp 0x40c96f
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040d387
cmp dword [eax + 4], 0xc
mov eax, dword [edi + 0x58]
sete byte [ebp - 1]
sub eax, 0x10
call fcn.00402f91
mov ecx, dword [ebp - 8]
add eax, 0x10
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
call fcn.0040d387
add eax, 0x18
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.00402f2b
mov ebx, dword [ebx]
cmp ebx, esi
je 0x40c806
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
mov esi, dword [ebx]
call fcn.0040d387
push 0
push dword [eax + 0xc]
mov ecx, ebx
call dword [esi + 0x1c]
push dword [ebp - 0xc]
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x14]
xor esi, esi
cmp byte [ebp - 1], 0
je 0x40c81d
lea eax, [ebp - 0xc]
push eax
lea esi, [edi + 0x90]
call fcn.004069f1
xor esi, esi
lea eax, [edi + 0x9c]
push eax
push esi
lea eax, [ebp - 0xc]
call fcn.004049fc
pop ecx
pop ecx
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 0x40c852
push eax
jmp 0x40c885
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.0040d387
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 0x40c893
cmp dword [ebp - 0x28], esi
je 0x40c88b
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
pop esi
jmp 0x40c962
push 0x10000
call fcn.0041e6ca
pop ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
call fcn.0040d387
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], esi
cmp ebx, esi
je 0x40c8c8
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x24]
test al, al
jne 0x40c975
mov ecx, dword [ebp - 0x14]
mov eax, 0x10000
cmp ecx, eax
jbe 0x40c8d6
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 0x40c933
cmp dword [ebp - 0x10], esi
je 0x40c933
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 0x40c933
mov eax, dword [ebp - 0x10]
cmp eax, esi
je 0x40c933
sub dword [ebp - 0x14], eax
add dword [ebp - 0x1c], eax
cmp ebx, esi
je 0x40c92e
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 0x40c8b5
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040d387
push dword [ebp - 0x18]
mov byte [eax + 0x1c], 1
call fcn.0041e6cf
cmp dword [ebp - 0x28], esi
pop ecx
je 0x40c962
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff0
call fcn.00402f79
mov eax, esi
pop esi
pop ebx
leave
ret 4
push dword [ebp - 0x18]
call fcn.0041e6cf
cmp dword [ebp - 0x28], esi
pop ecx
je 0x40c98c
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
jmp 0x40c88d