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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4483ce
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x8120
call fcn.00440af0
mov eax, dword [0x45a040]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 8]
xor ebx, ebx
push eax
mov dword [ebp - 4], ebx
lea eax, [ebp - 0x806c]
mov byte [ebp - 4], 1
call fcn.00402a50
lea eax, [ebp - 0x806c]
push eax
lea esi, [ebp - 0x8034]
mov byte [ebp - 4], 2
call fcn.00403c8d
xor eax, eax
mov dword [ebp - 0x8038], 7
mov dword [ebp - 0x803c], ebx
mov word [ebp - 0x804c], ax
push 3
mov esi, 0x44c894
push esi
lea ecx, [ebp - 0x8034]
mov byte [ebp - 4], 4
call fcn.004030e9
cmp eax, 0xffffffff
je 0x405119
push 3
push esi
xor eax, eax
lea ecx, [ebp - 0x8034]
call fcn.004030e9
add eax, 3
push eax
xor edi, edi
lea esi, [ebp - 0x8034]
call fcn.00402a7d
push 0x2f
pop edi
push 1
lea eax, [ebp - 0x80ac]
push eax
xor eax, eax
lea ecx, [ebp - 0x8034]
mov dword [ebp - 0x80ac], edi
call fcn.004030e9
cmp eax, 0xffffffff
je 0x4051e1
push 1
lea eax, [ebp - 0x80ac]
push eax
xor eax, eax
lea ecx, [ebp - 0x8034]
mov dword [ebp - 0x80ac], edi
call fcn.004030e9
lea ebx, [eax + 1]
push 0xffffffffffffffff
lea eax, [ebp - 0x8034]
push eax
lea esi, [ebp - 0x80d8]
call fcn.00402b1b
push 0xffffffffffffffff
lea ecx, [ebp - 0x8050]
push ecx
xor ebx, ebx
mov byte [ebp - 4], 5
call fcn.00403695
push ebx
push 1
mov byte [ebp - 4], 4
call fcn.004031f0
push 1
lea eax, [ebp - 0x80ac]
push eax
xor eax, eax
lea ecx, [ebp - 0x8034]
mov dword [ebp - 0x80ac], edi
call fcn.004030e9
push eax
lea eax, [ebp - 0x8034]
push eax
lea esi, [ebp - 0x8114]
call fcn.00402b1b
push 0xffffffffffffffff
lea ecx, [ebp - 0x8034]
push ecx
mov byte [ebp - 4], 6
call fcn.00403695
push ebx
push 1
mov byte [ebp - 4], 4
call fcn.004031f0
push ebx
cmp dword [ebp - 0x8020], ebx
jne 0x40520d
push 1
lea esi, [ebp - 0x8050]
call fcn.004031f0
push ebx
push 1
lea esi, [ebp - 0x8034]
call fcn.004031f0
push ebx
push 1
jmp 0x405757
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x80a8], eax
cmp eax, ebx
jne 0x405264
cmp dword [ebp + 0x10], ebx
je 0x405261
push 0x44c89c
lea ecx, [ebp - 0x80d8]
call fcn.00404a1b
lea eax, [ebp - 0x80d8]
push eax
push ebx
push ebx
push ebx
mov byte [ebp - 4], 7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp + 0x10]
call fcn.004063c4
push ebx
push 1
lea ecx, [ebp - 0x80d8]
call fcn.00404a7f
push ebx
jmp 0x4051ea
push 8
xor eax, eax
pop esi
mov dword [ebp - 0x80e0], ebx
lea edi, [ebp - 0x80dc]
stosd dword es:[edi], eax
lea eax, [ebp - 0x80f0]
push eax
lea eax, [ebp - 0x80e0]
push eax
push 0x32
push dword [ebp - 0x80a8]
mov dword [ebp - 0x80f0], esi
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
test eax, eax
je 0x4052c6
test byte [ebp - 0x80e0], 1
jne 0x4052c6
push esi
lea eax, [ebp - 0x80e0]
push eax
xor edi, edi
push 0x32
push dword [ebp - 0x80a8]
inc edi
mov dword [ebp - 0x80e0], edi
call dword [sym.imp.WININET.dll_InternetSetOptionW]
jmp 0x4052c9
xor edi, edi
inc edi
mov eax, dword [ebp - 0x8030]
cmp dword [ebp - 0x801c], esi
jae 0x4052dd
lea eax, [ebp - 0x8030]
push ebx
push ebx
push 3
push ebx
push ebx
push 0x50
push eax
push dword [ebp - 0x80a8]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov esi, eax
mov dword [ebp - 0x80ac], esi
cmp esi, ebx
jne 0x405352
push dword [ebp - 0x80a8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp + 0x10], ebx
je 0x40573b
push 0x44c89c
lea ecx, [ebp - 0x80d8]
call fcn.00404a1b
mov byte [ebp - 4], 8
lea eax, [ebp - 0x80d8]
push eax
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp + 0x10]
call fcn.004063c4
push ebx
push edi
lea ecx, [ebp - 0x80d8]
call fcn.00404a7f
jmp 0x40573b
push ebx
call dword [sym.imp.WININET.dll_InternetAttemptConnect]
test eax, eax
je 0x40538d
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push dword [ebp - 0x80a8]
call esi
cmp dword [ebp + 0x10], ebx
je 0x40573b
push 0x44c89c
lea ecx, [ebp - 0x80d8]
call fcn.00404a1b
mov byte [ebp - 4], 9
jmp 0x405327
mov dword [ebp - 0x80f8], 0x44c8a0
mov dword [ebp - 0x80f4], ebx
cmp dword [ebp - 0x803c], ebx
jbe 0x4053be
cmp dword [ebp - 0x8038], 8
jb 0x4053b6
mov eax, dword [ebp - 0x804c]
jmp 0x4053c0
lea eax, [ebp - 0x804c]
jmp 0x4053c0
xor eax, eax
push ebx
push 0x84400000
lea ecx, [ebp - 0x80f8]
push ecx
push ebx
push str.HTTP_1.1
push eax
push 0x44c8bc
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp - 0x80b4], eax
cmp eax, ebx
jne 0x40541d
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push dword [ebp - 0x80a8]
call esi
cmp dword [ebp + 0x10], ebx
je 0x40573b
push 0x44c89c
lea ecx, [ebp - 0x80d8]
call fcn.00404a1b
mov byte [ebp - 4], 0xa
jmp 0x405327
push str.Host
lea eax, [ebp - 0x8130]
call fcn.00402a50
push 0x44c8c4
push eax
lea eax, [ebp - 0x8114]
push eax
mov byte [ebp - 4], 0xb
call fcn.00404177
add esp, 0xc
lea ecx, [ebp - 0x8034]
push ecx
push eax
lea eax, [ebp - 0x80a4]
push eax
mov byte [ebp - 4], 0xc
call fcn.004041bd
add esp, 0xc
push ebx
push edi
lea esi, [ebp - 0x8114]
call fcn.004031f0
push ebx
push edi
lea esi, [ebp - 0x8130]
mov byte [ebp - 4], 0xf
call fcn.004031f0
cmp dword [ebp - 0x808c], 8
mov eax, dword [ebp - 0x80a0]
jae 0x405494
lea eax, [ebp - 0x80a0]
mov esi, dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
mov edi, 0x20000000
push edi
push 0xffffffffffffffff
push eax
push dword [ebp - 0x80b4]
call esi
push edi
mov edi, dword [ebp - 0x80b4]
push 0xffffffffffffffff
push str.Content_Length:_0
push edi
call esi
push ebx
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x40552c
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
push dword [ebp - 0x80ac]
call esi
push dword [ebp - 0x80a8]
call esi
cmp dword [ebp + 0x10], ebx
je 0x405524
push 0x44c89c
lea ecx, [ebp - 0x80d8]
call fcn.00404a1b
lea eax, [ebp - 0x80d8]
push eax
push ebx
push ebx
push ebx
mov byte [ebp - 4], 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp + 0x10]
call fcn.004063c4
push ebx
push 1
lea ecx, [ebp - 0x80d8]
call fcn.00404a7f
xor edi, edi
inc edi
jmp 0x40572e
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
lea eax, [ebp - 0x80e4]
push eax
lea eax, [ebp - 0x80b0]
push eax
lea eax, [ebp - 0x80b8]
push eax
push 0x20000013
push edi
mov dword [ebp - 0x80b8], ebx
mov dword [ebp - 0x80e8], ebx
mov dword [ebp - 0x80e4], ebx
mov dword [ebp - 0x80b0], 4
call esi
lea eax, [ebp - 0x80e4]
push eax
lea eax, [ebp - 0x80b0]
push eax
lea eax, [ebp - 0x80e8]
push eax
push 0x20000005
push edi
call esi
push 0xf
pop edi
push ebx
lea ecx, [ebp - 0x8088]
mov dword [ebp - 0x80bc], ebx
mov dword [ebp - 0x80b0], ebx
mov dword [ebp - 0x8070], edi
call fcn.00404a63
mov esi, 0x8000
push esi
lea eax, [ebp - 0x8018]
push ebx
push eax
mov byte [ebp - 4], 0x11
call fcn.00437340
add esp, 0xc
lea eax, [ebp - 0x80b0]
push eax
push esi
lea eax, [ebp - 0x8018]
push eax
push dword [ebp - 0x80b4]
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, ebx
je 0x40568d
cmp dword [ebp - 0x80b0], ebx
jbe 0x4056d4
push dword [ebp - 0x80b0]
lea eax, [ebp - 0x8018]
push eax
lea eax, [ebp - 0x8088]
call fcn.00405a1f
mov eax, dword [ebp - 0x80b0]
add dword [ebp - 0x80bc], eax
cmp byte [ebp + 0xc], bl
je 0x4055c3
cmp dword [ebp + 0x10], ebx
je 0x4055c3
push ebx
lea ecx, [ebp - 0x80d8]
mov dword [ebp - 0x80ec], eax
mov dword [ebp - 0x80c0], edi
call fcn.00404a63
push dword [ebp - 0x80ec]
lea eax, [ebp - 0x8018]
push eax
lea ecx, [ebp - 0x80d8]
call fcn.00404986
lea eax, [ebp - 0x80d8]
push eax
push dword [ebp - 0x80bc]
mov byte [ebp - 4], 0x12
push dword [ebp - 0x80e8]
lea ecx, [ebp + 0x10]
push dword [ebp - 0x80b8]
push ebx
call fcn.004063c4
push ebx
push 1
lea ecx, [ebp - 0x80d8]
mov byte [ebp - 4], 0x11
call fcn.00404a7f
jmp 0x4055c3
cmp dword [ebp + 0x10], ebx
je 0x405700
push 0x44c89c
lea ecx, [ebp - 0x80d8]
call fcn.00404a1b
lea eax, [ebp - 0x80d8]
push eax
push ebx
push ebx
mov byte [ebp - 4], 0x13
push dword [ebp - 0x80b8]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp + 0x10]
call fcn.004063c4
push ebx
push 1
lea ecx, [ebp - 0x80d8]
call fcn.00404a7f
jmp 0x405700
cmp byte [ebp + 0xc], bl
jne 0x405700
cmp dword [ebp + 0x10], ebx
je 0x405700
lea eax, [ebp - 0x8088]
push eax
push dword [ebp - 0x8074]
lea ecx, [ebp + 0x10]
push dword [ebp - 0x8074]
push dword [ebp - 0x80b8]
push ebx
call fcn.004063c4
push dword [ebp - 0x80b4]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push dword [ebp - 0x80ac]
call esi
push dword [ebp - 0x80a8]
call esi
xor edi, edi
push ebx
inc edi
push edi
lea ecx, [ebp - 0x8088]
call fcn.00404a7f
push ebx
push edi
lea esi, [ebp - 0x80a4]
call fcn.004031f0
push ebx
push edi
lea esi, [ebp - 0x8050]
call fcn.004031f0
push ebx
push edi
lea esi, [ebp - 0x8034]
call fcn.004031f0
push ebx
push edi
lea esi, [ebp - 0x806c]
call fcn.004031f0
or dword [ebp - 4], 0xffffffff
lea esi, [ebp + 0x10]
call fcn.00403330
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0043465f
leave
ret 0x28