Function at 0x405a46
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x65c
mov eax, dword [0x41f024]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
mov dword [ebp - 0x650], edi
mov dword [ebp - 0x654], eax
je 0x405a7a
mov ebx, dword [edi]
call fcn.00405241
mov esi, dword [edi]
mov ebx, dword [ebp + 8]
or dword [edi + 4], 0xffffffff
cmp ebx, dword [esi + 4]
jl 0x405a92
mov eax, 0x10000
jmp 0x405d01
cmp ebx, dword [esi + 0x10]
jge 0x405aa5
call fcn.00404c70
jmp 0x405aa5
mov esi, dword [edi]
call fcn.00404ca6
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jl 0x405a9e
push ebx
mov ebx, dword [ebp - 0x650]
lea edi, [ebp - 0x648]
mov ecx, ebx
call fcn.004053b4
test byte [ebp - 0x43c], 0x10
je 0x405b03
mov ecx, dword [ebp - 0x654]
movzx eax, word [ecx]
cmp eax, 0x2f
je 0x405ae8
cmp eax, 0x5c
je 0x405ae8
test ax, ax
je 0x405aed
cmp word [ecx + 2], 0x3a
jne 0x405aed
push ecx
push 0
jmp 0x405af5
push ecx
add ebx, 0x244
push ebx
call fcn.0040595a
pop ecx
pop ecx
xor eax, eax
jmp 0x405d01
mov esi, dword [ebp - 0x654]
movzx eax, word [esi]
mov edi, esi
mov ecx, esi
jmp 0x405b27
cmp ax, 0x2f
je 0x405b1e
cmp ax, 0x5c
jne 0x405b21
lea edi, [ecx + 2]
add ecx, 2
movzx eax, word [ecx]
test ax, ax
jne 0x405b12
lea eax, [ebp - 0x210]
push esi
push eax
call fcn.00409662
pop ecx
pop ecx
cmp edi, esi
jne 0x405baf
xor eax, eax
mov word [ebp - 0x210], ax
push edi
lea eax, [ebp - 0x210]
push eax
lea esi, [ebx + 0x244]
push esi
lea eax, [ebp - 0x418]
push str._s_s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
lea eax, [ebp - 0x210]
push eax
push esi
call fcn.0040595a
pop ecx
pop ecx
xor esi, esi
push esi
push dword [ebp - 0x43c]
lea eax, [ebp - 0x418]
push 2
push esi
push esi
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x654], eax
cmp eax, 0xffffffff
jne 0x405c23
mov eax, 0x200
jmp 0x405d01
mov eax, edi
sub eax, esi
sar eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x210], cx
cmp word [ebp - 0x210], 0x2f
je 0x405bf2
cmp word [ebp - 0x210], 0x5c
je 0x405bf2
xor esi, esi
cmp word [ebp - 0x210], si
je 0x405b48
cmp word [ebp - 0x20e], 0x3a
jne 0x405b48
jmp 0x405bf4
xor esi, esi
push edi
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x418]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x210]
push eax
push esi
call fcn.0040595a
add esp, 0x18
jmp 0x405b7d
push dword [ebx + 0x23c]
mov eax, dword [ebx]
call fcn.00404ebb
pop ecx
mov edi, 0x4000
cmp dword [ebx + 0x240], esi
jne 0x405c4b
push edi
call fcn.0040a178
pop ecx
mov dword [ebx + 0x240], eax
mov dword [ebp - 0x650], esi
lea eax, [ebp - 0x649]
push eax
push dword [ebx + 0x240]
mov eax, dword [ebx]
mov ecx, edi
call fcn.00405014
mov esi, eax
pop ecx
pop ecx
cmp esi, 0xffffff96
je 0x405caf
test esi, esi
js 0x405ca3
jle 0x405c96
push 0
lea eax, [ebp - 0x658]
push eax
push esi
push dword [ebx + 0x240]
push dword [ebp - 0x654]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405cbb
cmp byte [ebp - 0x649], 0
jne 0x405cc7
test esi, esi
jne 0x405c51
mov dword [ebp - 0x650], 0x5000000
jmp 0x405ce8
mov dword [ebp - 0x650], 0x1000
jmp 0x405ce8
mov dword [ebp - 0x650], 0x400
jmp 0x405ce8
lea eax, [ebp - 0x428]
push eax
lea eax, [ebp - 0x438]
push eax
lea eax, [ebp - 0x430]
push eax
push dword [ebp - 0x654]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push dword [ebp - 0x654]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebx]
call fcn.00405241
mov eax, dword [ebp - 0x650]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00409256
leave
ret 8