Function at 0x4afbf0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x434c
call fcn.004f82e0
mov eax, dword [0x592884]
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 0x4afc30
cmp ecx, 2
je 0x4afc30
cmp ecx, 1
jne 0x4afd16
mov eax, dword [edi + 4]
cmp ecx, 3
jne 0x4afcf9
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x4afc96
cmp eax, 0xffffffff
je 0x4afc4f
mov ecx, dword [edi]
call fcn.004af590
mov ecx, dword [edi]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [ecx + 4]
jge 0x4afd16
cmp esi, dword [ecx + 0x10]
jge 0x4afc6d
call fcn.004af010
mov ecx, dword [edi]
cmp dword [ecx + 0x18], 0
je 0x4afd46
cmp dword [ecx + 0x10], esi
jge 0x4afc8e
nop dword [eax]
mov ecx, dword [edi]
call fcn.004af050
mov ecx, dword [edi]
cmp dword [ecx + 0x10], esi
jl 0x4afc80
call fcn.004af2a0
mov dword [edi + 4], esi
push dword [ebp + 0x10]
mov ecx, dword [edi]
mov edx, ebx
call fcn.004af3d0
mov esi, eax
add esp, 4
test esi, esi
jle 0x4afcc7
mov eax, 0x600
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f6f55
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.004af590
mov dword [edi + 4], 0xffffffff
test esi, esi
je 0x4affc6
mov eax, 0x5000000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f6f55
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 0xffffffff
je 0x4afd05
mov ecx, dword [edi]
call fcn.004af590
mov eax, dword [edi]
mov esi, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [eax + 4]
jl 0x4afd32
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f6f55
mov esp, ebp
pop ebp
ret 0x10
cmp esi, dword [eax + 0x10]
jge 0x4afd40
mov ecx, eax
call fcn.004af010
mov eax, dword [edi]
cmp dword [eax + 0x18], 0
jne 0x4afd62
mov eax, 0x700
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f6f55
mov esp, ebp
pop ebp
ret 0x10
cmp dword [eax + 0x10], esi
jge 0x4afd75
mov ecx, dword [edi]
call fcn.004af050
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jl 0x4afd67
lea eax, [esp + 0x18]
mov ecx, edi
push eax
push esi
call fcn.004af690
test byte [esp + 0x120], 0x10
jne 0x4affc6
cmp dword [ebp + 0x14], 1
je 0x4afed8
movzx eax, word [ebx]
mov esi, ebx
mov ecx, ebx
test ax, ax
je 0x4afebb
mov edx, eax
nop dword [eax]
cmp dx, 0x2f
je 0x4afdbc
cmp dx, 0x5c
jne 0x4afdbf
lea esi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x4afdb0
cmp esi, ebx
je 0x4afebb
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 0x4afe0e
movzx eax, word [edi + ecx]
test ax, ax
je 0x4afe0e
mov word [ecx], ax
add ecx, 2
sub edx, 1
jne 0x4afdf0
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 0x4affdf
xor eax, eax
mov word [esp + esi + 0x148], ax
mov ax, word [esp + 0x148]
cmp ax, 0x2f
je 0x4afe63
cmp ax, 0x5c
je 0x4afe63
cmp word [esp + 0x14a], 0x3a
mov byte [esp + 0xf], cl
jne 0x4afe68
mov byte [esp + 0xf], 1
lea eax, [esp + 0x148]
push 0x56a74c
push eax
call fcn.004f8fbe
mov esi, eax
lea eax, [esp + 0x150]
push 0x56a754
push eax
call fcn.004f8fbe
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 0x4afebb
lea ecx, [edi + 0x13c]
lea edx, [esp + 0x148]
call fcn.004afac0
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 0x4afef9
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f6f55
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.004af2a0
mov ecx, dword [edi]
lea edx, [esp + 0x350]
push 0x4000
mov byte [esp + 0x13], 0
call fcn.004af3d0
add esp, 4
test eax, eax
js 0x4aff58
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x4aff5d
push 0
lea ecx, [esp + 0x14]
push ecx
push eax
lea eax, [esp + 0x35c]
push eax
push ebx
call esi
test eax, eax
je 0x4aff58
mov ecx, dword [edi]
lea edx, [esp + 0x350]
push 0x4000
call fcn.004af3d0
add esp, 4
test eax, eax
jns 0x4aff25
mov byte [esp + 0xf], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x4aff8f
cmp byte [esp + 0xf], 0
jne 0x4aff8f
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 0x4aff9c
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.004af590
cmp byte [esp + 0xf], 0
je 0x4affc6
mov eax, 0x400
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4348]
xor ecx, esp
call fcn.004f6f55
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.004f6f55
mov esp, ebp
pop ebp
ret 0x10
call fcn.004f76de
int3