Function at 0x40c448
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.0040d12d
cmp byte [eax + 0x1c], 0
je 0x40c46c
xor eax, eax
jmp 0x40c690
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.00406316
test al, al
pop ecx
pop ecx
jne 0x40c4a7
mov ecx, dword [ebx + 4]
cmp ecx, esi
je 0x40c49f
mov edx, dword [ecx]
xor eax, eax
push eax
push dword [ebp - 0x28]
push dword [edi + 0x58]
call dword [edx]
test eax, eax
jne 0x40c4a7
push 0xa
pop eax
jmp 0x40c68f
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040d12d
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.0040d12d
add eax, 0x18
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.00401c90
mov ebx, dword [ebx]
cmp ebx, esi
je 0x40c524
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
mov esi, dword [ebx]
call fcn.0040d12d
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.0040d12d
push dword [eax]
mov esi, dword [ebx]
lea eax, [ebp - 0xc]
call fcn.0040db75
push eax
mov ecx, ebx
call dword [esi + 0x14]
xor esi, esi
cmp byte [ebp - 1], 0
je 0x40c53b
lea eax, [ebp - 0xc]
push eax
lea esi, [edi + 0x90]
call fcn.00405e35
xor esi, esi
lea eax, [edi + 0x9c]
push eax
lea eax, [ebp - 0xc]
push esi
push eax
call fcn.0040dd10
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 0x40c572
push eax
jmp 0x40c5a5
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.0040d12d
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 0x40c5b3
cmp dword [ebp - 0x28], esi
je 0x40c5ab
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
pop esi
jmp 0x40c682
push 0x10000
call fcn.0042382d
pop ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
call fcn.0040d12d
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], esi
cmp ebx, esi
je 0x40c5e8
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x24]
test al, al
jne 0x40c695
mov ecx, dword [ebp - 0x14]
mov eax, 0x10000
cmp ecx, eax
jbe 0x40c5f6
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 0x40c653
cmp dword [ebp - 0x10], esi
je 0x40c653
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 0x40c653
mov eax, dword [ebp - 0x10]
cmp eax, esi
je 0x40c653
sub dword [ebp - 0x14], eax
add dword [ebp - 0x1c], eax
cmp ebx, esi
je 0x40c64e
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 0x40c5d5
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
call fcn.0040d12d
push dword [ebp - 0x18]
mov byte [eax + 0x1c], 1
call fcn.00423832
cmp dword [ebp - 0x28], esi
pop ecx
je 0x40c682
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.00423832
cmp dword [ebp - 0x28], esi
pop ecx
je 0x40c6ac
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
jmp 0x40c5ad