Function at 0x4ffa10
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov dword [ebp - 0xc], esi
mov esi, dword [ebp + 8]
mov dword [ebp - 4], ebx
mov dword [ebp - 8], edi
mov eax, dword [esi + 0x40]
neg eax
mov ebx, dword [esi + 0x3c]
add eax, ebx
mov ecx, dword [esi + 0xf8]
cmp eax, ecx
jae 0x4ffa74
sub ecx, eax
test byte [esi + 0x16a], 0x40
je 0x4ffa4c
push ecx
push 0x20
push ebx
call fcn.0053bad0
jmp 0x4ffa55
push ecx
push 0
push ebx
call fcn.0053bad0
add esp, 0xc
mov eax, dword [esi + 0xf8]
movzx ecx, byte [esi + 0x168]
cmp byte [esi + 0x156], 2
je 0x4ffb3b
jmp 0x4ffa7b
movzx ecx, byte [esi + 0x168]
test cl, 4
je 0x4ffa99
test byte [esi + 0x16a], 0x40
je 0x4ffa99
mov ecx, dword [esi + 0x40]
mov byte [ecx + eax - 2], 0xd
mov ebx, dword [esi + 0x40]
mov byte [ebx + eax - 1], 0xa
mov ecx, dword [esi + 0x98]
add ecx, 0xffffffff
mov ebx, dword [esi + 0x9c]
adc ebx, 0xffffffff
push ebx
cdq
push ecx
push edx
push eax
call fcn.00529a80
test byte [esi + 0x16d], 4
jne 0x4ffaf7
push 0
mov dword [ebp - 0x18], eax
lea ecx, [ebp - 0x14]
push ecx
push eax
mov dword [ebp - 0x14], edx
push dword [esi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x4ffc8a
mov ebx, dword [ebp - 0x14]
mov ecx, 0xffffffff
sub eax, ecx
sub ebx, ecx
or eax, ebx
je 0x4ffc6f
mov edx, dword [esi + 0xf8]
mov edi, dword [esi + 0x40]
add edi, edx
mov eax, dword [esi + 0x38]
mov dword [esi + 0x40], edi
test byte [esi + 0x171], 0x40
je 0x4ffb58
mov ebx, dword [esi + 0x44]
mov ecx, ebx
sub ecx, eax
cmp ecx, dword [esi + 0xec]
je 0x4ffb58
add edx, ebx
mov dword [esi + 0x44], edx
or byte [esi + 0x16d], 4
xor eax, eax
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
test cl, 4
jne 0x4ffa7b
mov ecx, dword [esi + 0x40]
mov byte [eax + ecx - 1], 0xa
movzx ecx, byte [esi + 0x168]
jmp 0x4ffa7b
mov edx, dword [esi + 0x13c]
test edx, edx
jne 0x4ffb67
mov edx, 0x20000
sub edi, eax
cmp edi, edx
ja 0x4ffb91
push 0
lea ecx, [ebp - 0x10]
push ecx
push edi
push eax
push dword [esi + 0xe4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, 0xffffffff
test eax, eax
je 0x4ffbf9
mov ecx, 1
jmp 0x4ffbf9
mov dword [ebp - 0x1c], edi
mov ebx, edi
mov edi, eax
mov eax, edx
mov edx, esi
mov esi, eax
push 0
lea ecx, [ebp - 0x10]
push ecx
push esi
push edi
push dword [edx + 0xe4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp + 8]
test eax, eax
jne 0x4ffbc5
mov edi, dword [ebp - 0x1c]
mov esi, edx
mov ecx, 0xffffffff
jmp 0x4ffbf9
mov ecx, dword [edx + 0x13c]
test ecx, ecx
mov eax, dword [ebp - 0x10]
jne 0x4ffbd7
mov ecx, 0x20000
sub ebx, eax
add edi, eax
cmp ebx, ecx
jae 0x4ffbe7
mov esi, ebx
test ebx, ebx
jne 0x4ffbeb
jmp 0x4ffbef
test ebx, ebx
je 0x4ffbef
test eax, eax
ja 0x4ffb9e
mov edi, dword [ebp - 0x1c]
mov esi, edx
mov ecx, 1
mov eax, dword [esi + 0x38]
mov ebx, dword [esi + 0xf8]
mov dword [esi + 0x40], eax
add eax, ebx
mov dword [esi + 0x44], eax
mov eax, edi
cdq
mov eax, dword [esi + 0xc0]
add edi, eax
adc edx, dword [esi + 0xc4]
xor ebx, ebx
and byte [esi + 0x16d], 0xfb
mov dword [esi + 0xa8], ebx
cmp ecx, 0xffffffff
mov dword [esi + 0xac], ebx
mov dword [esi + 0xc0], edi
mov dword [esi + 0xc4], edx
mov dword [esi + 0xb8], edi
mov dword [esi + 0xbc], edx
jne 0x4ffb2c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xe8], eax
mov eax, 0x26
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xe8], eax
mov eax, 0x26
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4ffca1
mov eax, 0xffffffff
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
jmp 0x4ffc6f
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
jmp 0x4ffae6