Function at 0x40c264
Capabilities:
Get file size
Get http content length

Disassembly:
push ebp
lea ebp, [esp - 0x810]
sub esp, 0x890
mov eax, dword [0x4806f0]
xor eax, ebp
mov dword [ebp + 0x80c], eax
mov eax, dword [ebp + 0x818]
push ebx
mov dword [ebp], eax
mov eax, dword [ebp + 0x81c]
push esi
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x820]
mov esi, ecx
mov ecx, dword [ebp + 0x828]
xor ebx, ebx
push edi
mov edi, dword [ebp + 0x824]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], ecx
cmp eax, ebx
je 0x40c725
mov dword [esi + 0x18], ebx
cmp edi, ebx
je 0x40c725
cmp dword [ebp + 0x82c], ebx
mov dword [ebp - 0x10], 0x80004005
mov dword [ebp + 4], ebx
jle 0x40c30c
push dword [ebp + 0x830]
mov ecx, esi
push edi
call fcn.0040bfed
cmp eax, ebx
mov dword [ebp - 0x10], eax
jge 0x40c31d
cmp dword [ebp + 0x82c], 1
jle 0x40c2fe
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
inc dword [ebp + 4]
mov eax, dword [ebp + 4]
cmp eax, dword [ebp + 0x82c]
jl 0x40c2d5
mov ebx, dword [ebp - 0x10]
mov ecx, esi
call fcn.0040bfd8
mov eax, ebx
jmp 0x40c72a
push ebx
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x14]
push eax
push 0x20000005
push dword [esi]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x34], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x40c349
cmp dword [ebp - 0x34], 4
jne 0x40c388
jmp 0x40c383
push 7
push str.file:__
push edi
call fcn.004520ca
add esp, 0xc
test eax, eax
jne 0x40c383
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 - 0x14], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x14], ebx
jne 0x40c38f
mov dword [ebp - 0x14], 1
cmp dword [ebp + 0x834], ebx
jne 0x40c30f
lea eax, [esi + 4]
push eax
lea ecx, [ebp - 0x80]
call fcn.00437f50
lea eax, [ebp - 0xc]
push eax
lea ecx, [ebp - 0x80]
call fcn.00437e80
cmp byte [eax + 7], 0xff
jne 0x40c3bb
mov eax, dword [eax]
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
lea ecx, [ebp - 0xc]
mov edi, eax
call fcn.0042f1d0
cmp edi, ebx
jge 0x40c3e8
mov ecx, esi
call fcn.0040bfd8
lea ecx, [ebp - 0x80]
call fcn.00437f90
mov eax, edi
jmp 0x40c72a
mov edi, dword [ebp - 0x24]
cmp dword [ebp], ebx
je 0x40c421
cmp edi, ebx
je 0x40c421
push 0x472f7c
lea ecx, [ebp - 0xc]
call fcn.0042f1f0
lea eax, [edi + 0x3c]
cmp byte [eax + 7], 0xff
jne 0x40c40c
mov eax, dword [eax]
lea ecx, [ebp - 0xc]
push ecx
mov ecx, dword [ebp]
push eax
call fcn.004103cd
lea ecx, [ebp - 0xc]
call fcn.0042f1d0
cmp dword [ebp - 4], ebx
je 0x40c43d
lea eax, [esi + 4]
cmp byte [eax + 7], 0xff
jne 0x40c431
mov eax, dword [eax]
push dword [ebp - 0x14]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
or dword [esi + 0x10], 0xffffffff
mov dword [esi + 0x14], 1
mov dword [ebp + 4], ebx
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x38], eax
jmp 0x40c68c
cmp dword [esi + 0x14], ebx
je 0x40c69a
mov eax, dword [ebp]
cmp eax, ebx
je 0x40c47e
cmp dword [eax + 0x2c], ebx
je 0x40c47e
cmp edi, ebx
je 0x40c47e
cmp dword [edi + 4], ebx
je 0x40c697
push 0x400
lea eax, [ebp + 0x409]
push ebx
push eax
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x28], ebx
mov byte [ebp + 0x408], bl
call fcn.0044f270
add esp, 0xc
lea eax, [ebp - 0x28]
push eax
push 0x400
lea eax, [ebp + 0x408]
push eax
push dword [esi]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40c539
mov eax, dword [ebp - 0x28]
cmp eax, ebx
je 0x40c69a
add dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
fild dword [ebp - 0x1c]
test eax, eax
jge 0x40c4d9
fadd dword [0x472f78]
fmul qword [0x472f70]
fstp qword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x38]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
test eax, eax
jge 0x40c4fb
fadd dword [0x472f78]
fdiv qword [0x472f68]
fstp dword [ebp - 0x18]
fld dword [ebp - 0x18]
fdivr qword [ebp - 0x50]
call fcn.004500d0
mov dword [esi + 0x10], eax
cmp dword [ebp - 4], ebx
je 0x40c522
mov ecx, dword [ebp - 4]
push dword [ebp - 0x1c]
mov eax, dword [ecx]
call dword [eax + 8]
push dword [ebp - 0x28]
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
lea edx, [ebp + 0x408]
push edx
call dword [eax + 0x10]
jmp 0x40c68c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp eax, 0x2ee3
jne 0x40c562
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 0x18], 0x400
call dword [sym.imp.WININET.dll_InternetGetLastResponseInfoA]
inc dword [ebp + 4]
cmp dword [ebp], ebx
je 0x40c5c5
cmp edi, ebx
je 0x40c5c5
lea ecx, [ebp - 0xc]
call fcn.0042ef70
push dword [ebp + 4]
lea eax, [ebp - 0xc]
push dword [ebp - 0x10]
push str.actiondownloadfailurevalue_ddownloadattempt_d
push eax
call fcn.0042fcf0
lea eax, [edi + 0x3c]
push eax
lea eax, [ebp - 0x48]
push str.packageID
push eax
call fcn.0042fa30
add esp, 0x1c
push eax
lea ecx, [ebp - 0xc]
call fcn.0042f680
lea ecx, [ebp - 0x48]
call fcn.0042f1d0
mov ecx, dword [ebp]
push ebx
lea eax, [ebp - 0xc]
push eax
call fcn.004118ca
lea ecx, [ebp - 0xc]
call fcn.0042f1d0
cmp dword [ebp + 4], 3
jge 0x40c642
lea ecx, [ebp - 0x30]
call fcn.0042ef70
push ebx
lea eax, [ebp - 0x30]
push eax
push str.DownloadFailureSleep
push 3
call fcn.004056dc
add esp, 0x10
test eax, eax
je 0x40c605
cmp byte [ebp - 0x29], 0xff
lea eax, [ebp - 0x30]
jne 0x40c5f7
mov eax, dword [ebp - 0x30]
push eax
call fcn.004500ab
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [esi]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
lea eax, [esi + 4]
mov dword [esi], ebx
cmp byte [eax + 7], 0xff
jne 0x40c61a
mov eax, dword [eax]
push ebx
push 0x200000
push ebx
push ebx
push eax
push dword [0x481e40]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov dword [esi], eax
cmp eax, ebx
jne 0x40c647
lea ecx, [ebp - 0x30]
call fcn.0042f1d0
jmp 0x40c562
mov dword [esi + 0x14], ebx
jmp 0x40c68c
mov edi, dword [ebp - 0x20]
mov eax, dword [edi]
mov ecx, edi
mov dword [ebp - 0x1c], ebx
call dword [eax + 8]
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x80]
call fcn.00437e80
cmp byte [eax + 7], 0xff
jne 0x40c668
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.0042f1d0
cmp edi, ebx
lea ecx, [ebp - 0x30]
jge 0x40c684
mov dword [esi + 0x14], ebx
call fcn.0042f1d0
mov edi, dword [ebp - 0x24]
cmp dword [esi + 0x18], ebx
je 0x40c45c
jmp 0x40c69a
mov dword [esi + 0x14], ebx
cmp dword [ebp], ebx
je 0x40c6e1
cmp edi, ebx
je 0x40c6e1
cmp dword [esi + 0x18], ebx
je 0x40c6af
push str.downloadCancel
jmp 0x40c6b9
cmp dword [esi + 0x14], ebx
je 0x40c6e1
push str.downloadSuccessful
lea ecx, [ebp - 0xc]
call fcn.0042f1f0
lea eax, [edi + 0x3c]
cmp byte [eax + 7], 0xff
jne 0x40c6cc
mov eax, dword [eax]
lea ecx, [ebp - 0xc]
push ecx
mov ecx, dword [ebp]
push eax
call fcn.004103cd
lea ecx, [ebp - 0xc]
call fcn.0042f1d0
cmp dword [ebp - 4], ebx
je 0x40c6f9
mov ecx, dword [ebp - 4]
mov eax, dword [ecx]
cmp dword [esi + 0x18], ebx
je 0x40c6f3
push ebx
jmp 0x40c6f6
push dword [esi + 0x14]
call dword [eax + 0xc]
mov edi, 0x80004005
cmp dword [esi + 0x18], ebx
je 0x40c70a
mov edi, 0x8000aaa3
jmp 0x40c711
cmp dword [esi + 0x14], ebx
je 0x40c711
xor edi, edi
mov ecx, esi
call fcn.0040bfd8
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
call dword [eax + 8]
jmp 0x40c3d9
mov eax, 0x80004005
mov ecx, dword [ebp + 0x80c]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0044f6d0
add ebp, 0x810
leave
ret 0x20