Function at 0x500460
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x434c
call fcn.005409e0
mov eax, dword [0x5d3070]
xor eax, esp
mov dword [esp + 0x4344], eax
push ebx
push ebp
mov ebp, dword [esp + 0x435c]
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
je 0x500492
mov ecx, dword [edi]
call fcn.004ffd90
mov ecx, dword [edi]
mov ebx, dword [esp + 0x4360]
mov dword [edi + 4], 0xffffffff
cmp ebx, dword [ecx + 4]
jl 0x5004b1
mov eax, 0x10000
jmp 0x500737
cmp ebx, dword [ecx + 0x10]
jge 0x5004bb
call fcn.004ff7a0
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jge 0x500512
mov esi, dword [edi]
test esi, esi
je 0x50050b
cmp dword [esi + 0x18], 0
je 0x50050b
mov edx, dword [esi + 0x10]
inc edx
cmp edx, dword [esi + 4]
je 0x50050b
mov ecx, dword [esi + 0x50]
sub esp, 0x10
mov eax, dword [esi + 0x48]
add ecx, dword [esi + 0x4c]
add eax, 0x2e
add eax, ecx
mov dword [esi + 0x10], edx
add dword [esi + 0x14], eax
lea edx, [esi + 0x28]
push 0
lea eax, [esi + 0x78]
mov ecx, esi
push 0
push eax
call fcn.004ff340
add esp, 0x1c
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jl 0x5004c2
lea eax, [esp + 0x10]
mov ecx, edi
push eax
push ebx
call fcn.004fff40
test byte [esp + 0x118], 0x10
je 0x500577
push 0x206
lea eax, [esp + 0x14c]
push 0
push eax
call fcn.005481a0
add esp, 0xc
lea eax, [esp + 0x148]
push 0x103
push eax
push 0xffffffffffffffff
lea eax, [esp + 0x20]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ecx, [edi + 0x138]
lea edx, [esp + 0x148]
call fcn.00500350
xor eax, eax
jmp 0x500737
movzx eax, word [ebp]
mov edx, ebp
mov ecx, ebp
test ax, ax
je 0x500661
cmp ax, 0x2f
je 0x500594
cmp ax, 0x5c
jne 0x500597
lea edx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x500588
cmp edx, ebp
je 0x500661
lea esi, [esp + 0x148]
mov ecx, ebp
sub esi, ebp
nop word [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [esi + ecx - 2], ax
test ax, ax
jne 0x5005c0
sub edx, ebp
sar edx, 1
lea edx, [edx*2 - 2]
cmp edx, 0x208
jae 0x500752
xor eax, eax
mov word [esp + edx + 0x148], ax
mov ax, word [esp + 0x148]
cmp ax, 0x2f
je 0x500614
cmp ax, 0x5c
je 0x500614
cmp word [esp + 0x14a], 0x3a
je 0x500614
xor bl, bl
jmp 0x500616
mov bl, 1
lea eax, [esp + 0x148]
push 0x5af768
push eax
call fcn.005473e4
mov esi, eax
lea eax, [esp + 0x150]
push 0x5af770
push eax
call fcn.005473e4
add esp, 0x10
test eax, eax
setne cl
test esi, esi
setne al
or cl, al
or cl, bl
jne 0x500661
lea ecx, [edi + 0x138]
lea edx, [esp + 0x148]
call fcn.00500350
push 0
push dword [esp + 0x11c]
push 2
push 0
push 0
push 0x40000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x50068d
mov eax, 0x200
jmp 0x500737
mov ecx, dword [edi]
call fcn.004ffad0
mov ecx, dword [edi]
lea edx, [esp + 0x350]
push 0x4000
xor bl, bl
call fcn.004ffbf0
add esp, 4
test eax, eax
js 0x5006ec
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x5006ee
push 0
lea ecx, [esp + 0x148]
push ecx
push eax
lea eax, [esp + 0x35c]
push eax
push esi
call ebp
test eax, eax
je 0x5006ec
mov ecx, dword [edi]
lea edx, [esp + 0x350]
push 0x4000
call fcn.004ffbf0
add esp, 4
test eax, eax
jns 0x5006b6
mov bl, 1
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x50071d
test bl, bl
jne 0x50071d
lea eax, [esp + 0x12c]
push eax
lea eax, [esp + 0x120]
push eax
lea eax, [esp + 0x12c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.004ffd90
xor eax, eax
mov ecx, 0x400
test bl, bl
cmovne eax, ecx
mov ecx, dword [esp + 0x4354]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0053f778
add esp, 0x434c
ret 0x10
call fcn.0053ff39
int3