Function at 0x4049a0
Capabilities:
Check http status code
Connect to http server
Create http request
Get http content length
Query remote server for available data
Read data from internet
Receive data
Send data
Send http request

Disassembly:
mov ecx, dword [esp + 4]
sub esp, 0x48
push ebx
push ebp
mov ebp, dword [esp + 0x58]
push esi
xor esi, esi
cmp ecx, esi
push edi
je 0x4049cd
cmp ebp, 0xffffffff
jne 0x4049cd
cmp byte [ecx], 0
mov eax, ecx
je 0x4049c9
add eax, 1
cmp byte [eax], 0
jne 0x4049c1
sub eax, ecx
mov ebp, eax
push 1
push esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x18], esi
call dword [sym.imp.kernel32.dll_GetProcessHeap]
push eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov edi, eax
cmp edi, esi
jne 0x4049f5
mov ecx, 0xe
jmp 0x404e06
push esi
push esi
push esi
push esi
push 0x41790f
mov byte [edi], 0
call dword [sym.imp.WININET.dll_InternetOpenA]
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionA]
push 4
lea ecx, [esp + 0x18]
push ecx
push 3
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x24], 1
call esi
mov eax, dword [esp + 0x20]
push 4
lea edx, [esp + 0x18]
push edx
push 5
mov ebx, 0x493e0
push eax
mov dword [esp + 0x24], ebx
call esi
push 4
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x28]
push 6
push ebx
call esi
test ebx, ebx
je 0x404ddb
push 0
push 0
push 3
push 0
push 0
push 0x50
push 0x419528
push ebx
call dword [sym.imp.WININET.dll_InternetConnectA]
mov esi, eax
test esi, esi
mov dword [esp + 0x2c], esi
je 0x404dc8
push 0
push 0x4400300
push 0x41d010
push 0
push 0
push 0x419524
push 0x418f34
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x18], ebx
je 0x404daa
push 0x28
lea edx, [esp + 0x34]
push edx
call dword [sym.imp.kernel32.dll_RtlZeroMemory]
mov ecx, dword [esp + 0x64]
xor esi, esi
cmp ecx, esi
mov dword [esp + 0x30], 0x28
mov dword [esp + 0x38], ecx
je 0x404ad9
call fcn.00406c70
jmp 0x404adb
xor eax, eax
push esi
push esi
mov dword [esp + 0x48], eax
mov dword [esp + 0x44], eax
push esi
lea eax, [esp + 0x3c]
push eax
push ebx
mov dword [esp + 0x60], ebp
call dword [sym.imp.WININET.dll_HttpSendRequestExA]
test eax, eax
je 0x404d81
test ebp, ebp
mov dword [esp + 0x60], esi
jle 0x404b49
mov ebx, dword [sym.imp.WININET.dll_InternetWriteFile]
lea esp, [esp]
mov eax, ebp
sub eax, esi
cmp eax, 0x4000
jle 0x404b20
mov eax, 0x4000
mov edx, dword [esp + 0x5c]
lea ecx, [esp + 0x64]
push ecx
mov ecx, dword [esp + 0x1c]
push eax
lea eax, [esi + edx]
push eax
push ecx
call ebx
test eax, eax
je 0x404bc5
add esi, dword [esp + 0x64]
cmp esi, ebp
jl 0x404b10
mov ebx, dword [esp + 0x18]
push 0
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpEndRequestA]
test eax, eax
je 0x404d81
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
push 0
lea edx, [esp + 0x60]
push edx
lea eax, [esp + 0x20]
push eax
push 0x20000013
mov ebp, 4
push ebx
mov dword [esp + 0x2c], 0
mov dword [esp + 0x70], ebp
call esi
test eax, eax
je 0x404d81
cmp dword [esp + 0x18], 0xc8
jne 0x404d5a
push 0
lea ecx, [esp + 0x60]
push ecx
lea edx, [esp + 0x6c]
push edx
push 0x20000005
push ebx
mov dword [esp + 0x70], ebp
call esi
test eax, eax
je 0x404bf5
mov ebp, dword [esp + 0x64]
mov esi, dword [esp + 0x10]
jmp 0x404c31
call dword [sym.imp.kernel32.dll_GetLastError]
mov ebx, dword [esp + 0x18]
push ebx
mov dword [esp + 0x64], eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [esp + 0x2c]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x64], 0xffffffff
push 0
push 0
lea eax, [esp + 0x2c]
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
je 0x404d81
mov eax, dword [esp + 0x24]
test eax, eax
je 0x404c95
mov esi, dword [esp + 0x10]
add eax, esi
cmp eax, ebp
jle 0x404c4f
mov dword [esp + 0x1c], eax
mov ebp, eax
lea ecx, [ebp + 1]
push ecx
push edi
push 0
call dword [sym.imp.kernel32.dll_GetProcessHeap]
push eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
mov edi, eax
test edi, edi
je 0x404d28
mov eax, ebp
sub eax, esi
cmp eax, 0x4000
jl 0x404c5f
mov eax, 0x4000
lea edx, [esp + 0x28]
push edx
push eax
lea eax, [edi + esi]
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x404d81
add esi, dword [esp + 0x28]
xor eax, eax
mov dword [esp + 0x10], esi
je 0x404c01
mov edx, dword [esp + 0x64]
mov ecx, esi
call eax
jmp 0x404c01
test edi, edi
je 0x404d8b
mov eax, dword [esp + 0x10]
cmp eax, 3
mov byte [edi + eax], 0
jl 0x404d8b
movzx eax, byte [edi]
sub eax, 0xef
jne 0x404cd4
movzx eax, byte [edi + 1]
sub eax, 0xbb
lea ecx, [edi + 1]
jne 0x404cd4
movzx eax, byte [ecx + 1]
add ecx, 1
sub eax, 0xbf
je 0x404ce2
test eax, eax
mov ecx, 1
jg 0x404ce4
or ecx, 0xffffffff
jmp 0x404ce4
xor ecx, ecx
test ecx, ecx
jne 0x404d8b
mov eax, dword [esp + 0x10]
sub eax, 3
mov dword [esp + 0x10], eax
add eax, 1
push eax
lea ecx, [edi + 3]
push ecx
push edi
call dword [sym.imp.kernel32.dll_RtlMoveMemory]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [esp + 0x2c]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
push ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x64], 0xe
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [esp + 0x2c]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
push ebx
mov dword [esp + 0x64], 0x2f78
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [esp + 0x2c]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
call dword [sym.imp.kernel32.dll_GetLastError]
mov dword [esp + 0x60], eax
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [esp + 0x2c]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
call dword [sym.imp.kernel32.dll_GetLastError]
push esi
mov dword [esp + 0x64], eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
call dword [sym.imp.kernel32.dll_GetLastError]
push ebx
mov dword [esp + 0x64], eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404de5
call dword [sym.imp.kernel32.dll_GetLastError]
mov dword [esp + 0x60], eax
cmp dword [esp + 0x60], 0
je 0x404e02
test edi, edi
je 0x404e02
push edi
push 0
call dword [sym.imp.kernel32.dll_GetProcessHeap]
push eax
call dword [sym.imp.kernel32.dll_HeapFree]
xor edi, edi
mov ecx, dword [esp + 0x60]
mov eax, dword [esp + 0x6c]
test eax, eax
mov edx, dword [esp + 0x68]
mov dword [edx], edi
je 0x404e1a
mov edx, dword [esp + 0x10]
mov dword [eax], edx
pop edi
pop esi
pop ebp
mov eax, ecx
pop ebx
add esp, 0x48
ret 0x14