Function at 0x413aa4
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4334
call fcn.00431de0
push ebx
mov ebx, dword [ebp + 0x14]
push esi
cmp ebx, 3
push edi
mov esi, ecx
je 0x413ad5
cmp ebx, 2
je 0x413b59
cmp ebx, 1
je 0x413b59
jmp 0x413b75
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x413b1d
cmp eax, 0xffffffff
je 0x413aec
push dword [esi]
call fcn.0041344d
pop ecx
mov eax, dword [esi]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x413b75
cmp edi, dword [eax + 0x10]
jge 0x413b03
push eax
call fcn.00412e44
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x413b12
push eax
call fcn.00412e82
jmp 0x413b02
push dword [esi]
call fcn.00413159
pop ecx
mov dword [esi + 4], edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [esi]
call fcn.00413241
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x413b3d
mov eax, 0x600
jmp 0x413d94
push dword [esi]
call fcn.0041344d
or dword [esi + 4], 0xffffffff
mov eax, edi
neg eax
sbb eax, eax
pop ecx
and eax, 0x5000000
jmp 0x413d94
cmp dword [esi + 4], 0xffffffff
je 0x413b67
push dword [esi]
call fcn.0041344d
pop ecx
mov eax, dword [esi]
mov edi, dword [ebp + 8]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jl 0x413b7f
mov eax, 0x10000
jmp 0x413d94
cmp edi, dword [eax + 0x10]
jge 0x413b8b
push eax
call fcn.00412e44
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x413b9a
push eax
call fcn.00412e82
jmp 0x413b8a
lea eax, [ebp - 0x12c]
mov ecx, esi
push eax
push edi
call fcn.00413618
test byte [ebp - 0x24], 0x10
je 0x413beb
cmp ebx, 1
je 0x413d8b
lea eax, [ebp - 0x334]
push 0x103
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.00413d9b
lea eax, [ebp - 0x334]
add esi, 0x138
push eax
push esi
call fcn.004139fe
add esp, 0x14
jmp 0x413d8b
cmp ebx, 1
jne 0x413bf8
mov eax, dword [ebp + 0xc]
jmp 0x413cd7
mov ebx, dword [ebp + 0xc]
mov edi, ebx
mov ecx, ebx
mov ax, word [ebx]
test ax, ax
je 0x413cc1
cmp ax, 0x2f
je 0x413c17
cmp ax, 0x5c
jne 0x413c1a
lea edi, [ecx + 2]
inc ecx
inc ecx
mov ax, word [ecx]
test ax, ax
jne 0x413c0b
cmp edi, ebx
je 0x413cc1
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 0x413c6d
cmp word [ebp - 0x334], 0x5c
je 0x413c6d
cmp word [ebp - 0x332], 0x3a
je 0x413c6d
and byte [ebp + 0xf], 0
jmp 0x413c71
mov byte [ebp + 0xf], 1
mov edi, dword [sym.imp.MSVCRT.dll_wcsstr]
lea eax, [ebp - 0x334]
push 0x43e994
push eax
call edi
mov dword [ebp + 8], eax
lea eax, [ebp - 0x334]
push 0x43e98c
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 0x413cc1
lea eax, [ebp - 0x334]
push eax
lea eax, [esi + 0x138]
push eax
call fcn.004139fe
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 0x413ce9
mov eax, 0x200
jmp 0x413d94
push dword [esi]
call fcn.00413159
mov edi, 0x4000
lea eax, [ebp - 0x4334]
push edi
push eax
push dword [esi]
xor bl, bl
call fcn.00413241
add esp, 0x10
test eax, eax
jl 0x413d3e
je 0x413d40
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 0x413d3e
lea eax, [ebp - 0x4334]
push edi
push eax
push dword [esi]
call fcn.00413241
add esp, 0xc
jmp 0x413d09
mov bl, 1
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x413d67
test bl, bl
jne 0x413d67
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 0x413d76
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esi]
call fcn.0041344d
test eax, eax
setl al
test bl, bl
pop ecx
jne 0x413d8f
test al, al
jne 0x413d8f
xor eax, eax
jmp 0x413d94
mov eax, 0x400
pop edi
pop esi
pop ebx
leave
ret 0x10