Function at 0x5a5520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x14], esi
test esi, esi
je 0x5a5762
push esi
call fcn.005a7450
add esp, 4
test eax, eax
je 0x5a5762
mov eax, dword [esi]
push ebx
xor ebx, ebx
push edi
cmp eax, 1
jne 0x5a55ee
mov eax, dword [esi + 4]
mov ebx, 1
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], ebx
cmp dword [ebp + 8], ebx
jle 0x5a5759
lea edi, [ebp + 0x18]
nop
cmp dword [edi + 8], 0x80000004
mov dword [ebp - 4], 0
jne 0x5a5584
mov esi, dword [edi]
jmp 0x5a559a
push edi
call fcn.005a7480
mov esi, eax
add esp, 4
test esi, esi
je 0x5a55d6
mov dword [ebp - 4], 1
push esi
call dword [0x652770]
add esp, 4
test eax, eax
jle 0x5a55bf
push 0
lea ecx, [ebp - 0x14]
push ecx
push eax
push esi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
and ebx, eax
cmp dword [ebp - 4], 0
je 0x5a55ce
push esi
call fcn.005ac096
add esp, 4
test ebx, ebx
je 0x5a5759
mov eax, dword [ebp - 8]
add edi, 0xc
inc eax
mov dword [ebp - 8], eax
cmp eax, dword [ebp + 8]
jl 0x5a5570
pop edi
mov eax, ebx
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x5a5687
mov eax, dword [esi + 4]
mov ebx, 1
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], ebx
cmp eax, ebx
jle 0x5a5759
mov ebx, dword [ebp - 0x10]
lea edi, [ebp + 0x18]
dec eax
mov dword [ebp - 4], eax
nop word [eax + eax]
cmp dword [edi + 8], 0x80000004
mov dword [ebp - 8], 0
jne 0x5a5634
mov esi, dword [edi]
jmp 0x5a564a
push edi
call fcn.005a7480
mov esi, eax
add esp, 4
test esi, esi
je 0x5a5672
mov dword [ebp - 8], 1
push esi
call dword [0x652770]
mov ecx, eax
add esp, 4
test ecx, ecx
jle 0x5a5663
mov eax, dword [ebx]
push ecx
push esi
mov ecx, ebx
call dword [eax + 0x24]
cmp dword [ebp - 8], 0
je 0x5a5672
push esi
call fcn.005ac096
add esp, 4
add edi, 0xc
sub dword [ebp - 4], 1
jne 0x5a5620
mov ebx, dword [ebp - 0xc]
mov eax, ebx
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
cmp eax, 3
jne 0x5a5759
mov eax, dword [esi + 4]
mov ebx, 1
mov dword [ebp - 4], eax
mov dword [ebp - 0x10], ebx
cmp dword [ebp + 8], ebx
jle 0x5a5759
lea edi, [ebp + 0x18]
nop word [eax + eax]
cmp dword [edi + 8], 0x80000004
mov dword [ebp - 0xc], 0
jne 0x5a56c4
mov esi, dword [edi]
jmp 0x5a56da
push edi
call fcn.005a7480
mov esi, eax
add esp, 4
test esi, esi
je 0x5a5746
mov dword [ebp - 0xc], 1
push esi
call dword [0x652770]
add esp, 4
mov dword [ebp - 8], eax
test eax, eax
jle 0x5a5733
push 1
push 0
push 0
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp - 0x14]
mov ecx, eax
lea eax, [edx + 0xc]
push eax
push dword [edx + 0x130]
lea eax, [edx + 0x2c]
push eax
push dword [ebp - 8]
push esi
push ecx
call fcn.005a6140
add esp, 0x18
lea eax, [ebp - 0x18]
push 0
push eax
push dword [ebp - 8]
push esi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
and ebx, eax
cmp dword [ebp - 0xc], 0
je 0x5a5742
push esi
call fcn.005ac096
add esp, 4
test ebx, ebx
je 0x5a5759
mov eax, dword [ebp - 0x10]
add edi, 0xc
inc eax
mov dword [ebp - 0x10], eax
cmp eax, dword [ebp + 8]
jl 0x5a56b0
pop edi
mov eax, ebx
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret