Function at 0x5630a0
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 0x563104
sub ecx, eax
test byte [esi + 0x16a], 0x40
je 0x5630dc
push ecx
push 0x20
push ebx
call fcn.0059f940
jmp 0x5630e5
push ecx
push 0
push ebx
call fcn.0059f940
add esp, 0xc
mov eax, dword [esi + 0xf8]
movzx ecx, byte [esi + 0x168]
cmp byte [esi + 0x156], 2
je 0x5631cb
jmp 0x56310b
movzx ecx, byte [esi + 0x168]
test cl, 4
je 0x563129
test byte [esi + 0x16a], 0x40
je 0x563129
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.0058d9c0
test byte [esi + 0x16d], 4
jne 0x563187
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 0x56331a
mov ebx, dword [ebp - 0x14]
mov ecx, 0xffffffff
sub eax, ecx
sub ebx, ecx
or eax, ebx
je 0x5632ff
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 0x5631e8
mov ebx, dword [esi + 0x44]
mov ecx, ebx
sub ecx, eax
cmp ecx, dword [esi + 0xec]
je 0x5631e8
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 0x56310b
mov ecx, dword [esi + 0x40]
mov byte [eax + ecx - 1], 0xa
movzx ecx, byte [esi + 0x168]
jmp 0x56310b
mov edx, dword [esi + 0x13c]
test edx, edx
jne 0x5631f7
mov edx, 0x20000
sub edi, eax
cmp edi, edx
ja 0x563221
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 0x563289
mov ecx, 1
jmp 0x563289
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 0x563255
mov edi, dword [ebp - 0x1c]
mov esi, edx
mov ecx, 0xffffffff
jmp 0x563289
mov ecx, dword [edx + 0x13c]
test ecx, ecx
mov eax, dword [ebp - 0x10]
jne 0x563267
mov ecx, 0x20000
sub ebx, eax
add edi, eax
cmp ebx, ecx
jae 0x563277
mov esi, ebx
test ebx, ebx
jne 0x56327b
jmp 0x56327f
test ebx, ebx
je 0x56327f
test eax, eax
ja 0x56322e
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 0x5631bc
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 0x563331
mov eax, 0xffffffff
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
jmp 0x5632ff
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
jmp 0x563176