Function at 0x406610
Capabilities:
Connect to http server
Create http request
Query remote server for available data
Read data from internet
Receive data
Reference http user-agent string
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x43c
push ebx
push esi
push edi
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0x400
push eax
lea eax, [ebp - 0x438]
mov ebx, ecx
push eax
push 0
call dword [sym.imp.urlmon.dll_ObtainUserAgentString]
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebp - 0x438]
push 0
push 0
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call edi
mov esi, eax
test esi, esi
jg 0x406661
xor esi, esi
mov dword [ebp - 0xc], esi
jmp 0x406699
lea eax, [esi*2 + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x406697
push esi
mov esi, eax
lea eax, [ebp - 0x438]
push esi
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call edi
jmp 0x406699
mov esi, eax
xor edi, edi
lea edx, [ebp - 0x2c]
mov ecx, ebx
mov dword [ebp - 0x10], edi
call fcn.00406450
xor ecx, ecx
mov dword [ebp - 0x18], ecx
nop dword [eax]
push 0
push 0
push 0
push ecx
push esi
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebx, eax
test ebx, ebx
je 0x406846
mov dword [ebp - 0x14], 0xea60
xor esi, esi
mov dword [ebp - 0x38], 2
mov dword [ebp - 0x34], 6
mov dword [ebp - 0x30], 5
push 4
lea eax, [ebp - 0x14]
push eax
push dword [ebp + esi*4 - 0x38]
push ebx
call dword [sym.imp.WININET.dll_InternetSetOptionW]
inc esi
cmp esi, 3
jb 0x4066e6
push 0
push 0
push 3
push 0
push 0
push dword [ebp - 0x20]
push dword [ebp - 0x2c]
push ebx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov esi, eax
mov dword [ebp - 0x14], esi
test esi, esi
je 0x406838
cmp byte [ebp - 0x1e], 2
mov eax, 0x80803000
push 0
mov ecx, 0x80403000
cmove ecx, eax
push ecx
push 0
push 0
push 0
push dword [ebp - 0x28]
mov dword [ebp - 8], ecx
push 0x401b50
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov edi, eax
test edi, edi
je 0x40682c
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 4
push eax
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push eax
push 0x1f
push edi
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
test eax, eax
je 0x406790
or dword [ebp - 8], 0x3180
lea eax, [ebp - 8]
push 4
push eax
push 0x1f
push edi
call dword [sym.imp.WININET.dll_InternetSetOptionW]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push 0xffffffffffffffff
push 0x401ac8
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x406821
xor esi, esi
nop word [eax + eax]
push 0
push 0
lea eax, [ebp - 4]
mov dword [ebp - 4], 0
push eax
push edi
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
mov eax, dword [ebp - 4]
je 0x406811
mov ecx, dword [ebp - 0x10]
add eax, esi
push eax
test ecx, ecx
jne 0x4067e8
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
jmp 0x4067f8
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
lea ecx, [ebp - 4]
mov dword [ebp - 0x10], eax
push ecx
push dword [ebp - 4]
add eax, esi
push eax
push edi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov eax, dword [ebp - 4]
add esi, eax
test eax, eax
jne 0x4067b0
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x40681e
mov dword [eax], esi
mov esi, dword [ebp - 0x14]
push edi
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call edi
jmp 0x406832
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push esi
call edi
mov edi, dword [ebp - 0x10]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
test edi, edi
jne 0x406856
mov esi, dword [ebp - 0xc]
cmp dword [ebp - 0x18], 1
je 0x406856
mov ecx, 1
jmp 0x4066aa
mov eax, dword [ebp - 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test eax, eax
je 0x406871
push eax
push 0
call ebx
push eax
call esi
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x406880
push eax
push 0
call ebx
push eax
call esi
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40688f
push eax
push 0
call ebx
push eax
call esi
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret