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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffb4
push ebx
xor ebx, ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00403a94
xor eax, eax
push ebp
push 0x4062fa
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.00403aa4
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x406019
push 0
push 0x40630c
push 0x406318
push dword [ebp - 4]
push 0x406330
lea edx, [ebp - 0x44]
xor eax, eax
call fcn.00406634
push dword [ebp - 0x44]
lea eax, [ebp - 0x40]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0x40]
call fcn.00403aa4
push eax
push 0
call sub.user32.dll_MessageBoxA_1
jmp 0x4062c9
mov eax, 0x7ffffffe
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
add eax, 0x200800
adc edx, 0
jno 0x40603d
call fcn.00402f1c
push edx
push eax
mov eax, 0x38b14001
call fcn.00402bf8
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x4c]
call fcn.004027b4
add eax, dword [esp]
adc edx, dword [esp + 4]
jno 0x406062
call fcn.00402f1c
add esp, 8
test edx, edx
je 0x40606e
call fcn.00402f14
mov dword [ebp - 0x1c], eax
mov eax, 0x47a7c
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
add eax, 0x1bf53d2
adc edx, 0
jno 0x406095
call fcn.00402f1c
test edx, edx
je 0x40609e
call fcn.00402f14
mov dword [ebp - 0x18], eax
mov eax, 0x7ffffffe
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
add eax, 0x200800
adc edx, 0
jno 0x4060c5
call fcn.00402f1c
push edx
push eax
mov eax, 0x38b14001
call fcn.00402bf8
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x4c]
call fcn.004027b4
add eax, dword [esp]
adc edx, dword [esp + 4]
jno 0x4060ea
call fcn.00402f1c
add esp, 8
test edx, edx
je 0x4060f6
call fcn.00402f14
mov dword [ebp - 0x24], eax
mov eax, 0x47a7c
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
add eax, 0x1bf53d2
adc edx, 0
jno 0x40611d
call fcn.00402f1c
test edx, edx
je 0x406126
call fcn.00402f14
mov dword [ebp - 0x20], eax
mov eax, 0x7ffffffe
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
add eax, 0x200800
adc edx, 0
jno 0x40614d
call fcn.00402f1c
push edx
push eax
mov eax, 0x38b14001
call fcn.00402bf8
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x4c]
call fcn.004027b4
add eax, dword [esp]
adc edx, dword [esp + 4]
jno 0x406172
call fcn.00402f1c
add esp, 8
test edx, edx
je 0x40617e
call fcn.00402f14
mov dword [ebp - 0x2c], eax
mov eax, 0x47a7c
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
add eax, 0x1bf53d2
adc edx, 0
jno 0x4061a5
call fcn.00402f1c
test edx, edx
je 0x4061ae
call fcn.00402f14
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.KERNEL32.DLL_SetFileTime
mov eax, dword [ebp - 8]
call fcn.00402bf8
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.004027b4
test edx, edx
je 0x4061e2
call fcn.00402f14
mov dword [ebp - 8], eax
lea eax, [ebp - 0x38]
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.KERNEL32.DLL_GetFileSize
cmp dword [ebp - 8], 0
jbe 0x4062c0
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0xc]
jae 0x4062c0
mov eax, dword [ebp - 8]
push eax
lea eax, [ebp - 0x30]
mov ecx, 1
mov edx, dword [0x405f5c]
call fcn.00404230
add esp, 4
mov eax, dword [ebp - 8]
sub eax, 1
jae 0x40622f
call fcn.00402f1c
test eax, eax
jns 0x406238
call fcn.00402f14
test eax, eax
jl 0x40627c
inc eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x34], 0
mov eax, pe_nt_image_headers32
call fcn.00402bf8
cmp eax, 0xff
jbe 0x40625d
call fcn.00402f14
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
test ecx, ecx
je 0x40626c
cmp edx, dword [ecx - 4]
jb 0x406271
call fcn.00402f14
mov byte [ecx + edx], al
inc dword [ebp - 0x34]
dec dword [ebp - 0x3c]
jne 0x406247
push 2
push 0
push 0
mov eax, dword [ebp - 0x14]
push eax
call sub.KERNEL32.DLL_SetFilePointer
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 8]
push eax
xor eax, eax
mov edx, dword [ebp - 0x30]
test edx, edx
je 0x4062a3
cmp eax, dword [edx - 4]
jb 0x4062a8
call fcn.00402f14
lea eax, [edx + eax]
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.KERNEL32.DLL_WriteFile
test eax, eax
jne 0x4062c0
mov dword [ebp - 0x10], 0xffffffff
mov eax, dword [ebp - 0x14]
push eax
call sub.KERNEL32.DLL_CloseHandle
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406301
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.00403750
lea eax, [ebp - 0x30]
mov edx, dword [0x405f5c]
call fcn.0040423c
lea eax, [ebp - 4]
call fcn.0040372c
ret