Function at 0x4af270
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [0x66a074]
xor eax, esp
mov dword [esp + 0x10], eax
push ebx
mov ebx, dword [ebp + 8]
mov ecx, ebx
push esi
mov esi, dword [ebp + 0x10]
mov edx, esi
push edi
mov dword [esp + 0xc], ebx
call fcn.004af590
test al, al
je 0x4af344
push ebx
push 1
lea edi, [esi + 0x54]
push 1
push edi
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
jne 0x4af344
mov al, byte [edi]
test al, al
jne 0x4af31d
mov edx, dword [esi + 0x3c]
mov eax, edx
mov ebx, dword [esi + 0x38]
mov ecx, ebx
shr eax, 0x18
mov byte [esp + 0x14], al
mov eax, edx
shr eax, 0x10
mov byte [esp + 0x15], al
mov eax, edx
shr eax, 8
mov byte [esp + 0x16], al
mov eax, edx
shrd ecx, eax, 0x18
mov byte [esp + 0x1b], bl
mov byte [esp + 0x18], cl
mov ecx, ebx
shrd ecx, eax, 0x10
mov eax, ebx
mov byte [esp + 0x17], dl
mov ebx, dword [esp + 0xc]
shrd eax, edx, 8
push ebx
push 1
mov byte [esp + 0x22], al
lea eax, [esp + 0x1c]
mov byte [esp + 0x21], cl
push 8
jmp 0x4af422
cmp al, 1
jne 0x4af32e
push ebx
push 1
push 1
lea eax, [esi + 0x55]
jmp 0x4af422
cmp al, 2
jne 0x4af358
lea edx, [esi + 0x18]
mov ecx, ebx
call fcn.004af590
test al, al
jne 0x4af53a
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.005b75ab
mov esp, ebp
pop ebp
ret
cmp al, 3
jne 0x4af3b9
mov edi, dword [esi + 0x30]
mov esi, dword [edi]
cmp esi, edi
je 0x4af37e
lea eax, [esi + 8]
push eax
push 0
push ebx
call fcn.004af270
add esp, 0xc
test al, al
je 0x4af344
mov esi, dword [esi]
cmp esi, edi
jne 0x4af365
push ebx
push 1
lea eax, [esp + 0x14]
mov word [esp + 0x14], 0
push 3
push eax
mov byte [esp + 0x1e], 9
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
je 0x4af53a
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.005b75ab
mov esp, ebp
pop ebp
ret
cmp al, 5
je 0x4af53a
cmp al, 6
je 0x4af53a
cmp al, 8
jne 0x4af448
mov eax, dword [esi + 0x34]
lea edx, [esp + 0x14]
mov ecx, ebx
mov dword [esp + 0x14], eax
call fcn.004af630
test al, al
je 0x4af344
mov edi, dword [esi + 0x30]
mov esi, dword [edi]
cmp esi, edi
je 0x4af40d
lea eax, [esi + 8]
push eax
push 0
push ebx
call fcn.004af270
add esp, 0xc
test al, al
je 0x4af344
mov esi, dword [esi]
cmp esi, edi
jne 0x4af3f0
push ebx
push 1
mov word [esp + 0x14], 0
lea eax, [esp + 0x14]
mov byte [esp + 0x16], 9
push 3
push eax
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
je 0x4af53a
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.005b75ab
mov esp, ebp
pop ebp
ret
cmp al, 0xb
jne 0x4af4c3
mov edx, dword [esi + 0x3c]
mov eax, edx
mov ebx, dword [esi + 0x38]
mov ecx, ebx
shr eax, 0x18
mov byte [esp + 0x14], al
mov eax, edx
shr eax, 0x10
mov byte [esp + 0x15], al
mov eax, edx
shr eax, 8
mov byte [esp + 0x16], al
mov eax, edx
shrd ecx, eax, 0x18
mov byte [esp + 0x1b], bl
mov byte [esp + 0x18], cl
mov ecx, ebx
shrd ecx, eax, 0x10
mov eax, ebx
mov byte [esp + 0x17], dl
mov ebx, dword [esp + 0xc]
shrd eax, edx, 8
push ebx
push 1
mov byte [esp + 0x22], al
lea eax, [esp + 0x1c]
push 8
push eax
mov byte [esp + 0x29], cl
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
jne 0x4af344
lea edx, [esi + 0x44]
mov ecx, ebx
call fcn.004af600
jmp 0x4af33c
cmp al, 0xc
jne 0x4af344
mov ecx, dword [esi + 0x28]
add esi, 0x18
mov eax, ecx
mov dword [esp + 0x14], ecx
shr eax, 0x18
mov byte [esp + 0xc], al
mov eax, ecx
shr eax, 0x10
mov byte [esp + 0xd], al
mov eax, ecx
push ebx
shr eax, 8
push 1
mov byte [esp + 0x16], al
lea eax, [esp + 0x14]
push 4
push eax
mov byte [esp + 0x1f], cl
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
jne 0x4af344
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4af53a
cmp dword [esi + 0x14], 0x10
jb 0x4af51f
mov esi, dword [esi]
push ebx
push 1
push eax
push esi
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
sete al
test al, al
je 0x4af344
cmp byte [ebp + 0xc], 0
je 0x4af56f
push ebx
push 1
lea eax, [esp + 0x1b]
mov byte [esp + 0x1b], 0
push 1
push eax
call fcn.005c0a8f
add esp, 0x10
cmp eax, 1
sete al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.005b75ab
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x1c]
mov al, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.005b75ab
mov esp, ebp
pop ebp
ret