Function at 0x4057e0
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x434c
call fcn.0040b920
mov eax, dword [0x413028]
xor eax, esp
mov dword [esp + 0x4344], eax
mov eax, dword [esp + 0x4354]
push ebx
push ebp
mov ebp, dword [esp + 0x4358]
push esi
or esi, 0xffffffff
push edi
mov edi, ecx
mov dword [esp + 0x14], eax
cmp dword [ebp + 4], esi
je 0x405820
mov ebx, dword [ebp]
call fcn.00405130
mov dword [ebp + 4], esi
mov esi, dword [ebp]
cmp edi, dword [esi + 4]
jl 0x405835
mov eax, 0x10000
jmp 0x405a9b
cmp edi, dword [esi + 0x10]
jge 0x40583f
call fcn.00404bb0
mov ecx, dword [ebp]
cmp dword [ecx + 0x10], edi
jge 0x405896
mov esi, dword [ebp]
test esi, esi
je 0x40588e
cmp dword [esi + 0x18], 0
je 0x40588e
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x40588e
mov edx, dword [esi + 0x50]
add edx, dword [esi + 0x4c]
mov ecx, dword [esi + 0x48]
push 0
mov dword [esi + 0x10], eax
lea edx, [edx + ecx + 0x2e]
add dword [esi + 0x14], edx
push 0
lea eax, [esi + 0x78]
push eax
lea ecx, [esi + 0x28]
push ecx
mov eax, esi
call fcn.00404760
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov edx, dword [ebp]
cmp dword [edx + 0x10], edi
jl 0x405847
lea eax, [esp + 0x18]
push eax
push edi
mov ecx, ebp
call fcn.004052a0
test byte [esp + 0x120], 0x10
je 0x4058da
lea ecx, [esp + 0x1c]
push ecx
lea esi, [esp + 0x14c]
call fcn.004040f0
add esp, 4
mov edx, esi
push edx
add ebp, 0x138
push ebp
call fcn.004056d0
add esp, 8
xor eax, eax
jmp 0x405a9b
mov edi, dword [esp + 0x14]
movzx eax, word [edi]
mov esi, edi
mov ecx, edi
test ax, ax
je 0x4059b6
movzx eax, ax
cmp ax, 0x2f
je 0x4058fd
cmp ax, 0x5c
jne 0x405900
lea esi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x4058f1
cmp esi, edi
je 0x4059b6
lea edx, [esp + 0x148]
mov eax, edi
sub edx, edi
nop
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x405920
sub esi, edi
xor eax, eax
sar esi, 1
mov word [esp + esi*2 + 0x146], ax
mov ax, word [esp + 0x148]
cmp ax, 0x2f
je 0x405960
cmp ax, 0x5c
je 0x405960
cmp word [esp + 0x14a], 0x3a
je 0x405960
xor bl, bl
jmp 0x405962
mov bl, 1
mov esi, dword [sym.imp.MSVCR90.dll_wcsstr]
lea ecx, [esp + 0x148]
push 0x40ebf0
push ecx
call esi
lea edx, [esp + 0x150]
push 0x40ebf8
push edx
mov edi, eax
call esi
add esp, 0x10
test eax, eax
setne al
test edi, edi
setne cl
or al, cl
or al, bl
jne 0x4059b2
lea edx, [esp + 0x148]
push edx
lea eax, [ebp + 0x138]
push eax
call fcn.004056d0
add esp, 8
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x120]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4059e3
mov eax, 0x200
jmp 0x405a9b
mov eax, dword [ebp]
call fcn.00404e80
mov eax, dword [ebp]
lea edx, [esp + 0x350]
push edx
mov ecx, 0x4000
mov byte [esp + 0x17], 0
call fcn.00404f90
add esp, 4
test eax, eax
jl 0x405a47
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x405a4c
push 0
lea ecx, [esp + 0x18]
push ecx
push eax
lea edx, [esp + 0x35c]
push edx
push esi
call edi
test eax, eax
je 0x405a47
lea eax, [esp + 0x350]
push eax
mov eax, dword [ebp]
mov ecx, 0x4000
call fcn.00404f90
add esp, 4
test eax, eax
jge 0x405a12
mov byte [esp + 0x13], 1
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x405a7e
cmp byte [esp + 0x13], 0
jne 0x405a7e
lea ecx, [esp + 0x134]
push ecx
lea edx, [esp + 0x128]
push edx
lea eax, [esp + 0x134]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp]
call fcn.00405130
movzx eax, byte [esp + 0x13]
neg eax
sbb eax, eax
and eax, 0x400
mov ecx, dword [esp + 0x4354]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040b240
add esp, 0x434c
ret 8