Function at 0x4afc50
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x434c
call fcn.004f98d0
mov eax, dword [0x5938b4]
xor eax, esp
mov dword [esp + 0x4348], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, ecx
mov ecx, dword [ebp + 0x14]
mov dword [esp + 0x10], edi
cmp ecx, 3
je 0x4afc90
cmp ecx, 2
je 0x4afc90
cmp ecx, 1
jne 0x4afd76
mov eax, dword [edi + 4]
cmp ecx, 3
jne 0x4afd59
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x4afcf6
cmp eax, 0xffffffff
je 0x4afcaf
mov ecx, dword [edi]
call fcn.004af5f0
mov ecx, dword [edi]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [ecx + 4]
jge 0x4afd76
cmp esi, dword [ecx + 0x10]
jge 0x4afccd
call fcn.004af070
mov ecx, dword [edi]
cmp dword [ecx + 0x18], 0
je 0x4afda6
cmp dword [ecx + 0x10], esi
jge 0x4afcee
nop dword [eax]
mov ecx, dword [edi]
call fcn.004af0b0
mov ecx, dword [edi]
cmp dword [ecx + 0x10], esi
jl 0x4afce0
call fcn.004af300
mov dword [edi + 4], esi
push dword [ebp + 0x10]
mov ecx, dword [edi]
mov edx, ebx
call fcn.004af430
mov esi, eax
add esp, 4
test esi, esi
jle 0x4afd27
mov eax, 0x600
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.004af5f0
mov dword [edi + 4], 0xffffffff
test esi, esi
je 0x4b0026
mov eax, 0x5000000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 0xffffffff
je 0x4afd65
mov ecx, dword [edi]
call fcn.004af5f0
mov eax, dword [edi]
mov esi, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [eax + 4]
jl 0x4afd92
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
cmp esi, dword [eax + 0x10]
jge 0x4afda0
mov ecx, eax
call fcn.004af070
mov eax, dword [edi]
cmp dword [eax + 0x18], 0
jne 0x4afdc2
mov eax, 0x700
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
cmp dword [eax + 0x10], esi
jge 0x4afdd5
mov ecx, dword [edi]
call fcn.004af0b0
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jl 0x4afdc7
lea eax, [esp + 0x18]
mov ecx, edi
push eax
push esi
call fcn.004af6f0
test byte [esp + 0x120], 0x10
jne 0x4b0026
cmp dword [ebp + 0x14], 1
je 0x4aff38
movzx eax, word [ebx]
mov esi, ebx
mov ecx, ebx
test ax, ax
je 0x4aff1b
mov edx, eax
nop dword [eax]
cmp dx, 0x2f
je 0x4afe1c
cmp dx, 0x5c
jne 0x4afe1f
lea esi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x4afe10
cmp esi, ebx
je 0x4aff1b
lea ecx, [esp + 0x148]
mov eax, ebx
mov edi, ecx
mov edx, 0x104
sub eax, edi
mov edi, eax
nop dword [eax]
lea eax, [edx + 0x7ffffefa]
test eax, eax
je 0x4afe6e
movzx eax, word [edi + ecx]
test ax, ax
je 0x4afe6e
mov word [ecx], ax
add ecx, 2
sub edx, 1
jne 0x4afe50
mov edi, dword [esp + 0x10]
lea eax, [ecx - 2]
test edx, edx
cmovne eax, ecx
sub esi, ebx
sar esi, 1
xor ecx, ecx
mov word [eax], cx
lea esi, [esi*2 - 2]
cmp esi, 0x208
jae 0x4b003f
xor eax, eax
mov word [esp + esi + 0x148], ax
mov ax, word [esp + 0x148]
cmp ax, 0x2f
je 0x4afec3
cmp ax, 0x5c
je 0x4afec3
cmp word [esp + 0x14a], 0x3a
mov byte [esp + 0xf], cl
jne 0x4afec8
mov byte [esp + 0xf], 1
lea eax, [esp + 0x148]
push 0x56b7cc
push eax
call fcn.004fa5ae
mov esi, eax
lea eax, [esp + 0x150]
push 0x56b7d4
push eax
call fcn.004fa5ae
movzx ecx, byte [esp + 0x1f]
add esp, 0x10
test eax, eax
mov eax, 1
setne dl
test esi, esi
cmovne ecx, eax
or dl, cl
jne 0x4aff1b
lea ecx, [edi + 0x13c]
lea edx, [esp + 0x148]
call fcn.004afb20
push 0
push dword [esp + 0x124]
push 2
push 0
push 0
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4aff59
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.004af300
mov ecx, dword [edi]
lea edx, [esp + 0x350]
push 0x4000
mov byte [esp + 0x13], 0
call fcn.004af430
add esp, 4
test eax, eax
js 0x4affb8
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x4affbd
push 0
lea ecx, [esp + 0x14]
push ecx
push eax
lea eax, [esp + 0x35c]
push eax
push ebx
call esi
test eax, eax
je 0x4affb8
mov ecx, dword [edi]
lea edx, [esp + 0x350]
push 0x4000
call fcn.004af430
add esp, 4
test eax, eax
jns 0x4aff85
mov byte [esp + 0xf], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x4affef
cmp byte [esp + 0xf], 0
jne 0x4affef
lea eax, [esp + 0x134]
push eax
lea eax, [esp + 0x128]
push eax
lea eax, [esp + 0x134]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x4afffc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.004af5f0
cmp byte [esp + 0xf], 0
je 0x4b0026
mov eax, 0x400
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [esp + 0x4354]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004f8545
mov esp, ebp
pop ebp
ret 0x10
call fcn.004f8cce
int3