Function at 0x10005964
Capabilities:
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
call fcn.10013fc0
mov edi, eax
movzx eax, byte [0x10072e44]
push eax
call fcn.10013fd0
mov ecx, dword [0x10070450]
xor ebx, ebx
mov dword [ecx + 0x2a24], ebx
mov edx, dword [0x10070450]
mov ecx, dword [ebp + 8]
mov dword [edx + 0x2a28], ebx
mov dword [ebp - 0xc], eax
mov eax, dword [0x10070450]
mov esi, 1
push ecx
mov dword [eax + 0x1110], esi
mov dword [ebp - 8], ebx
call fcn.100056d0
add esp, 8
test eax, eax
je 0x100057e0
mov dword [ebp - 8], esi
mov eax, dword [0x10070450]
cmp dword [eax + 0x2a20], ebx
je case.0x1000584c.0
mov edx, dword [eax + 0x2a20]
push edx
call fcn.1003c82b
mov eax, dword [0x10070450]
add esp, 4
mov dword [eax + 0x2a20], ebx
jmp case.0x1000584c.0
xor ebx, ebx
mov ecx, dword [0x10077fb0]
cmp byte [ecx + 0xa69], 0
jne 0x10005b5f
call fcn.10004fe0
mov dword [ebp - 4], eax
cmp dword [ebp - 8], ebx
je 0x1000583c
mov dword [ebp - 4], 0x63
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 4]
inc eax
cmp eax, 0x64
ja case.0x1000584c.0
movzx edx, byte [eax + 0x10005c0c]
jmp dword [edx*4 + 0x10005bfc]
mov eax, dword [0x10070450]
cmp dword [eax + 0x2a20], ebx
je 0x10005880
mov eax, dword [eax + 0x2a20]
push eax
call fcn.1003c82b
mov ecx, dword [0x10070450]
mov dword [ecx + 0x2a20], ebx
mov eax, dword [0x10070450]
add esp, 4
mov esi, 2
mov dword [eax + 0x1110], 1
nop
mov edx, dword [0x10077fb0]
cmp byte [edx + 0xa69], 0
jne 0x100058f4
xor eax, eax
cmp dword [ebp - 4], 0x63
sete al
push eax
call fcn.10005550
add esp, 4
test eax, eax
jne 0x100058f4
mov ecx, dword [ebp + 8]
push ecx
call fcn.100056d0
mov esi, eax
add esp, 4
test esi, esi
je 0x10005810
cmp esi, 1
je 0x100058f4
cmp esi, 3
jne 0x100058e3
push 0
call fcn.10005550
add esp, 4
test eax, eax
jne 0x100058fc
push 0xfa0
call dword [sym.imp.kernel32.dll_Sleep]
inc ebx
cmp ebx, 0xa
jl 0x10005890
test esi, esi
je 0x10005810
mov eax, dword [0x10070450]
mov ecx, dword [eax + 0x1108]
push ecx
push 0x879
call fcn.1000a040
add esp, 4
push eax
push 0
push 2
call fcn.10009dd0
add esp, 0x10
or esi, 0xffffffff
xor ebx, ebx
mov eax, dword [0x10070450]
cmp dword [eax + 0x2a20], ebx
je 0x1000594e
mov edx, dword [eax + 0x2a20]
push edx
call fcn.1003c82b
mov eax, dword [0x10070450]
add esp, 4
mov dword [eax + 0x2a20], ebx
push ebx
call dword [sym.imp.kernel32.dll_Sleep]
xor eax, eax
pop edi
cmp esi, 0x58
pop esi
sete al
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 8]
mov edx, dword [edi + 4]
mov ecx, dword [edi]
push ebx
sub edx, eax
push edx
mov edx, dword [ebp - 0xc]
add ecx, eax
mov eax, dword [edx + 0x18]
push ecx
push eax
call dword [sym.imp.ws2_32.dll_recv]
mov esi, eax
cmp esi, ebx
je 0x10005b3f
cmp esi, 0xffffffff
je 0x10005b5f
mov eax, dword [edi + 4]
add dword [edi + 8], esi
cmp dword [edi + 8], eax
jb 0x100059a2
dec eax
mov dword [edi + 8], eax
mov ecx, dword [edi]
mov edx, dword [edi + 8]
mov byte [ecx + edx], 0
mov eax, dword [0x10070450]
test byte [eax + 0x1110], 1
mov ecx, dword [edi]
mov dword [ebp - 4], ecx
je 0x10005a22
mov eax, dword [edi + 8]
lea edx, [ebp - 4]
push edx
call fcn.10005380
mov esi, eax
add esp, 4
cmp esi, 0xffffffff
je 0x10005b49
cmp esi, 0xfffffffe
je case.0x1000584c.0
mov eax, dword [edi + 8]
mov ecx, dword [edi]
push eax
call fcn.100053d0
mov ecx, dword [0x10070450]
mov dword [ecx + 0x1114], eax
mov eax, dword [0x10070450]
add esp, 4
cmp dword [eax + 0x1114], ebx
jbe 0x10005b67
mov dword [eax + 0x1110], 2
cmp esi, ebx
jne 0x10005a22
mov dword [edi + 8], ebx
jmp case.0x1000584c.0
mov ecx, dword [0x10070450]
mov eax, dword [ecx + 0x1110]
test al, 2
je case.0x1000584c.0
cmp dword [ecx + 0x29f0], ebx
jne 0x10005bec
test al, 4
jne 0x10005a87
mov ebx, dword [ebp + 0xc]
push 0x80
push ebx
call dword [sym.imp.kernel32.dll_SetFileAttributesA]
push 0x40
push 0x10057f3c
push ebx
call fcn.1003c89f
mov edx, dword [0x10070450]
add esp, 0xc
mov dword [edx + 0x2a20], eax
test eax, eax
je 0x10005b85
mov eax, dword [0x10070450]
or dword [eax + 0x1110], 4
xor ebx, ebx
mov eax, dword [0x10070450]
mov ecx, dword [eax + 0x2a20]
mov edx, dword [ebp - 4]
push ecx
push 1
push esi
push edx
call fcn.1003cde9
mov eax, dword [0x10070450]
add dword [eax + 0x1118], esi
mov dword [edi + 8], ebx
mov eax, dword [0x10070450]
mov ecx, dword [eax + 0x1120]
add esp, 0x10
or ecx, dword [eax + 0x1124]
je 0x10005b1b
mov edx, dword [eax + 0x1118]
fild dword [eax + 0x1118]
test edx, edx
jns 0x10005ad9
fadd dword [0x10057f38]
mov eax, dword [eax + 0x1114]
mov dword [ebp - 0x10], eax
fild dword [ebp - 0x10]
test eax, eax
jns 0x10005aef
fadd dword [0x10057f38]
fdivp st(1)
fmul qword [0x10057f30]
fnstcw word [ebp - 2]
movzx eax, word [ebp - 2]
or eax, 0xc00
mov dword [ebp - 0x10], eax
fldcw word [ebp - 0x10]
fistp qword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
push ecx
fldcw word [ebp - 2]
call fcn.10010210
add esp, 4
mov ecx, dword [0x10070450]
mov edx, dword [ecx + 0x1118]
cmp edx, dword [ecx + 0x1114]
jae 0x10005bbf
push ebx
call dword [sym.imp.kernel32.dll_Sleep]
jmp case.0x1000584c.0
mov esi, 0x58
jmp 0x10005927
push 0x87d
call fcn.1000a040
push eax
push ebx
push 2
call fcn.10009dd0
add esp, 0x10
or esi, 0xffffffff
jmp 0x10005927
push 0x87e
call fcn.1000a040
push eax
push ebx
push 2
call fcn.10009dd0
add esp, 0x10
or esi, 0xffffffff
jmp 0x10005927
mov edx, dword [0x10070450]
mov eax, dword [edx + 0x1108]
push eax
push 0x87c
call fcn.1000a040
add esp, 4
push eax
push 0x10
call fcn.10010b30
mov ecx, dword [0x10070450]
add esp, 0xc
mov dword [ecx + 0x2a28], 0xfffffffe
jmp 0x10005922
mov edx, dword [ecx + 0x1120]
or edx, dword [ecx + 0x1124]
mov esi, 0x58
je 0x10005927
lea eax, [ecx + 0x1128]
mov ecx, dword [ecx + 0x1118]
add dword [eax], ecx
adc dword [eax + 4], ebx
jmp 0x10005927
mov eax, dword [ebp - 4]
call fcn.100054e0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret