Function at 0x4064db
Capabilities:
Check http status code
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
mov eax, 0x4028
call fcn.00420c50
mov eax, dword [0x48e104]
xor eax, esp
mov dword [esp + 0x4024], eax
mov eax, dword [esp + 0x4030]
push ebx
push esi
mov esi, dword [esp + 0x4034]
push edi
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.DLL_GetTickCount]
mov dword [esp + 0x2c], eax
xor eax, eax
push 0x32
inc eax
pop edi
mov dword [esp + 0x1c], eax
mov byte [0x495970], al
xor eax, eax
push eax
push eax
push eax
push eax
push str.SpotifyInstaller_1.0
mov ebx, eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x28], eax
test eax, eax
jne 0x406549
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ebx, eax
jmp 0x40669f
push ebp
xor ecx, ecx
push ecx
push 0x80000200
push ecx
push ecx
push esi
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov ebp, eax
test ebp, ebp
jne 0x406572
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push 0x34
mov ebx, eax
pop edi
jmp 0x406694
and dword [esp + 0x18], ebx
lea eax, [esp + 0x10]
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push 0
push eax
lea eax, [esp + 0x20]
mov dword [esp + 0x18], 4
push eax
push 0x20000005
push ebp
call esi
and dword [esp + 0x1c], ebx
lea eax, [esp + 0x10]
push 0
push eax
lea eax, [esp + 0x24]
mov dword [esp + 0x18], 4
push eax
push 0x20000013
push ebp
call esi
cmp dword [esp + 0x1c], 0xc8
je 0x4065c9
push 0x33
jmp 0x40668c
mov eax, dword [esp + 0x18]
and dword [0x48e034], ebx
xor esi, esi
mov dword [0x49596c], eax
mov dword [0x48e030], eax
mov dword [0x495968], ebx
jmp 0x40667e
push 0x49597c
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
push 0x49597c
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
lea eax, [esp + 0x14]
push eax
push 0x4000
lea eax, [esp + 0x3c]
push eax
push ebp
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4066fa
mov eax, dword [esp + 0x14]
cmp byte [esp + 0x20], bl
je 0x406647
mov byte [esp + 0x20], bl
cmp eax, 2
jb 0x406647
cmp byte [esp + 0x34], 0x4d
jne 0x4066dc
cmp byte [esp + 0x35], 0x5a
jne 0x4066dc
test eax, eax
je 0x4066ec
push 0
lea ecx, [esp + 0x2c]
push ecx
push eax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x34]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x4066e0
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x28], eax
jne 0x4066e8
add dword [0x495968], eax
add esi, dword [esp + 0x14]
cmp byte [0x495950], bl
je 0x4065ea
push 0x13
pop edi
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push dword [esp + 0x2c]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop ebp
call dword [sym.imp.KERNEL32.DLL_GetTickCount]
sub eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x4030]
and dword [0x48e02c], 0
and dword [0x48e044], 0
mov dword [0x48e028], eax
mov eax, edi
pop edi
pop esi
mov dword [0x48e040], ebx
pop ebx
xor ecx, esp
call fcn.00420802
add esp, 0x4028
ret
push 0x36
jmp 0x40668c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ebx, eax
push 0xb
jmp 0x40668c
xor eax, eax
cmp esi, dword [esp + 0x18]
push 0x36
pop edi
cmove edi, eax
jmp 0x40668d
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ebx, eax
jmp 0x40668d