Function at 0x413480
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4334
call fcn.0042e5e0
push ebx
mov ebx, dword [ebp + 0x14]
push esi
cmp ebx, 3
push edi
mov esi, ecx
je 0x4134b1
cmp ebx, 2
je 0x413535
cmp ebx, 1
je 0x413535
jmp 0x413551
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x4134f9
cmp eax, 0xffffffff
je 0x4134c8
push dword [esi]
call fcn.00412e29
pop ecx
mov eax, dword [esi]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x413551
cmp edi, dword [eax + 0x10]
jge 0x4134df
push eax
call fcn.00412820
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x4134ee
push eax
call fcn.0041285e
jmp 0x4134de
push dword [esi]
call fcn.00412b35
pop ecx
mov dword [esi + 4], edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [esi]
call fcn.00412c1d
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x413519
mov eax, 0x600
jmp 0x413770
push dword [esi]
call fcn.00412e29
or dword [esi + 4], 0xffffffff
mov eax, edi
neg eax
sbb eax, eax
pop ecx
and eax, 0x5000000
jmp 0x413770
cmp dword [esi + 4], 0xffffffff
je 0x413543
push dword [esi]
call fcn.00412e29
pop ecx
mov eax, dword [esi]
mov edi, dword [ebp + 8]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jl 0x41355b
mov eax, 0x10000
jmp 0x413770
cmp edi, dword [eax + 0x10]
jge 0x413567
push eax
call fcn.00412820
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x413576
push eax
call fcn.0041285e
jmp 0x413566
lea eax, [ebp - 0x12c]
mov ecx, esi
push eax
push edi
call fcn.00412ff4
test byte [ebp - 0x24], 0x10
je 0x4135c7
cmp ebx, 1
je 0x413767
lea eax, [ebp - 0x334]
push 0x103
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.00413777
lea eax, [ebp - 0x334]
add esi, 0x138
push eax
push esi
call fcn.004133da
add esp, 0x14
jmp 0x413767
cmp ebx, 1
jne 0x4135d4
mov eax, dword [ebp + 0xc]
jmp 0x4136b3
mov ebx, dword [ebp + 0xc]
mov edi, ebx
mov ecx, ebx
mov ax, word [ebx]
test ax, ax
je 0x41369d
cmp ax, 0x2f
je 0x4135f3
cmp ax, 0x5c
jne 0x4135f6
lea edi, [ecx + 2]
inc ecx
inc ecx
mov ax, word [ecx]
test ax, ax
jne 0x4135e7
cmp edi, ebx
je 0x41369d
lea eax, [ebp - 0x334]
push ebx
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
sub edi, ebx
pop ecx
sar edi, 1
pop ecx
and word [ebp + edi*2 - 0x336], 0
cmp word [ebp - 0x334], 0x2f
je 0x413649
cmp word [ebp - 0x334], 0x5c
je 0x413649
cmp word [ebp - 0x332], 0x3a
je 0x413649
and byte [ebp + 0xf], 0
jmp 0x41364d
mov byte [ebp + 0xf], 1
mov edi, dword [sym.imp.MSVCRT.dll_wcsstr]
lea eax, [ebp - 0x334]
push 0x43b81c
push eax
call edi
mov dword [ebp + 8], eax
lea eax, [ebp - 0x334]
push 0x43b814
push eax
call edi
add esp, 0x10
test eax, eax
setne al
cmp dword [ebp + 8], 0
setne cl
or al, cl
or al, byte [ebp + 0xf]
jne 0x41369d
lea eax, [ebp - 0x334]
push eax
lea eax, [esi + 0x138]
push eax
call fcn.004133da
pop ecx
pop ecx
xor eax, eax
push eax
push dword [ebp - 0x24]
push 2
push eax
push eax
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x4136c5
mov eax, 0x200
jmp 0x413770
push dword [esi]
call fcn.00412b35
mov edi, 0x4000
lea eax, [ebp - 0x4334]
push edi
push eax
push dword [esi]
xor bl, bl
call fcn.00412c1d
add esp, 0x10
test eax, eax
jl 0x41371a
je 0x41371c
lea ecx, [ebp + 8]
push 0
push ecx
push eax
lea eax, [ebp - 0x4334]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41371a
lea eax, [ebp - 0x4334]
push edi
push eax
push dword [esi]
call fcn.00412c1d
add esp, 0xc
jmp 0x4136e5
mov bl, 1
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x413743
test bl, bl
jne 0x413743
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x413752
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esi]
call fcn.00412e29
test eax, eax
setl al
test bl, bl
pop ecx
jne 0x41376b
test al, al
jne 0x41376b
xor eax, eax
jmp 0x413770
mov eax, 0x400
pop edi
pop esi
pop ebx
leave
ret 0x10