Function at 0x59de20
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x10]
mov dword [ebp - 0x18], ecx
cmp dword [ebp - 0x18], 0
je 0x59e0d2
cmp dword [ebp - 0x18], 1
je 0x59de5d
cmp dword [ebp - 0x18], 2
je 0x59e007
jmp 0x59e0d6
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x1c]
add eax, dword [ebp + 0xc]
cmp eax, 0x10000
ja 0x59dea9
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
mov edi, dword [edx + 0x18]
mov eax, dword [ebp - 0x14]
add edi, dword [eax + 0x1c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x1c]
add ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x14]
mov dword [edx + 0x1c], ecx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov dword [eax], ecx
jmp 0x59e0dd
mov edx, dword [ebp - 0x14]
cmp dword [edx + 0x1c], 0x10000
je 0x59debe
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0x1c], 0
jne 0x59dec6
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xc], ecx
jmp 0x59df00
mov edx, dword [ebp - 0x14]
mov ecx, 0x10000
sub ecx, dword [edx + 0x1c]
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 0x14]
mov edi, dword [eax + 0x18]
mov edx, dword [ebp - 0x14]
add edi, dword [edx + 0x1c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 8]
add ecx, 0x10000
mov edx, dword [ebp - 0x14]
sub ecx, dword [edx + 0x1c]
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0x1c], 0
je 0x59df62
push 0
mov ecx, dword [ebp + 0x10]
push ecx
push 0x10000
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x18]
push eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx]
push edx
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x59df35
mov eax, 0x80004005
jmp 0x59e0df
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x20]
add ecx, 0x10000
mov edx, dword [ebp - 0x14]
mov dword [edx + 0x20], ecx
mov eax, dword [ebp - 0x14]
mov ecx, 0x10000
sub ecx, dword [eax + 0x1c]
add ecx, dword [ebp - 4]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 0x14]
mov dword [edx + 0x1c], 0
mov eax, dword [ebp + 0xc]
sub eax, dword [ebp - 4]
shr eax, 0x10
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x59dfc9
push 0
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x10]
shl edx, 0x10
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx]
push edx
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x59df9f
mov eax, 0x80004005
jmp 0x59e0df
mov eax, dword [ebp - 0x10]
shl eax, 0x10
mov ecx, dword [ebp - 0x14]
add eax, dword [ecx + 0x20]
mov edx, dword [ebp - 0x14]
mov dword [edx + 0x20], eax
mov eax, dword [ebp - 0x10]
shl eax, 0x10
add eax, dword [ebp - 4]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x10]
shl ecx, 0x10
add ecx, dword [ebp - 0xc]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 4]
cmp edx, dword [ebp + 0xc]
jae 0x59dffa
mov ecx, dword [ebp + 0xc]
sub ecx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
mov edi, dword [eax + 0x18]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0xc]
sub eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x14]
mov dword [ecx + 0x1c], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
mov dword [edx], eax
jmp 0x59e0dd
mov ecx, dword [ebp - 0x14]
mov esi, dword [ebp + 0xc]
add esi, dword [ecx + 0x20]
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x14]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x14]
mov eax, dword [eax]
push edx
call dword [eax + 0x10]
cmp esi, eax
jbe 0x59e089
mov ecx, dword [ebp - 0x14]
mov esi, dword [ebp + 0xc]
add esi, dword [ecx + 0x20]
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x14]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x14]
mov eax, dword [eax]
push edx
call dword [eax + 0x10]
shl eax, 1
cmp esi, eax
jbe 0x59e055
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
add edx, dword [ecx + 0x20]
mov dword [ebp - 0x1c], edx
jmp 0x59e06c
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x14]
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x14]
mov ecx, dword [ecx]
push eax
call dword [ecx + 0x10]
shl eax, 1
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x14]
call fcn.005d17f0
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jge 0x59e089
mov eax, dword [ebp - 8]
jmp 0x59e0df
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x14]
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x14]
mov edx, dword [edx]
push ecx
call dword [edx + 0xc]
mov ecx, dword [ebp - 0x14]
add eax, dword [ecx + 0x20]
mov edi, eax
mov ecx, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov dword [eax], ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x20]
add eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x14]
mov dword [ecx + 0x20], eax
jmp 0x59e0dd
xor eax, eax
jmp 0x59e0df
mov eax, 0x80004005
jmp 0x59e0df
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc