Function at 0x599ad4
Capabilities:
Check http status code
Check internet connectivity via wininet
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x11
push 0
push 0
dec ecx
jne 0x599adc
push ecx
push ebx
push esi
push edi
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x14]
call fcn.00405164
xor eax, eax
push ebp
push 0x59a248
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x2d], 0
mov eax, dword [ebp - 0x10]
mov byte [eax + 5], 0
xor eax, eax
mov dword [ebp - 0x54], eax
lea ecx, [ebp - 0x5c]
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
call fcn.0059a3e4
mov ecx, dword [ebp - 0x5c]
lea eax, [ebp - 0x50]
mov edx, 0x59a260
call fcn.00404fc0
lea eax, [ebp - 0x18]
mov edx, 0x59a274
call fcn.00404d4c
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x1c]
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
call fcn.00599938
mov byte [ebp - 0x55], 1
mov eax, dword [ebp - 0x10]
cmp byte [eax + 4], 0
je 0x599b92
mov eax, dword [0x5a80a4]
cmp byte [eax], 0
jne 0x599b92
push 0
push 1
lea eax, [ebp - 0x60]
mov ecx, dword [ebp - 0x1c]
mov edx, 0x59a2c8
call fcn.00404fc0
mov eax, dword [ebp - 0x60]
call fcn.00405174
push eax
call sub.wininet.dll_InternetCheckConnectionA
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x55], al
mov eax, dword [ebp - 0x10]
mov byte [eax + 0xc], 0
jmp 0x59a1bb
push ebp
call fcn.00599a78
pop ecx
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x18], 0
jle 0x599bc0
inc dword [ebp - 0x54]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
cmp eax, dword [ebp - 0x54]
jl 0x59a1ce
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0xc], 0
jne 0x59a1ce
mov eax, dword [0x5a80a4]
cmp byte [eax], 0
je 0x599c2d
push 0
push 0
lea eax, [ebp - 0x64]
push eax
mov eax, dword [0x5a80a4]
mov eax, dword [eax + 4]
mov dword [ebp - 0x74], eax
mov byte [ebp - 0x70], 0xb
mov eax, dword [0x5a80a4]
mov eax, dword [eax + 8]
mov dword [ebp - 0x6c], eax
mov byte [ebp - 0x68], 0
lea edx, [ebp - 0x74]
mov ecx, 1
mov eax, 0x59a2d8
call fcn.0040d808
mov eax, dword [ebp - 0x64]
call fcn.00405174
push eax
push 3
mov eax, dword [ebp - 0x18]
call fcn.00405174
push eax
call sub.wininet.dll_InternetOpenA
mov dword [ebp - 0xc], eax
jmp 0x599c46
push 0
push 0
push 0
push 0
mov eax, dword [ebp - 0x18]
call fcn.00405174
push eax
call sub.wininet.dll_InternetOpenA
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x34], 0x64
push 4
lea eax, [ebp - 0x34]
push eax
push 0x49
mov eax, dword [ebp - 0xc]
push eax
call sub.wininet.dll_InternetSetOptionA
cmp dword [ebp - 0xc], 0
je 0x599d0d
mov eax, dword [0x5a80a4]
cmp byte [eax], 0
je 0x599cec
mov eax, dword [0x5a80a4]
cmp dword [eax + 4], 0
je 0x599cec
mov eax, dword [0x5a80a4]
cmp dword [eax + 8], 0
jle 0x599cec
mov eax, dword [0x5a80a4]
cmp dword [eax + 0xc], 0
je 0x599cba
mov eax, dword [0x5a80a4]
mov eax, dword [eax + 0xc]
call fcn.00404f74
push eax
mov eax, dword [0x5a80a4]
mov eax, dword [eax + 0xc]
call fcn.00405174
push eax
push 0x2b
mov eax, dword [ebp - 0xc]
push eax
call sub.wininet.dll_InternetSetOptionA
mov eax, dword [0x5a80a4]
cmp dword [eax + 0x10], 0
je 0x599cec
mov eax, dword [0x5a80a4]
mov eax, dword [eax + 0x10]
call fcn.00404f74
push eax
mov eax, dword [0x5a80a4]
mov eax, dword [eax + 0x10]
call fcn.00405174
push eax
push 0x2c
mov eax, dword [ebp - 0xc]
push eax
call sub.wininet.dll_InternetSetOptionA
push 0
push 0
push 3
push 0
push 0
push 0x50
mov eax, dword [ebp - 0x1c]
call fcn.00405174
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.wininet.dll_InternetConnectA
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x599d3a
push 0
push 0xa4200100
push 0
push 0
push 0
mov eax, dword [ebp - 0x20]
call fcn.00405174
push eax
push 0x59a2e0
mov eax, dword [ebp - 8]
push eax
call sub.wininet.dll_HttpOpenRequestA
mov dword [ebp - 4], eax
mov dword [ebp - 0x3c], 0x1388
push 4
lea eax, [ebp - 0x3c]
push eax
push 2
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_InternetSetOptionA
push 4
lea eax, [ebp - 0x3c]
push eax
push 5
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_InternetSetOptionA
push 4
lea eax, [ebp - 0x3c]
push eax
push 6
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_InternetSetOptionA
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0xc], 0
jne 0x59a1ce
cmp dword [ebp - 4], 0
je 0x59a04c
push 0x20000000
lea eax, [ebp - 0x78]
mov ecx, dword [ebp - 0x1c]
mov edx, 0x59a2ec
call fcn.00404fc0
mov eax, dword [ebp - 0x78]
call fcn.00404f74
push eax
lea eax, [ebp - 0x7c]
mov ecx, dword [ebp - 0x1c]
mov edx, 0x59a2ec
call fcn.00404fc0
mov eax, dword [ebp - 0x7c]
call fcn.00405174
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
push 0x20000000
push 0xa
push 0x59a2f4
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
push 0x20000000
mov eax, dword [ebp - 0x50]
call fcn.00404f74
push eax
mov eax, dword [ebp - 0x50]
call fcn.00405174
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
push 0x20000000
lea eax, [ebp - 0x80]
mov ecx, dword [ebp - 0x18]
mov edx, 0x59a308
call fcn.00404fc0
mov eax, dword [ebp - 0x80]
call fcn.00404f74
push eax
lea eax, [ebp - 0x84]
mov ecx, dword [ebp - 0x18]
mov edx, 0x59a308
call fcn.00404fc0
mov eax, dword [ebp - 0x84]
call fcn.00405174
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0x40], 0
je 0x599ebe
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov eax, dword [eax]
mov edx, dword [ebp - 0x10]
mov edx, dword [edx + 8]
add eax, dword [edx + 4]
test eax, eax
jbe 0x599f14
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov eax, dword [eax]
mov edx, dword [ebp - 0x10]
mov edx, dword [edx + 8]
add eax, dword [edx + 4]
mov dword [ebp - 0x8c], eax
mov byte [ebp - 0x88], 0
lea edx, [ebp - 0x8c]
xor ecx, ecx
mov eax, 0x59a31c
call fcn.0040d808
push 0x10000000
mov eax, dword [ebp - 0x2c]
call fcn.00404f74
push eax
mov eax, dword [ebp - 0x2c]
call fcn.00405174
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
jmp 0x599f14
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
cmp dword [eax], 0
jbe 0x599f14
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov eax, dword [eax]
mov dword [ebp - 0x8c], eax
mov byte [ebp - 0x88], 0
lea edx, [ebp - 0x8c]
xor ecx, ecx
mov eax, 0x59a31c
call fcn.0040d808
push 0x10000000
mov eax, dword [ebp - 0x2c]
call fcn.00404f74
push eax
mov eax, dword [ebp - 0x2c]
call fcn.00405174
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
push 0x20000000
push 0xf
push 0x59a330
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
push 0x20000000
push 0x16
push 0x59a340
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
push 0x20000000
push 0x10
push 0x59a358
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0xc], 0
jne 0x59a1ce
push 0
push 0
push 0
push 0
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpSendRequestA
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0xc], 0
jne 0x59a1ce
xor eax, eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x44], 4
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x48]
push eax
push 0x20000013
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpQueryInfoA
test eax, eax
je 0x59a033
cmp dword [ebp - 0x48], 0xc8
je 0x599fbe
cmp dword [ebp - 0x48], 0xce
jne 0x59a01a
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x4c]
push eax
push 0x20000005
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_HttpQueryInfoA
test eax, eax
je 0x59a001
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
cmp dword [eax + 8], 0
jne 0x59a04c
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x4c]
mov dword [eax + 8], edx
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x10]
call fcn.0059a4a8
jmp 0x59a04c
push ebp
call fcn.00599a78
pop ecx
mov edx, 0xa
mov eax, dword [ebp - 0x10]
call fcn.0059a484
jmp 0x59a1bb
push ebp
call fcn.00599a78
pop ecx
mov edx, 0xa
mov eax, dword [ebp - 0x10]
call fcn.0059a484
jmp 0x59a1bb
push ebp
call fcn.00599a78
pop ecx
mov edx, 0xa
mov eax, dword [ebp - 0x10]
call fcn.0059a484
jmp 0x59a1bb
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
cmp dword [eax + 8], 0
jne 0x59a071
push ebp
call fcn.00599a78
pop ecx
mov edx, 0xa
mov eax, dword [ebp - 0x10]
call fcn.0059a484
jmp 0x59a1bb
xor eax, eax
push ebp
push 0x59a198
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [ebp - 4], 0
je 0x59a183
jmp 0x59a092
push 1
call sub.kernel32.dll_Sleep_1
push 0
push 0
lea eax, [ebp - 0x38]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_InternetQueryDataAvailable
test eax, eax
jne 0x59a0b3
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
je 0x59a08b
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x10]
call fcn.0059a4a8
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0xc], 0
jne 0x59a183
mov eax, dword [ebp - 0x38]
call fcn.0040bcf4
mov dword [ebp - 0x24], eax
xor eax, eax
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x38]
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wininet.dll_InternetReadFile
cmp eax, 1
sbb ebx, ebx
inc ebx
test bl, bl
je 0x59a168
cmp dword [ebp - 0x28], 0
jbe 0x59a168
mov eax, dword [ebp - 0x10]
xor edx, edx
mov dword [eax + 0x18], edx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
cmp dword [eax], 0
jbe 0x59a11b
mov eax, dword [ebp - 0x10]
call fcn.0059a4bc
mov eax, dword [ebp - 0x10]
mov esi, dword [eax + 8]
mov eax, dword [esi]
add eax, dword [esi + 4]
push eax
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x10]
call fcn.0059a3c8
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x10]
call fcn.0059a36c
mov byte [ebp - 0x2d], 0
mov eax, dword [ebp - 0x10]
mov edi, dword [eax + 8]
mov eax, dword [edi + 8]
cmp eax, dword [edi + 4]
ja 0x59a176
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
cmp dword [eax + 8], 0
je 0x59a176
mov eax, dword [ebp - 0x24]
call fcn.00402e34
jmp 0x59a183
mov byte [ebp - 0x2d], 1
mov eax, dword [ebp - 0x24]
call fcn.00402e34
jmp 0x59a183
mov eax, dword [ebp - 0x24]
call fcn.00402e34
jmp 0x59a092
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59a19f
push ebp
call fcn.00599a78
pop ecx
ret
cmp byte [ebp - 0x55], 0
je 0x59a1ce
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0xc], 0
je 0x599b9e
push ebp
call fcn.00599a78
pop ecx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
test eax, eax
jle 0x59a1e4
cmp eax, dword [ebp - 0x54]
jl 0x59a1ea
cmp byte [ebp - 0x55], 0
jne 0x59a200
mov eax, dword [ebp - 0x10]
cmp word [eax + 0x22], 0
je 0x59a200
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebx + 0x24]
call dword [ebx + 0x20]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59a24f
lea eax, [ebp - 0x84]
mov edx, 4
call fcn.00404cd8
lea eax, [ebp - 0x64]
mov edx, 3
call fcn.00404cd8
lea eax, [ebp - 0x50]
call fcn.00404cb4
lea eax, [ebp - 0x2c]
call fcn.00404cb4
lea eax, [ebp - 0x20]
mov edx, 4
call fcn.00404cd8
ret