Function at 0x658bd82e
Capabilities:
Check internet connectivity via wininet
Create http request
Get http content length
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov eax, 0x2a9c
call fcn.658e8060
mov eax, dword [ebp + 0x10]
mov byte [ebp - 0x19], al
mov dword [ebp - 0x2a04], 0x658db3c0
mov dword [ebp - 0x2a00], 0x65930040
lea eax, [ebp - 0x29fc]
lea edx, [ebp - 0x18]
mov dword [eax], edx
mov edx, 0x658be01f
mov dword [eax + 4], edx
mov dword [eax + 8], esp
lea eax, [ebp - 0x2a1c]
mov dword [esp], eax
call fcn.658e7610
lea eax, [ebp - 0x128]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 0xffffffff
call fcn.659188a8
mov dword [ebp - 0x2944], 0
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.658be350
test al, al
jne 0x658bd95a
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a24], eax
mov dword [esp + 4], str.URL_is_not_http_
mov eax, dword [ebp - 0x2a24]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 8
call fcn.658f012c
jmp 0x658bd932
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov eax, dword [ebp - 0x2a24]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
lea eax, [ebp - 0x128]
mov dword [esp + 8], eax
movzx eax, byte [ebp - 0x19]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.658be198
mov dword [ebp - 0x2930], eax
mov dword [esp], 0
call sub.WININET.DLL_InternetAttemptConnect
sub esp, 4
test eax, eax
je 0x658bda3d
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a38], eax
mov dword [esp + 4], str.internet_connection_is_not_available.
mov edx, dword [ebp - 0x2a38]
mov dword [esp], edx
mov dword [ebp - 0x2a18], 7
call fcn.658f012c
jmp 0x658bda15
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov edx, dword [ebp - 0x2a38]
mov dword [esp], edx
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], str.Tibiantis_Client
mov dword [ebp - 0x2a18], 9
call sub.WININET.DLL_InternetOpenA
sub esp, 0x14
mov dword [ebp - 0x2938], eax
cmp dword [ebp - 0x2938], 0
jne 0x658bdb28
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a44], eax
mov dword [esp + 4], str.failed_to_open_internet_connetion.
mov eax, dword [ebp - 0x2a44]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 6
call fcn.658f012c
jmp 0x658bdb00
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov eax, dword [ebp - 0x2a44]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
mov eax, dword [ebp - 0x2930]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Range:bytes_d_
lea eax, [ebp - 0x2998]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call sub.msvcrt.dll_sprintf
lea eax, [ebp - 0x2998]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0x4000000
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2998]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2938]
mov dword [esp], eax
call sub.WININET.DLL_InternetOpenUrlA
sub esp, 0x18
mov dword [ebp - 0x2934], eax
cmp dword [ebp - 0x2934], 0
jne 0x658bdc48
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a50], eax
mov dword [esp + 4], str.failed_to_open_URL.
mov edx, dword [ebp - 0x2a50]
mov dword [esp], edx
mov dword [ebp - 0x2a18], 5
call fcn.658f012c
jmp 0x658bdc20
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov edx, dword [ebp - 0x2a50]
mov dword [esp], edx
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
mov dword [ebp - 0x2940], 4
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x2940]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x293c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x20000005
mov eax, dword [ebp - 0x2934]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call sub.WININET.DLL_HttpQueryInfoA
sub esp, 0x14
test eax, eax
jne 0x658bdd38
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a5c], eax
mov dword [esp + 4], str.failed_to_get_content_length.
mov eax, dword [ebp - 0x2a5c]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 4
call fcn.658f012c
jmp 0x658bdd10
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov eax, dword [ebp - 0x2a5c]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
mov eax, dword [ebp - 0x2930]
cmp eax, dword [ebp - 0x293c]
je 0x658bdf76
cmp dword [ebp - 0x293c], 0
je 0x658bdf76
lea eax, [ebp - 0x292c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x2800
lea eax, [ebp - 0x2928]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2934]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call sub.WININET.DLL_InternetReadFile
sub esp, 0x10
test eax, eax
jne 0x658bde35
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a68], eax
mov dword [esp + 4], str.error_occurred_during_download.
mov edx, dword [ebp - 0x2a68]
mov dword [esp], edx
mov dword [ebp - 0x2a18], 3
call fcn.658f012c
jmp 0x658bde0d
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov edx, dword [ebp - 0x2a68]
mov dword [esp], edx
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
mov eax, dword [ebp - 0x292c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x2928]
mov dword [esp + 4], eax
lea eax, [ebp - 0x128]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.6590d698
lea eax, [ebp - 0x128]
add eax, 0x70
mov dword [esp], eax
call fcn.659035b4
test al, al
jne 0x658bdf19
mov dword [esp], 0x50
call fcn.658e16e0
mov dword [ebp - 0x2a74], eax
mov dword [esp + 4], str.error_occurred_while_writing_file.
mov eax, dword [ebp - 0x2a74]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 2
call fcn.658f012c
jmp 0x658bdef1
mov dword [esp + 8], 0
mov dword [esp + 4], 0x65937630
mov eax, dword [ebp - 0x2a74]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 9
call fcn.658dc930
mov edx, dword [ebp - 0x292c]
lea eax, [ebp - 0x2944]
add dword [eax], edx
cmp dword [ebp + 0x14], 0
je 0x658bdf64
cmp dword [ebp - 0x292c], 0
je 0x658bdf64
mov eax, dword [ebp - 0x2930]
add eax, dword [ebp - 0x2944]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2930]
add eax, dword [ebp - 0x293c]
mov dword [esp], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x2a18], 9
call eax
cmp dword [ebp - 0x292c], 0
je 0x658be0d6
jmp 0x658bdd57
cmp dword [ebp + 0x14], 0
je 0x658be0d6
mov eax, dword [ebp - 0x2930]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2930]
mov dword [esp], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x2a18], 9
call eax
jmp 0x658be0d6
lea eax, [ebp - 0x128]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 0xa
call fcn.65918618
mov eax, dword [ebp - 0x2934]
mov dword [esp], eax
call sub.WININET.DLL_InternetCloseHandle
sub esp, 4
mov eax, dword [ebp - 0x2938]
mov dword [esp], eax
call sub.WININET.DLL_InternetCloseHandle
sub esp, 4
lea eax, [ebp - 0x128]
mov dword [esp], eax
mov dword [ebp - 0x2a18], 0xffffffff
call fcn.65918d78
mov dword [ebp - 0x2a20], 1
jmp 0x658be17c
lea eax, [ebp - 0x2a1c]
mov dword [esp], eax
call fcn.658e76f0
mov eax, dword [ebp - 0x2a20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret