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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x78
mov esi, ecx
mov eax, dword [0x520014]
xor eax, ebp
mov dword [esp + 0x74], eax
mov ecx, dword [0x525a84]
test ecx, ecx
jne 0x4d2321
movzx eax, byte [esi + 0x1b]
test al, al
jns 0x4d2251
mov eax, dword [esi + 0x14]
xor edi, edi
test eax, eax
je 0x4d226b
mov ecx, dword [esp + 0x74]
xor ecx, ebp
call fcn.0048a678
mov eax, edi
lea esp, [ebp - 8]
pop esi
pop edi
pop ebp
ret
lea edi, [esi + 0x10]
lea eax, [esp + 0x70]
mov dword [eax], 0
push eax
push 0x8000
push dword [esi + 0x5c]
push dword [esi + 0x58]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4d233a
xor eax, eax
lea ecx, [esp + 8]
mov dword [ecx], eax
lea edx, [esp + 4]
mov dword [edx], 4
push eax
push edx
push ecx
push 0x20000013
push dword [esi + 0x58]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4d22c7
cmp dword [esp + 8], 0xc8
jne 0x4d23a2
mov eax, dword [esp + 0x70]
test eax, eax
je 0x4d22e2
mov ecx, dword [esi + 0x48]
mov edx, dword [ecx]
push eax
push dword [esi + 0x5c]
call dword [edx]
test al, al
je 0x4d2401
cmp dword [esi + 0x44], 0
je 0x4d22f1
mov edi, dword [esp + 0x70]
jmp 0x4d2257
xor eax, eax
lea ecx, [esp + 0x18]
mov dword [ecx], eax
lea edx, [esp + 0xc]
mov dword [edx], 4
push eax
push edx
push ecx
push 0x20000005
push dword [esi + 0x58]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4d22e8
mov eax, dword [esp + 0x18]
mov dword [esi + 0x44], eax
jmp 0x4d22e8
call fcn.004d2220
mov esi, eax
mov ecx, dword [esp + 0x74]
xor ecx, ebp
call fcn.0048a678
mov eax, esi
jmp 0x4d2264
lea ecx, [esp + 0x18]
mov edx, str.internet_read_
call fcn.004d20f0
cmp byte [edi + 0xb], 0
jns 0x4d2358
push dword [edi]
call fcn.00489982
add esp, 4
lea esi, [esp + 0x18]
mov eax, dword [esi + 8]
mov dword [edi + 8], eax
movsd xmm0, qword [esi]
movsd qword [edi], xmm0
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esp + 0xc]
push eax
push edi
call fcn.004b86f0
add esp, 8
mov ecx, esi
push edi
push 0x109
push str.ReadChunk
push 1
call fcn.004b84f0
lea ecx, [esp + 0x54]
push 0x50aad6
push str.Download_chunk_error.
jmp 0x4d23dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esp + 0xc]
push eax
push edi
call fcn.004b86f0
add esp, 8
lea esi, [esp + 0x18]
mov ecx, esi
push edi
push 0x112
push str.ReadChunk
push 1
call fcn.004b84f0
lea ecx, [esp + 0x54]
push 0x50aaf3
push str.HTTP_request_status_isnt_OK
call fcn.004b45d0
mov ecx, esi
call fcn.004b8530
cmp byte [edi + 0xb], 0
jns 0x4d23fa
push dword [esp + 0xc]
call fcn.00489982
add esp, 4
xor edi, edi
jmp 0x4d2257
lea ecx, [esp + 0x18]
mov edx, str.write_file_
call fcn.004d20f0
cmp byte [edi + 0xb], 0
jns 0x4d241f
push dword [edi]
call fcn.00489982
add esp, 4
lea esi, [esp + 0x18]
mov eax, dword [esi + 8]
mov dword [edi + 8], eax
movsd xmm0, qword [esi]
movsd qword [edi], xmm0
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esp + 0xc]
push eax
push edi
call fcn.004b86f0
add esp, 8
mov ecx, esi
push edi
push 0x119
push str.ReadChunk
push 1
call fcn.004b84f0
lea ecx, [esp + 0x54]
push 0x50ab11
push str.Write_file_error.
jmp 0x4d23dc