Function at 0x401245
Capabilities:
Connect to http server
Create http request
Query remote server for available data
Read data from internet
Receive data
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov eax, dword [0x42e00c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x24], eax
xor edi, edi
mov eax, dword [ebp + 0xc]
mov esi, edi
mov dword [ebp - 0x1c], edx
lea edx, [ebp - 0x3c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x10], esi
call fcn.004010cb
mov eax, edi
mov dword [ebp - 0x18], edi
push edi
push edi
push edi
push eax
push edi
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x4013f7
mov dword [ebp - 8], 0x7530
mov esi, edi
mov dword [ebp - 0x48], 2
mov dword [ebp - 0x44], 6
mov dword [ebp - 0x40], 5
push 4
lea eax, [ebp - 8]
push eax
push dword [ebp + esi*4 - 0x48]
push ebx
call dword [sym.imp.WININET.dll_InternetSetOptionW]
inc esi
cmp esi, 3
jb 0x4012b7
push edi
push edi
push 3
push edi
push edi
push dword [ebp - 0x30]
push dword [ebp - 0x3c]
push ebx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x4013e7
cmp byte [ebp - 0x2e], 2
mov ecx, 0x80803000
mov eax, 0x80403000
cmove eax, ecx
xor ecx, ecx
push ecx
push eax
push ecx
push ecx
push ecx
push dword [ebp - 0x38]
mov dword [ebp - 0x14], eax
push dword [ebp - 0x1c]
push edi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
test esi, esi
je 0x4013e0
and dword [ebp - 0x14], 0
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x14]
mov dword [ebp - 0xc], 4
push eax
push 0x1f
push esi
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
test eax, eax
je 0x401356
or dword [ebp - 0x14], 0x3180
lea eax, [ebp - 0x14]
push 4
push eax
push 0x1f
push esi
call dword [sym.imp.WININET.dll_InternetSetOptionW]
push dword [ebp + 0x10]
mov ecx, dword [ebp - 0x24]
mov eax, ecx
push dword [ebp - 0x20]
neg eax
sbb eax, eax
push eax
push ecx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x4013d9
mov ebx, dword [ebp - 0x10]
xor edi, edi
and dword [ebp - 0x10], 0
lea eax, [ebp - 0x10]
push 0
push 0
push eax
push esi
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
je 0x4013c0
xor ecx, ecx
mov eax, edi
add eax, dword [ebp - 0x10]
setb cl
neg ecx
or ecx, eax
push ecx
push ebx
call fcn.00415620
pop ecx
pop ecx
mov ebx, eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x10]
lea ecx, [edi + ebx]
push ecx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov ecx, dword [ebp - 0x10]
add edi, ecx
jmp 0x4013c3
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jne 0x401377
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp - 0x28]
test eax, eax
je 0x4013d6
mov dword [eax], edi
mov edi, dword [ebp - 8]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [ebp - 0x10]
test esi, esi
jne 0x401408
xor edi, edi
cmp dword [ebp - 0x18], 1
je 0x401408
xor eax, eax
inc eax
mov dword [ebp - 0x18], eax
jmp 0x401281
push dword [ebp - 0x3c]
call fcn.0041562b
push dword [ebp - 0x38]
call fcn.0041562b
pop ecx
pop ecx
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00412408
leave
ret