Function at 0x4083a0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x54c
mov eax, dword [0x42f114]
xor eax, esp
mov dword [esp + 0x548], eax
push ebx
mov ebx, dword [esp + 0x558]
push ebp
mov ebp, dword [esp + 0x564]
push esi
push edi
mov esi, ecx
cmp ebp, 3
je 0x4083f2
cmp ebp, 2
je 0x4084bc
cmp ebp, 1
je 0x4084bc
cmp ebp, 4
je 0x4084bc
mov eax, 0x10000
jmp 0x408797
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x560]
cmp edi, eax
je 0x40845a
cmp eax, 0xffffffff
je 0x408410
mov eax, dword [esi]
push eax
call fcn.00405900
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4083e8
cmp edi, dword [eax + 0x10]
jge 0x40842c
push eax
call fcn.00405560
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x408445
mov edx, dword [esi]
push edx
call fcn.004055b0
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x408433
mov ecx, dword [esi + 0x138]
mov edx, dword [esi]
push ecx
push edx
call fcn.00407a80
add esp, 8
mov dword [esi + 4], edi
mov ecx, dword [esp + 0x568]
mov edx, dword [esi]
lea eax, [esp + 0x13]
push eax
push ecx
push ebx
push edx
call fcn.00407c10
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x40848b
mov eax, dword [esi]
push eax
call fcn.00405900
add esp, 4
mov dword [esi + 4], 0xffffffff
cmp byte [esp + 0x13], 0
jne 0x40856b
test edi, edi
jle 0x4084a4
mov eax, 0x600
jmp 0x408797
mov eax, edi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
jmp 0x408797
or edi, 0xffffffff
cmp dword [esi + 4], edi
je 0x4084cf
mov ecx, dword [esi]
push ecx
call fcn.00405900
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x560]
cmp edi, dword [eax + 4]
jge 0x4083e8
cmp edi, dword [eax + 0x10]
jge 0x4084f2
push eax
call fcn.00405560
add esp, 4
mov edx, dword [esi]
cmp dword [edx + 0x10], edi
jge 0x408512
lea esp, [esp]
mov eax, dword [esi]
push eax
call fcn.004055b0
mov ecx, dword [esi]
add esp, 4
cmp dword [ecx + 0x10], edi
jl 0x408500
lea edx, [esp + 0x1c]
push edx
push edi
mov ecx, esi
call fcn.00405aa0
test byte [esp + 0x124], 0x10
je 0x408572
cmp ebp, 1
je 0x40856b
movzx eax, word [ebx]
cmp ax, 0x2f
je 0x408549
cmp ax, 0x5c
je 0x408549
test ax, ax
je 0x40855b
cmp word [ebx + 2], 0x3a
jne 0x40855b
push ebx
push 0
call fcn.00406190
add esp, 8
xor eax, eax
jmp 0x408797
push ebx
add esi, 0x244
push esi
call fcn.00406190
add esp, 8
xor eax, eax
jmp 0x408797
cmp ebp, 1
je 0x40862c
movzx eax, word [ebx]
mov ebp, ebx
mov ecx, ebx
test ax, ax
je 0x4085ab
movzx eax, ax
lea ebx, [ebx]
cmp ax, 0x2f
je 0x40859c
cmp ax, 0x5c
jne 0x40859f
lea ebp, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x408590
lea edx, [esp + 0x148]
mov eax, ebx
sub edx, ebx
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4085b6
cmp ebp, ebx
jne 0x40863b
xor eax, eax
mov word [esp + 0x148], ax
push ebp
lea eax, [esp + 0x14c]
push eax
lea edi, [esi + 0x244]
push edi
lea ecx, [esp + 0x35c]
push str._s_s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea edx, [esp + 0x15c]
push edx
push edi
call fcn.00406190
add esp, 0x1c
mov eax, dword [esp + 0x124]
push 0
push eax
push 2
push 0
push 0
push 0x40000000
lea ecx, [esp + 0x368]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4086aa
mov eax, 0x200
jmp 0x408797
mov ecx, ebp
sub ecx, ebx
sar ecx, 1
xor edx, edx
mov word [esp + ecx*2 + 0x148], dx
mov ax, word [esp + 0x148]
cmp ax, 0x2f
je 0x408677
cmp ax, 0x5c
je 0x408677
test ax, ax
je 0x4085d3
cmp word [esp + 0x14a], 0x3a
jne 0x4085d3
push ebp
lea eax, [esp + 0x14c]
push eax
lea ecx, [esp + 0x358]
push str._s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea edx, [esp + 0x158]
push edx
push 0
call fcn.00406190
add esp, 0x18
jmp 0x408607
mov edx, dword [esi + 0x138]
mov eax, dword [esi]
push edx
push eax
call fcn.00407a80
add esp, 8
cmp dword [esi + 0x13c], 0
jne 0x4086d8
push 0x4000
call fcn.00414f91
add esp, 4
mov dword [esi + 0x13c], eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
jmp 0x4086f0
mov edx, dword [esi + 0x13c]
mov eax, dword [esi]
lea ecx, [esp + 0x13]
push ecx
push 0x4000
push edx
push eax
call fcn.00407c10
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x408744
test edi, edi
jl 0x40873a
jle 0x40872f
mov edx, dword [esi + 0x13c]
push 0
lea ecx, [esp + 0x1c]
push ecx
push edi
push edx
push ebx
call ebp
test eax, eax
je 0x40874e
cmp byte [esp + 0x13], 0
jne 0x408758
test edi, edi
jne 0x4086f0
mov dword [esp + 0x14], 0x5000000
jmp 0x408777
mov dword [esp + 0x14], 0x1000
jmp 0x408777
mov dword [esp + 0x14], 0x400
jmp 0x408777
lea eax, [esp + 0x138]
push eax
lea ecx, [esp + 0x12c]
push ecx
lea edx, [esp + 0x138]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x56c], 1
je 0x408788
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi]
push eax
call fcn.00405900
mov eax, dword [esp + 0x18]
add esp, 4
mov ecx, dword [esp + 0x558]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004153dc
add esp, 0x54c
ret 0x10