Function at 0x51061ce4
Capabilities:
Get http content length
Query remote server for available data
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x18], edx
mov ebx, eax
xor eax, eax
push ebp
push 0x51061fc0
push dword fs:[eax]
mov dword fs:[eax], esp
cmp word [ebx + 0x2072], 0
je 0x51061d26
mov edx, ebx
mov eax, dword [ebx + 0x2074]
call dword [ebx + 0x2070]
mov dword [ebp - 0x10], 4
xor eax, eax
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xc]
push eax
push 0x20000013
mov eax, dword [ebx + 0xc]
push eax
call sub.wininet.dll_HttpQueryInfoA
test eax, eax
jne 0x51061d6b
mov ecx, 0x51061fd8
mov dl, 1
mov eax, dword [0x51007aec]
call fcn.5100c314
call fcn.51003f1c
jmp 0x51061e11
cmp dword [ebp - 0xc], 0x12c
jb 0x51061e11
xor eax, eax
mov dword [ebp - 0x14], eax
mov eax, dword [0x5107cd44]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x18]
mov edx, dword [ebp - 4]
call fcn.51004b7c
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x18]
call fcn.51004a48
push eax
push 0x14
mov eax, dword [ebx + 0xc]
push eax
call sub.wininet.dll_HttpQueryInfoA
test eax, eax
jne 0x51061dc8
mov ecx, 0x5106201c
mov dl, 1
mov eax, dword [0x51007aec]
call fcn.5100c314
call fcn.51003f1c
jmp 0x51061e11
lea eax, [ebp - 0x18]
mov edx, dword [ebp - 4]
call fcn.51004b7c
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
mov byte [ebp - 0x2c], 0xb
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x28], eax
mov byte [ebp - 0x24], 0
lea edx, [ebp - 0x30]
mov ecx, 1
mov eax, 0x51062060
call fcn.51009834
mov ecx, dword [ebp - 0x20]
mov dl, 1
mov eax, dword [0x51007aec]
call fcn.5100c314
call fcn.51003f1c
xor eax, eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0x20000005
mov eax, dword [ebx + 0xc]
push eax
call sub.wininet.dll_HttpQueryInfoA
test eax, eax
jne 0x51061e4a
mov ecx, 0x51062070
mov dl, 1
mov eax, dword [0x51007aec]
call fcn.5100c314
call fcn.51003f1c
xor esi, esi
push 0
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebx + 0xc]
push eax
call sub.wininet.dll_InternetQueryDataAvailable
mov edx, eax
cmp edx, 1
sbb edx, edx
neg edx
mov eax, ebx
call fcn.51061714
cmp dword [ebp - 4], 0
jbe 0x51061efb
mov edi, esi
add esi, dword [ebp - 4]
mov edx, esi
mov eax, dword [ebx + 0x38]
mov ecx, dword [eax]
call dword [ecx]
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebx + 0x38]
mov eax, dword [eax + 4]
cdq
push edx
push eax
mov eax, edi
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
push eax
mov eax, dword [ebx + 0xc]
push eax
call sub.wininet.dll_InternetReadFile
mov edx, eax
cmp edx, 1
sbb edx, edx
neg edx
mov eax, ebx
call fcn.51061714
mov edi, dword [ebx + 0x38]
mov eax, edi
call fcn.5101ce98
push edx
push eax
mov eax, dword [ebp - 4]
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
push edx
push eax
mov eax, edi
call fcn.5101ceb8
cmp word [ebx + 0x207a], 0
je 0x51061efb
mov edx, dword [ebp - 4]
mov eax, dword [ebx + 0x207c]
call dword [ebx + 0x2078]
cmp dword [ebp - 4], 0
jne 0x51061e4c
mov eax, esi
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x1c]
cdq
cmp edx, dword [esp + 4]
jne 0x51061f18
cmp eax, dword [esp]
pop edx
pop eax
je 0x51061f66
push 0x510620b8
mov eax, esi
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x38]
call fcn.510089f8
push dword [ebp - 0x38]
push 0x510620c8
lea edx, [ebp - 0x3c]
mov eax, dword [ebp - 0x1c]
call fcn.510089c8
push dword [ebp - 0x3c]
lea eax, [ebp - 0x34]
mov edx, 4
call fcn.510048b8
mov ecx, dword [ebp - 0x34]
mov dl, 1
mov eax, dword [0x51007aec]
call fcn.5100c314
call fcn.51003f1c
mov edx, dword [ebx + 0x10]
mov eax, dword [ebx + 0x1c]
call fcn.51004b34
test eax, eax
jle 0x51061f89
mov esi, dword [ebx + 0x38]
mov eax, esi
call fcn.5101cecc
mov edx, eax
mov eax, dword [esi + 4]
call fcn.51061128
push 0
push 0
mov eax, dword [ebx + 0x38]
call fcn.5101ceb8
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51061fc7
lea eax, [ebp - 0x3c]
mov edx, 3
call fcn.51004564
lea eax, [ebp - 0x20]
call fcn.51004540
lea eax, [ebp - 0x18]
call fcn.51004540
ret