Function at 0x4af980
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x70
push ebx
push esi
push edi
mov edi, ecx
call fcn.004af7ce
push dword [ebp + 0x1c]
and dword [ebp - 0xc], 0
lea ecx, [ebp - 0x70]
mov dword [ebp - 4], eax
mov dword [ebp - 8], edx
call fcn.004ae38b
mov ebx, dword [ebp + 0x14]
lea ecx, [ebp - 0x70]
mov eax, 0x10000
cmp ebx, eax
mov esi, eax
mov eax, dword [ebp + 0x18]
cmovb esi, ebx
mov dword [ebp - 0x50], eax
and dword [ebp - 0x40], 0
push 0
push ebx
mov dword [ebp + 0x14], esi
call fcn.004afe85
mov ecx, dword [ebp + 8]
mov esi, ebx
mov edx, dword [ebp + 0xc]
add esi, ecx
push 0
pop eax
adc eax, edx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 4]
add eax, 0x10000
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 8]
adc eax, 0
mov dword [ebp - 0x1c], edx
cmp dword [ebp - 0x10], eax
jb 0x4afa42
ja 0x4afa04
cmp esi, dword [ebp - 0x20]
jbe 0x4afa42
cmp dword [ebp - 0x6c], 0
je 0x4afa16
lea ecx, [ebp - 0x70]
call fcn.004b3d21
mov esi, eax
jmp 0x4afa18
xor esi, esi
test esi, esi
js 0x4afb3f
push dword [ebp + 0x1c]
lea eax, [edi + 8]
push dword [ebp - 0x10]
mov ecx, dword [eax]
push dword [ebp - 0x24]
push eax
call dword [ecx + 0x18]
mov edx, dword [ebp + 0xc]
xor ecx, ecx
test eax, eax
setns cl
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp + 8]
and dword [ebp - 0x28], 0
cmp dword [ebp - 0x6c], 0
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], edx
je 0x4afa5e
lea ecx, [ebp - 0x70]
call fcn.004b3d21
mov esi, eax
jmp 0x4afa60
xor esi, esi
test esi, esi
js 0x4afb25
mov esi, dword [ebp + 0x14]
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x14]
push eax
push esi
push dword [ebp + 0x10]
push dword [edi + 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [edi + 0x28], 0
je 0x4afaaf
test eax, eax
jne 0x4aface
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4afab3
push 1
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x38]
push eax
push dword [edi + 0x20]
call fcn.004b445f
add esp, 0x10
movzx eax, al
test eax, eax
jne 0x4aface
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
jne 0x4afb25
mov esi, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp - 0x14]
sub ebx, eax
add dword [ebp + 0x10], eax
mov edx, dword [ebp - 0x1c]
add dword [ecx], eax
mov ecx, dword [ebp - 0x18]
add ecx, eax
mov dword [ebp - 0x18], ecx
adc edx, 0
mov dword [ebp - 0x1c], edx
cmp dword [ebp - 8], edx
ja 0x4afafe
jb 0x4afaf8
cmp dword [ebp - 4], ecx
ja 0x4afafe
mov dword [ebp - 4], ecx
mov dword [ebp - 8], edx
cmp esi, eax
jne 0x4afb20
xor esi, esi
test ebx, ebx
je 0x4afb1c
mov esi, 0x10000
cmp ebx, esi
mov eax, esi
cmovb eax, ebx
mov dword [ebp + 0x14], eax
jmp 0x4afa42
xor eax, eax
jmp 0x4afb28
mov esi, 0x80004005
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x4afb3f
push 0
push dword [ebp - 8]
lea eax, [edi + 8]
push dword [ebp - 4]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x18]
jmp 0x4afb4b
mov eax, dword [ebp - 4]
mov dword [edi + 0x50], eax
mov eax, dword [ebp - 8]
mov dword [edi + 0x54], eax
lea ecx, [ebp - 0x70]
call fcn.004ae477
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18