Function at 0x409890
Capabilities:
Check http status code
Get http content length
Read data from internet
Receive data

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov ebx, eax
mov esi, ecx
xor eax, eax
push edi
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
lea ebp, [esi + 0x18]
lea edi, [esi + 0x14]
jmp 0x4098b0
cmp dword [edi], 4
je 0x4098ee
push 1
push 0
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, 1
jne 0x4098b0
mov eax, dword [esp + 0x24]
test eax, eax
je 0x409906
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.00409f70
add esp, 8
lea ebx, [esp + 0x18]
mov edi, eax
call fcn.004095b0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov edi, 1
lea ebx, [esp + 0x18]
mov eax, edi
call fcn.004095b0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 8]
mov ecx, dword [eax]
mov edx, dword [ecx]
push 0x2c
push str.A_connection_with_the_server_is_established.
add edx, eax
mov eax, dword [ecx + 4]
push 0
push edx
call eax
add esp, 0x10
push 0
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x1c]
push edx
push 0x20000013
push ebx
mov dword [esi + 4], ebx
mov dword [esp + 0x24], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.00409f90
mov edi, eax
add esp, 8
test edi, edi
je 0x409a87
mov eax, dword [esp + 0x14]
cmp eax, 0xc8
je 0x409983
push eax
push str.Unexpected_HTTP_status__d.
lea ecx, [esp + 0x20]
push 0x19
push ecx
call fcn.00408dc0
add esp, 0x10
mov edi, eax
jmp 0x409a87
push 0
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
push eax
push 0x20000005
push ebx
mov dword [esp + 0x24], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4099ad
mov eax, dword [esp + 0x14]
jmp 0x4099b0
or eax, 0xffffffff
xor edi, edi
mov dword [esi + 0x270], eax
mov dword [esi + 0x274], edi
cmp dword [ebp + 0x14], edi
jne 0x409a01
push 0x4000
push edi
mov dword [ebp], 0x28
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
xor ecx, ecx
cmp eax, edi
setne cl
lea edx, [esp + 0x18]
mov dword [ebp + 0x14], eax
push ecx
push edx
call fcn.00409100
mov edi, eax
add esp, 8
test edi, edi
je 0x409a87
xor edi, edi
push 0x4097d0
mov dword [ebp + 0x18], 0x4000
push ebx
mov dword [esi + 0x268], edi
mov dword [esi + 0x26c], edi
call dword [sym.imp.WININET.dll_InternetSetStatusCallbackW]
push esi
push edi
push ebp
push ebx
call dword [sym.imp.WININET.dll_InternetReadFileExA]
mov edi, eax
test edi, edi
je 0x409a6b
push 0
push 2
lea eax, [esi + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, 3
jne 0x409a56
lea eax, [esp + 0x18]
push 0x2ef1
push eax
call fcn.00409f70
mov edi, eax
jmp 0x409a84
push ebx
push 0
mov eax, esi
call fcn.00409670
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x409aa3
lea ecx, [esp + 0x18]
push 0
push ecx
call fcn.00409f90
add esp, 8
push 0
push ebx
call dword [sym.imp.WININET.dll_InternetSetStatusCallbackW]
lea ebx, [esp + 0x18]
mov eax, edi
call fcn.004095b0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov eax, 2
call fcn.00409580
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret