Function at 0x405fb4
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 0x406332
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 0x406051
push 0
push 0x406344
push 0x406350
push dword [ebp - 4]
push 0x406368
lea edx, [ebp - 0x44]
xor eax, eax
call fcn.0040666c
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 0x406301
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 0x406075
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 0x40609a
call fcn.00402f1c
add esp, 8
test edx, edx
je 0x4060a6
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 0x4060cd
call fcn.00402f1c
test edx, edx
je 0x4060d6
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 0x4060fd
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 0x406122
call fcn.00402f1c
add esp, 8
test edx, edx
je 0x40612e
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 0x406155
call fcn.00402f1c
test edx, edx
je 0x40615e
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 0x406185
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 0x4061aa
call fcn.00402f1c
add esp, 8
test edx, edx
je 0x4061b6
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 0x4061dd
call fcn.00402f1c
test edx, edx
je 0x4061e6
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 0x40621a
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 0x4062f8
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0xc]
jae 0x4062f8
mov eax, dword [ebp - 8]
push eax
lea eax, [ebp - 0x30]
mov ecx, 1
mov edx, dword [0x405f94]
call fcn.00404268
add esp, 4
mov eax, dword [ebp - 8]
sub eax, 1
jae 0x406267
call fcn.00402f1c
test eax, eax
jns 0x406270
call fcn.00402f14
test eax, eax
jl 0x4062b4
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 0x406295
call fcn.00402f14
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
test ecx, ecx
je 0x4062a4
cmp edx, dword [ecx - 4]
jb 0x4062a9
call fcn.00402f14
mov byte [ecx + edx], al
inc dword [ebp - 0x34]
dec dword [ebp - 0x3c]
jne 0x40627f
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 0x4062db
cmp eax, dword [edx - 4]
jb 0x4062e0
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 0x4062f8
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 0x406339
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.00403750
lea eax, [ebp - 0x30]
mov edx, dword [0x405f94]
call fcn.00404274
lea eax, [ebp - 4]
call fcn.0040372c
ret