Function at 0x405a40
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x65c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
je 0x405a68
mov ecx, dword [edi]
call fcn.00404fe0
mov eax, dword [edi]
mov ecx, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp ecx, dword [eax + 4]
jl 0x405a91
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042a8a3
mov esp, ebp
pop ebp
ret 0x10
cmp ecx, dword [eax + 0x10]
jge 0x405aa0
mov ecx, eax
call fcn.00404960
mov ecx, dword [ebp + 8]
mov eax, dword [edi]
cmp dword [eax + 0x10], ecx
jge 0x405afa
mov esi, dword [edi]
test esi, esi
je 0x405af3
cmp dword [esi + 0x18], 0
je 0x405af3
mov edx, dword [esi + 0x10]
inc edx
cmp edx, dword [esi + 4]
je 0x405af3
mov ecx, dword [esi + 0x50]
sub esp, 0x10
mov eax, dword [esi + 0x48]
add ecx, dword [esi + 0x4c]
add eax, 0x2e
add eax, ecx
mov dword [esi + 0x10], edx
add dword [esi + 0x14], eax
lea edx, [esi + 0x28]
push 0
lea eax, [esi + 0x78]
mov ecx, esi
push 0
push eax
call fcn.00404520
mov ecx, dword [ebp + 8]
add esp, 0x1c
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov eax, dword [edi]
cmp dword [eax + 0x10], ecx
jl 0x405aa7
lea eax, [ebp - 0x650]
push eax
push ecx
mov ecx, edi
call fcn.00405180
mov eax, dword [ebp - 0x444]
shr eax, 4
test al, 1
je 0x405b6f
movzx eax, word [ebx]
cmp eax, 0x2f
je 0x405b51
cmp eax, 0x5c
je 0x405b51
test ax, ax
je 0x405b2f
cmp word [ebx + 2], 0x3a
je 0x405b51
lea ecx, [edi + 0x244]
mov edx, ebx
call fcn.00405890
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042a8a3
mov esp, ebp
pop ebp
ret 0x10
xor ecx, ecx
mov edx, ebx
call fcn.00405890
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042a8a3
mov esp, ebp
pop ebp
ret 0x10
xor eax, eax
mov dword [ebp - 0x658], ebx
mov word [ebp - 0x418], ax
mov esi, ebx
movzx eax, word [ebx]
mov ecx, ebx
test ax, ax
je 0x405bb1
lea ebx, [ebx]
cmp ax, 0x2f
je 0x405b9c
cmp ax, 0x5c
jne 0x405b9f
lea esi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x405b90
mov dword [ebp - 0x658], esi
push 0x104
lea eax, [ebp - 0x210]
push ebx
push eax
call dword [sym.imp.MSVCR120.dll_wcsncpy]
add esp, 0xc
cmp esi, ebx
jne 0x405bd6
xor eax, eax
mov word [ebp - 0x210], ax
jmp 0x405c14
mov eax, esi
sub eax, ebx
and eax, 0xfffffffe
cmp eax, 0x208
jae 0x405d95
xor ecx, ecx
mov word [ebp + eax - 0x210], cx
mov ax, word [ebp - 0x210]
cmp ax, 0x2f
je 0x405c40
cmp ax, 0x5c
je 0x405c40
test ax, ax
je 0x405c14
cmp word [ebp - 0x20e], 0x3a
je 0x405c40
push dword [ebp - 0x658]
lea eax, [ebp - 0x210]
push eax
lea esi, [edi + 0x244]
push esi
lea eax, [ebp - 0x418]
push str._s_s_s
push eax
call fcn.004018f0
add esp, 0x14
mov ecx, esi
jmp 0x405c5e
push esi
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x418]
push str._s_s
push eax
call fcn.004018f0
add esp, 0x10
xor ecx, ecx
lea edx, [ebp - 0x210]
call fcn.00405890
push 0
push dword [ebp - 0x444]
lea eax, [ebp - 0x418]
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x658], eax
cmp eax, 0xffffffff
jne 0x405cac
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042a8a3
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [edi + 0x23c]
mov ecx, dword [edi]
call fcn.00404c20
cmp dword [edi + 0x240], 0
jne 0x405cd6
push 0x4000
call dword [sym.imp.MSVCR120.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [edi + 0x240], eax
xor ebx, ebx
jmp 0x405ce0
mov edx, dword [edi + 0x240]
lea eax, [ebp - 0x651]
mov ecx, dword [edi]
push eax
push 0x4000
call fcn.00404da0
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x405d43
test esi, esi
js 0x405d35
jle 0x405d29
push 0
lea eax, [ebp - 0x41c]
push eax
push esi
push dword [edi + 0x240]
push dword [ebp - 0x658]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405d3c
cmp byte [ebp - 0x651], bl
jne 0x405d48
test esi, esi
jne 0x405ce0
mov ebx, 0x5000000
jmp 0x405d48
mov ebx, 0x400
jmp 0x405d48
mov ebx, 0x1000
mov ecx, dword [edi]
call fcn.00404fe0
test ebx, ebx
jne 0x405d74
lea eax, [ebp - 0x430]
push eax
lea eax, [ebp - 0x440]
push eax
lea eax, [ebp - 0x438]
push eax
push dword [ebp - 0x658]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push dword [ebp - 0x658]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0042a8a3
mov esp, ebp
pop ebp
ret 0x10
call fcn.0042a9f0
int3