Function at 0x40bb18
Capabilities:
Check for time delay via gettickcount
Get file size
Get http content length
Read data from internet
Receive data

Disassembly:
push ebp
lea ebp, [esp - 0x814]
sub esp, 0x894
mov eax, dword [0x48e610]
xor eax, ebp
mov dword [ebp + 0x810], eax
mov eax, dword [ebp + 0x81c]
push ebx
push esi
mov dword [ebp], eax
mov eax, dword [ebp + 0x820]
push edi
mov edi, dword [ebp + 0x828]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x824]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0x82c]
push edi
mov esi, ecx
push str.Download__strURL_
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x18], eax
call fcn.0043f7b0
push eax
lea eax, [ebp + 4]
push eax
call fcn.00440090
push eax
call fcn.0040d9ba
add esp, 0x10
lea ecx, [ebp + 4]
call fcn.0043f790
lea ecx, [ebp - 0x28]
call fcn.0043f790
xor ebx, ebx
cmp dword [ebp - 0x14], ebx
je 0x40c121
mov dword [esi + 0x18], ebx
cmp edi, ebx
je 0x40c121
push 0x47f390
lea ecx, [ebp + 4]
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
cmp dword [ebp], ebx
je 0x40bbe4
mov eax, dword [ebp]
fld dword [eax + 0x8b0]
fmul qword [0x47f388]
call fcn.00462110
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], 0x80004005
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x830], ebx
jle 0x40bc6a
push dword [ebp + 0x834]
mov ecx, esi
push edi
call fcn.0040b629
mov dword [ebp - 0x10], eax
lea ecx, [ebp + 4]
cmp eax, ebx
jge 0x40bc7b
push str.connect_failed
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
cmp dword [ebp + 0x830], 1
jle 0x40bc5c
mov eax, dword [ebp + 0x830]
dec eax
cmp dword [ebp - 4], eax
je 0x40bc5c
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp]
fld dword [eax + 0x8b4]
fimul dword [ebp - 0xc]
call fcn.00462110
mov dword [ebp - 0xc], eax
inc dword [ebp - 4]
mov eax, dword [ebp - 4]
cmp eax, dword [ebp + 0x830]
jl 0x40bbf6
mov ebx, dword [ebp - 0x10]
mov ecx, esi
call fcn.0040b614
mov eax, ebx
jmp 0x40c126
push str.here2
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
push ebx
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 8]
push eax
push 0x20000005
push dword [esi]
mov dword [ebp - 8], ebx
mov dword [ebp - 0x30], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x40bccb
cmp dword [ebp - 0x30], 4
jne 0x40bcc6
cmp dword [ebp - 8], ebx
jne 0x40bd11
mov dword [ebp - 8], ebx
jmp 0x40bd0a
push 7
push str.file:__
push edi
call fcn.00461fca
add esp, 0xc
test eax, eax
jne 0x40bd05
push ebx
push ebx
push 3
push ebx
push 1
push ebx
add edi, 7
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push edi
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 8], ebx
jne 0x40bd11
push str.size__0
jmp 0x40bd16
push str.size___0
lea ecx, [ebp + 4]
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
cmp dword [ebp - 8], ebx
jne 0x40bd3c
mov dword [ebp - 8], 1
cmp dword [ebp + 0x838], ebx
jne 0x40bc6d
lea eax, [esi + 4]
push eax
lea ecx, [ebp - 0x80]
call fcn.00448800
lea eax, [ebp + 4]
push eax
lea ecx, [ebp - 0x80]
call fcn.00448850
cmp byte [eax + 7], 0xff
jne 0x40bd68
mov eax, dword [eax]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
lea ecx, [ebp + 4]
mov edi, eax
call fcn.0043f790
cmp edi, ebx
jge 0x40bdb4
push str.open_failed
lea ecx, [ebp + 4]
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
mov ecx, esi
call fcn.0040b614
lea ecx, [ebp - 0x80]
call fcn.00448840
mov eax, edi
jmp 0x40c126
cmp dword [ebp], ebx
je 0x40bded
mov edi, dword [ebp - 0x18]
cmp edi, ebx
je 0x40bded
push str.downloadStart
lea ecx, [ebp + 4]
call fcn.0043f7b0
lea eax, [edi + 0x3c]
cmp byte [eax + 7], 0xff
jne 0x40bdd8
mov eax, dword [eax]
lea ecx, [ebp + 4]
push ecx
mov ecx, dword [ebp]
push eax
call fcn.0040ff97
lea ecx, [ebp + 4]
call fcn.0043f790
mov ecx, dword [ebp - 0x20]
cmp ecx, ebx
je 0x40be08
lea eax, [esi + 4]
cmp byte [eax + 7], 0xff
jne 0x40bdff
mov eax, dword [eax]
push dword [ebp - 8]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
or dword [esi + 0x10], 0xffffffff
mov dword [esi + 0x14], 1
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x47f324
lea ecx, [ebp + 4]
mov dword [ebp - 0x38], eax
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
jmp 0x40c067
cmp dword [esi + 0x14], ebx
je 0x40c075
mov edi, dword [ebp]
cmp edi, ebx
je 0x40be7f
fld dword [edi + 0x8b0]
fmul qword [0x47f388]
call fcn.00462110
mov dword [ebp - 0xc], eax
cmp dword [edi + 0x30], ebx
je 0x40be7f
mov eax, dword [ebp - 0x18]
cmp eax, ebx
je 0x40be7f
cmp dword [eax + 4], ebx
je 0x40c072
mov edi, 0x400
push edi
lea eax, [ebp + 0x40d]
push ebx
push eax
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x2c], ebx
mov byte [ebp + 0x40c], bl
call fcn.0045f090
add esp, 0xc
lea eax, [ebp - 0x2c]
push eax
push edi
lea eax, [ebp + 0x40c]
push eax
push dword [esi]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40bf31
mov eax, dword [ebp - 0x2c]
cmp eax, ebx
je 0x40c075
add dword [ebp - 4], eax
fild dword [ebp - 4]
jns 0x40bed5
fadd dword [0x47f320]
fmul qword [0x47f318]
fstp qword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x38]
mov dword [ebp - 0x24], eax
fild dword [ebp - 0x24]
jns 0x40bef5
fadd dword [0x47f320]
fdiv qword [0x47f388]
fstp dword [ebp - 0x24]
fld dword [ebp - 0x24]
fdivr qword [ebp - 0x50]
call fcn.00462110
mov ecx, dword [ebp - 0x20]
mov dword [esi + 0x10], eax
cmp ecx, ebx
je 0x40bf1b
push dword [ebp - 4]
mov eax, dword [ecx]
call dword [eax + 8]
push dword [ebp - 0x2c]
mov edi, dword [ebp - 0x14]
mov eax, dword [edi]
lea ecx, [ebp + 0x40c]
push ecx
mov ecx, edi
call dword [eax + 0x10]
jmp 0x40bf60
mov dword [ebp - 0x34], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp eax, 0x2ee3
jne 0x40bf5d
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 0x24], edi
call dword [sym.imp.WININET.dll_InternetGetLastResponseInfoA]
mov edi, dword [ebp - 0x14]
cmp dword [ebp - 0x34], ebx
je 0x40c067
inc dword [ebp - 0x1c]
cmp dword [ebp], ebx
je 0x40bfd0
cmp dword [ebp - 0x18], ebx
je 0x40bfd0
lea ecx, [ebp + 4]
call fcn.0043f500
push dword [ebp - 0x1c]
lea eax, [ebp + 4]
push dword [ebp - 0x10]
push str.actiondownloadfailurevalue_ddownloadattempt_d
push eax
call fcn.00440350
mov eax, dword [ebp - 0x18]
add eax, 0x3c
push eax
lea eax, [ebp - 0x48]
push str.packageID
push eax
call fcn.004400e0
add esp, 0x1c
push eax
lea ecx, [ebp + 4]
call fcn.0043fcf0
lea ecx, [ebp - 0x48]
call fcn.0043f790
mov ecx, dword [ebp]
push ebx
lea eax, [ebp + 4]
push eax
call fcn.00410896
lea ecx, [ebp + 4]
call fcn.0043f790
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp + 0x830]
jge 0x40c064
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp]
fld dword [eax + 0x8b4]
fimul dword [ebp - 0xc]
call fcn.00462110
push dword [esi]
mov dword [ebp - 0xc], eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
lea eax, [esi + 4]
mov dword [esi], ebx
cmp byte [eax + 7], 0xff
jne 0x40c011
mov eax, dword [eax]
push ebx
push 0x200000
push ebx
push ebx
push eax
push dword [0x48fc68]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov dword [esi], eax
cmp eax, ebx
je 0x40bf60
mov eax, dword [edi]
mov ecx, edi
mov dword [ebp - 4], ebx
call dword [eax + 8]
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x80]
call fcn.00448850
cmp byte [eax + 7], 0xff
jne 0x40c04e
mov eax, dword [eax]
mov edx, dword [edi]
push eax
mov ecx, edi
call dword [edx + 4]
lea ecx, [ebp - 0x40]
mov edi, eax
call fcn.0043f790
cmp edi, ebx
jge 0x40c067
mov dword [esi + 0x14], ebx
cmp dword [esi + 0x18], ebx
je 0x40be46
jmp 0x40c075
mov dword [esi + 0x14], ebx
cmp dword [ebp], ebx
je 0x40c0bf
mov edi, dword [ebp - 0x18]
cmp edi, ebx
je 0x40c0bf
cmp dword [esi + 0x18], ebx
je 0x40c08d
push str.downloadCancel
jmp 0x40c097
cmp dword [esi + 0x14], ebx
je 0x40c0bf
push str.downloadSuccessful
lea ecx, [ebp + 4]
call fcn.0043f7b0
lea eax, [edi + 0x3c]
cmp byte [eax + 7], 0xff
jne 0x40c0aa
mov eax, dword [eax]
lea ecx, [ebp + 4]
push ecx
mov ecx, dword [ebp]
push eax
call fcn.0040ff97
lea ecx, [ebp + 4]
call fcn.0043f790
mov ecx, dword [ebp - 0x20]
cmp ecx, ebx
je 0x40c0d6
mov eax, dword [ecx]
cmp dword [esi + 0x18], ebx
je 0x40c0d0
push ebx
jmp 0x40c0d3
push dword [esi + 0x14]
call dword [eax + 0xc]
mov edi, 0x80004005
cmp dword [esi + 0x18], ebx
je 0x40c0e7
mov edi, 0x8000aaa3
jmp 0x40c0ee
cmp dword [esi + 0x14], ebx
je 0x40c0ee
xor edi, edi
mov ecx, esi
call fcn.0040b614
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx]
call dword [eax + 8]
push str.normal_return_from_Download
lea ecx, [ebp + 4]
call fcn.0043f7b0
lea eax, [ebp + 4]
push eax
call fcn.0040d9ba
pop ecx
lea ecx, [ebp + 4]
call fcn.0043f790
jmp 0x40bda5
mov eax, 0x80004005
mov ecx, dword [ebp + 0x810]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045f4ee
add ebp, 0x814
leave
ret 0x20