Function at 0x405dac
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x24], ebx
mov esi, ecx
mov edi, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00403b0c
xor eax, eax
push ebp
push 0x406017
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0x80
push 3
push 0
push 0
push 0x40000000
mov eax, dword [ebp - 4]
call fcn.00403b1c
push eax
call sub.kernel32.dll_CreateFileA_1
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x405e47
inc ebx
push 0
push 0x406028
push 0x406034
push dword [ebp - 4]
push 0x40604c
lea edx, [ebp - 0x34]
xor eax, eax
call fcn.00406314
push dword [ebp - 0x34]
lea eax, [ebp - 0x30]
mov edx, 4
call fcn.004039dc
mov eax, dword [ebp - 0x30]
call fcn.00403b1c
push eax
push 0
call sub.user32.dll_MessageBoxA_1
jmp 0x405fe6
mov eax, 0x7ffffffe
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
add eax, 0x200800
push eax
mov eax, 0x38b14001
call fcn.00402bf8
mov dword [ebp - 0x3c], eax
fild dword [ebp - 0x3c]
call fcn.004027b4
pop edx
add edx, eax
mov dword [ebp - 0x10], edx
mov eax, 0x47a7c
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
add eax, 0x1bf53d2
mov dword [ebp - 0xc], eax
mov eax, 0x7ffffffe
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
add eax, 0x200800
push eax
mov eax, 0x38b14001
call fcn.00402bf8
mov dword [ebp - 0x3c], eax
fild dword [ebp - 0x3c]
call fcn.004027b4
pop edx
add edx, eax
mov dword [ebp - 0x18], edx
mov eax, 0x47a7c
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
add eax, 0x1bf53d2
mov dword [ebp - 0x14], eax
mov eax, 0x7ffffffe
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
add eax, 0x200800
push eax
mov eax, 0x38b14001
call fcn.00402bf8
mov dword [ebp - 0x3c], eax
fild dword [ebp - 0x3c]
call fcn.004027b4
pop edx
add edx, eax
mov dword [ebp - 0x20], edx
mov eax, 0x47a7c
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
add eax, 0x1bf53d2
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x10]
push eax
push ebx
call sub.kernel32.dll_SetFileTime
mov eax, edi
call fcn.00402bf8
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
call fcn.004027b4
mov edi, eax
lea eax, [ebp - 0x2c]
push eax
push ebx
call sub.kernel32.dll_GetFileSize_1
test edi, edi
jbe 0x405fe0
cmp esi, dword [ebp - 0x2c]
jbe 0x405fe0
push edi
lea eax, [ebp - 0x24]
mov ecx, 1
mov edx, dword [0x405d8c]
call fcn.004042a8
add esp, 4
mov esi, edi
dec esi
test esi, esi
jl 0x405fb8
inc esi
mov dword [ebp - 0x28], 0
mov eax, pe_nt_image_headers32
call fcn.00402bf8
mov edx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x28]
mov byte [edx + ecx], al
inc dword [ebp - 0x28]
dec esi
jne 0x405f9f
push 2
push 0
push 0
push ebx
call sub.kernel32.dll_SetFilePointer_1
push 0
lea eax, [ebp - 8]
push eax
push edi
mov eax, dword [ebp - 0x24]
push eax
push ebx
call sub.kernel32.dll_WriteFile_1
test eax, eax
jne 0x405fe0
mov dword [ebp - 8], 0xffffffff
push ebx
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40601e
lea eax, [ebp - 0x34]
mov edx, 2
call fcn.004037c8
lea eax, [ebp - 0x24]
mov edx, dword [0x405d8c]
call fcn.004042b4
lea eax, [ebp - 4]
call fcn.004037a4
ret