Function at 0x413bdd
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4334
call fcn.00432650
push ebx
mov ebx, dword [ebp + 0x14]
push esi
cmp ebx, 3
push edi
mov esi, ecx
je 0x413c0e
cmp ebx, 2
je 0x413c92
cmp ebx, 1
je 0x413c92
jmp 0x413cae
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x413c56
cmp eax, 0xffffffff
je 0x413c25
push dword [esi]
call fcn.00413586
pop ecx
mov eax, dword [esi]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x413cae
cmp edi, dword [eax + 0x10]
jge 0x413c3c
push eax
call fcn.00412f7d
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x413c4b
push eax
call fcn.00412fbb
jmp 0x413c3b
push dword [esi]
call fcn.00413292
pop ecx
mov dword [esi + 4], edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [esi]
call fcn.0041337a
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x413c76
mov eax, 0x600
jmp 0x413ecd
push dword [esi]
call fcn.00413586
or dword [esi + 4], 0xffffffff
mov eax, edi
neg eax
sbb eax, eax
pop ecx
and eax, 0x5000000
jmp 0x413ecd
cmp dword [esi + 4], 0xffffffff
je 0x413ca0
push dword [esi]
call fcn.00413586
pop ecx
mov eax, dword [esi]
mov edi, dword [ebp + 8]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jl 0x413cb8
mov eax, 0x10000
jmp 0x413ecd
cmp edi, dword [eax + 0x10]
jge 0x413cc4
push eax
call fcn.00412f7d
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x413cd3
push eax
call fcn.00412fbb
jmp 0x413cc3
lea eax, [ebp - 0x12c]
mov ecx, esi
push eax
push edi
call fcn.00413751
test byte [ebp - 0x24], 0x10
je 0x413d24
cmp ebx, 1
je 0x413ec4
lea eax, [ebp - 0x334]
push 0x103
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.00413ed4
lea eax, [ebp - 0x334]
add esi, 0x138
push eax
push esi
call fcn.00413b37
add esp, 0x14
jmp 0x413ec4
cmp ebx, 1
jne 0x413d31
mov eax, dword [ebp + 0xc]
jmp 0x413e10
mov ebx, dword [ebp + 0xc]
mov edi, ebx
mov ecx, ebx
mov ax, word [ebx]
test ax, ax
je 0x413dfa
cmp ax, 0x2f
je 0x413d50
cmp ax, 0x5c
jne 0x413d53
lea edi, [ecx + 2]
inc ecx
inc ecx
mov ax, word [ecx]
test ax, ax
jne 0x413d44
cmp edi, ebx
je 0x413dfa
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 0x413da6
cmp word [ebp - 0x334], 0x5c
je 0x413da6
cmp word [ebp - 0x332], 0x3a
je 0x413da6
and byte [ebp + 0xf], 0
jmp 0x413daa
mov byte [ebp + 0xf], 1
mov edi, dword [sym.imp.MSVCRT.dll_wcsstr]
lea eax, [ebp - 0x334]
push 0x43f904
push eax
call edi
mov dword [ebp + 8], eax
lea eax, [ebp - 0x334]
push 0x43f8fc
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 0x413dfa
lea eax, [ebp - 0x334]
push eax
lea eax, [esi + 0x138]
push eax
call fcn.00413b37
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 0x413e22
mov eax, 0x200
jmp 0x413ecd
push dword [esi]
call fcn.00413292
mov edi, 0x4000
lea eax, [ebp - 0x4334]
push edi
push eax
push dword [esi]
xor bl, bl
call fcn.0041337a
add esp, 0x10
test eax, eax
jl 0x413e77
je 0x413e79
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 0x413e77
lea eax, [ebp - 0x4334]
push edi
push eax
push dword [esi]
call fcn.0041337a
add esp, 0xc
jmp 0x413e42
mov bl, 1
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x413ea0
test bl, bl
jne 0x413ea0
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 0x413eaf
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esi]
call fcn.00413586
test eax, eax
setl al
test bl, bl
pop ecx
jne 0x413ec8
test al, al
jne 0x413ec8
xor eax, eax
jmp 0x413ecd
mov eax, 0x400
pop edi
pop esi
pop ebx
leave
ret 0x10