Function at 0x666717
Capabilities:
Check internet connectivity via wininet
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
cmp dword [ebp + 0xc], 0x1bb
push ebx
push esi
push edi
mov ebx, eax
je 0x666a9e
cmp dword [ebp + 0xc], 0x1bc
je 0x666a9e
cmp byte [ebx + 0x10f8], 0
jne 0x666a9e
xor edi, edi
push edi
lea eax, [ebp - 0x18]
push eax
mov dword [ebx + 8], edi
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test eax, eax
jne 0x666786
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x6f9628]
push eax
push str.WinInetRequest:_No_Internet_connection._Error__d_r_n
push 0xbfffffff
call fcn.00666d3d
add esp, 0xc
mov eax, 0x8ca
jmp 0x666ac2
push edi
push edi
push edi
push 1
push str.OSBundleInstall
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 4], eax
cmp eax, edi
jne 0x6667ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x6f9628]
mov ebx, eax
push ebx
push str.WinInetRequest:_Could_not_initialize_WinInet._Error__d_r_n
push 0xbfffffff
call fcn.00666d3d
add esp, 0xc
cmp ebx, edi
jne 0x6667c7
mov ebx, 0x8ca
mov eax, ebx
jmp 0x666ac2
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionA]
push 4
push 0x6f5884
push 2
push eax
call esi
test eax, eax
jne 0x666817
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x6f9628]
mov ebx, eax
push ebx
push str.WinInetRequest:_Unable_to_set_connection_timeout._Error__d_r_n
push 0xbfffffff
call fcn.00666d3d
add esp, 0xc
cmp ebx, edi
jne 0x666a90
mov ebx, 0x8ca
jmp 0x666a90
push 4
mov edi, 0x6f5f08
push edi
push 5
push dword [ebp - 4]
call esi
test eax, eax
jne 0x66684f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push str.WinInetRequest:_Unable_to_set_send_timeout._Error__d_r_n
mov esi, dword [0x6f9628]
push 0xbfffffff
call fcn.00666d3d
add esp, 0xc
test ebx, ebx
jmp 0x666807
push 4
push edi
push 6
push dword [ebp - 4]
call esi
test eax, eax
jne 0x66686d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push str.WinInetRequest:_Unable_to_set_receive_timeout._Error__d_r_n
jmp 0x666838
cmp dword [ebp + 0xc], 0x50
push dword [ebp + 0x10]
mov esi, dword [0x6f9628]
mov edi, 0xbfffffff
jne 0x666894
push dword [ebp + 8]
push str.WinInetRequest:_Opening_connection_to_http:___s__s_r_n
push edi
call fcn.00666d3d
add esp, 0x10
jmp 0x6668a8
push dword [ebp + 0xc]
push dword [ebp + 8]
push str.WinInetRequest:_Opening_connection_to_http:___s:_d__s_r_n
push edi
call fcn.00666d3d
add esp, 0x14
xor esi, esi
push esi
push esi
push 3
push esi
push esi
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.WININET.dll_InternetConnectA]
mov dword [ebp - 0x14], eax
cmp eax, esi
jne 0x6668eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x6f9628]
mov ebx, eax
push ebx
push dword [ebp + 8]
push str.WinInetRequest:_Could_not_open_connection_to__s._Error__d_r_n
push edi
call fcn.00666d3d
add esp, 0x10
jmp 0x66684b
push esi
push dword [ebp + 0x28]
push dword [ebp + 0x2c]
push esi
push str.HTTP_1.1
push dword [ebp + 0x10]
push dword [ebp + 0x14]
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov esi, dword [0x6f9628]
push str.WinInetRequest:_Sending_HTTP_request_r_n
push edi
mov dword [ebp + 0xc], eax
call fcn.00666d3d
pop ecx
pop ecx
push dword [ebp + 0x24]
push dword [ebp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp + 0xc]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x666947
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push str.WinInetRequest:_HttpSendRequest_failed._Error__d_r_n
jmp 0x6669e7
mov edx, dword [ebx + 8]
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
sub eax, edx
add ecx, edx
lea edx, [ebp - 8]
push edx
push eax
push ecx
push dword [ebp + 0xc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x666a01
push dword [ebp - 8]
mov esi, dword [0x6f9628]
push str.WinInetRequest:_Read__d_bytes_r_n
push edi
call fcn.00666d3d
mov eax, dword [ebp - 8]
mov ecx, dword [ebx + 4]
add dword [ebx + 8], eax
add esp, 0xc
sub ecx, dword [ebx + 8]
jne 0x666996
mov edx, ebx
call fcn.0040d083
mov eax, dword [ebx + 0x10fc]
test eax, eax
je 0x6669a7
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 8], 0
jne 0x666947
and dword [ebp - 0xc], 0
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x10]
push eax
lea esi, [ebx + 0xfb0]
push esi
push 0x20000013
push dword [ebp + 0xc]
mov dword [ebp - 0x10], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x666a11
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push str.WinInetRequest:_Unable_to_query_the_status_code._Error__d_r_n
mov esi, dword [0x6f9628]
push edi
call fcn.00666d3d
add esp, 0xc
test ebx, ebx
jne 0x666a78
mov ebx, 0x8ca
jmp 0x666a78
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push str.WinInetRequest:_Unable_to_read_internet_file._Error__d_r_n
jmp 0x6669e7
push dword [esi]
mov esi, dword [0x6f9628]
push str.WinInetRequest:_HTTP_status_code__d_r_n
push edi
call fcn.00666d3d
and dword [ebp - 0xc], 0
add esp, 0xc
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x10]
push eax
lea esi, [ebx + 0xfb8]
push esi
push 0x36
push dword [ebp + 0xc]
mov dword [ebp - 0x10], 0x40
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x666a6d
mov byte [esi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x6f9628]
push eax
push str.WinInetRequest:_Unable_to_query_ETAG._Error__d_r_n
push edi
call fcn.00666d3d
add esp, 0xc
mov eax, dword [ebx + 8]
mov ecx, dword [ebx]
mov byte [eax + ecx], 0
xor ebx, ebx
cmp dword [ebp + 0xc], 0
je 0x666a87
push dword [ebp + 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push dword [ebp - 0x14]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push dword [ebp - 4]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x6667c7
push dword [ebp + 0x2c]
push dword [ebp + 0x28]
push dword [ebp + 0x24]
push dword [ebp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push ebx
call fcn.006666ca
pop edi
pop esi
pop ebx
leave
ret 0x28