Function at 0x406830
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 0x406881
xor esi, esi
mov dword [ebp - 0xc], esi
jmp 0x4068b9
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 0x4068b7
push esi
mov esi, eax
lea eax, [ebp - 0x438]
push esi
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call edi
jmp 0x4068b9
mov esi, eax
xor edi, edi
lea edx, [ebp - 0x2c]
mov ecx, ebx
mov dword [ebp - 0x10], edi
call fcn.00406670
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 0x406a66
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 0x406906
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 0x406a58
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 0x401bc0
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov edi, eax
test edi, edi
je 0x406a4c
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 0x4069b0
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 0x401b38
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x406a41
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 0x406a31
mov ecx, dword [ebp - 0x10]
add eax, esi
push eax
test ecx, ecx
jne 0x406a08
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
jmp 0x406a18
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 0x4069d0
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x406a3e
mov dword [eax], esi
mov esi, dword [ebp - 0x14]
push edi
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call edi
jmp 0x406a52
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 0x406a76
mov esi, dword [ebp - 0xc]
cmp dword [ebp - 0x18], 1
je 0x406a76
mov ecx, 1
jmp 0x4068ca
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 0x406a91
push eax
push 0
call ebx
push eax
call esi
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x406aa0
push eax
push 0
call ebx
push eax
call esi
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x406aaf
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