Function at 0x404f12
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x348
mov eax, dword [0x5add40]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0x14], 3
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov esi, ecx
je 0x404f51
cmp dword [ebp + 0x14], 2
je 0x404ffd
cmp dword [ebp + 0x14], 1
je 0x404ffd
mov eax, 0x10000
jmp 0x405287
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x404fa0
cmp eax, 0xffffffff
je 0x404f68
push dword [esi]
call fcn.00403111
pop ecx
mov eax, dword [esi]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x404f47
cmp edi, dword [eax + 0x10]
jge 0x404f88
push eax
call fcn.00402ecd
jmp 0x404f87
push dword [esi]
call fcn.00402f0e
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jl 0x404f80
push dword [esi + 0x138]
push eax
call fcn.00404ada
pop ecx
pop ecx
mov dword [esi + 4], edi
lea eax, [ebp - 0x339]
push eax
push dword [ebp + 0x10]
push ebx
push dword [esi]
call fcn.00404c39
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x404fc7
push dword [esi]
call fcn.00403111
or dword [esi + 4], 0xffffffff
pop ecx
cmp byte [ebp - 0x339], 0
je 0x404fd7
xor eax, eax
jmp 0x405287
test edi, edi
jle 0x404fe5
mov eax, 0x600
jmp 0x405287
xor eax, eax
cmp edi, 0xffffff96
setne al
dec eax
and eax, 0xfb001000
add eax, 0x5000000
jmp 0x405287
cmp dword [esi + 4], 0xffffffff
je 0x40500b
push dword [esi]
call fcn.00403111
pop ecx
mov eax, dword [esi]
mov edi, dword [ebp + 8]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x404f47
cmp edi, dword [eax + 0x10]
jge 0x405032
push eax
call fcn.00402ecd
jmp 0x405031
push dword [esi]
call fcn.00402f0e
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jl 0x40502a
lea eax, [ebp - 0x338]
push eax
push edi
mov ecx, esi
call fcn.004032e2
test byte [ebp - 0x230], 0x10
je 0x405089
cmp dword [ebp + 0x14], 1
je 0x404fd0
mov al, byte [ebx]
cmp al, 0x2f
je 0x40506f
cmp al, 0x5c
je 0x40506f
test al, al
je 0x405074
cmp byte [ebx + 1], 0x3a
jne 0x405074
push ebx
push 0
jmp 0x40507c
push ebx
add esi, 0x140
push esi
call fcn.004037c4
pop ecx
xor eax, eax
jmp 0x405286
cmp dword [ebp + 0x14], 1
jne 0x40509a
mov dword [ebp - 0x344], ebx
jmp 0x405124
mov al, byte [ebx]
mov edi, ebx
mov ecx, ebx
jmp 0x4050b0
cmp al, 0x2f
je 0x4050aa
cmp al, 0x5c
jne 0x4050ad
lea edi, [ecx + 1]
inc ecx
mov al, byte [ecx]
test al, al
jne 0x4050a2
lea eax, [ebp - 0x108]
push ebx
push eax
call fcn.00505650
pop ecx
pop ecx
cmp edi, ebx
jne 0x405137
mov byte [ebp - 0x108], 0
push edi
lea eax, [ebp - 0x108]
push eax
lea ebx, [esi + 0x140]
push ebx
lea eax, [ebp - 0x20c]
push 0x565a48
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x108]
push eax
push ebx
call fcn.004037c4
add esp, 0x1c
xor eax, eax
push eax
push dword [ebp - 0x230]
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x344], eax
cmp dword [ebp - 0x344], 0xffffffff
jne 0x40519f
mov eax, 0x200
jmp 0x405287
mov eax, edi
sub eax, ebx
mov byte [ebp + eax - 0x108], 0
cmp byte [ebp - 0x108], 0x2f
je 0x40516f
cmp byte [ebp - 0x108], 0x5c
je 0x40516f
cmp byte [ebp - 0x108], 0
je 0x4050ce
cmp byte [ebp - 0x107], 0x3a
jne 0x4050ce
push edi
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push 0x565a40
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x108]
push eax
push 0
call fcn.004037c4
add esp, 0x18
jmp 0x4050ff
push dword [esi + 0x138]
push dword [esi]
call fcn.00404ada
cmp dword [esi + 0x13c], 0
pop ecx
pop ecx
mov ebx, 0x4000
jne 0x4051c9
push ebx
call fcn.00406395
pop ecx
mov dword [esi + 0x13c], eax
and dword [ebp - 0x340], 0
lea eax, [ebp - 0x339]
push eax
push ebx
push dword [esi + 0x13c]
push dword [esi]
call fcn.00404c39
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x40522e
test edi, edi
js 0x405222
jle 0x405215
push 0
lea eax, [ebp - 0x348]
push eax
push edi
push dword [esi + 0x13c]
push dword [ebp - 0x344]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40523a
cmp byte [ebp - 0x339], 0
jne 0x405246
test edi, edi
jne 0x4051d0
mov dword [ebp - 0x340], 0x5000000
jmp 0x405267
mov dword [ebp - 0x340], 0x1000
jmp 0x405267
mov dword [ebp - 0x340], 0x400
jmp 0x405267
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x224]
push eax
push dword [ebp - 0x344]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x405279
push dword [ebp - 0x344]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esi]
call fcn.00403111
mov eax, dword [ebp - 0x340]
pop ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00504fa3
leave
ret 0x10