Function at 0x40f320
Capabilities:
Check if file exists
Connect to http server
Create http request
Download url
Receive data

Disassembly:
sub esp, 0x248
push ebx
mov ebx, dword [esp + 0x250]
push ebp
push esi
mov esi, ecx
xor ebp, ebp
cmp ebx, ebp
push edi
mov dword [esp + 0x18], ebp
mov dword [esi + 0x21c], ebp
mov dword [esi + 0x220], ebp
je 0x40f56c
call fcn.00405520
test eax, eax
je 0x40f56c
cmp dword [esi + 0x21c], 1
je 0x40f56c
mov eax, dword [esi + 0x10]
mov edi, dword [esp + 0x260]
cmp eax, ebp
jne 0x40f3b0
push ebp
push ebp
push edi
push ebx
push ebp
call sub.urlmon.dll_URLDownloadToFileW
mov ebp, eax
test ebp, ebp
jl 0x40f3a2
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40f3a2
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x248
ret 8
cmp ebp, 0x800c0006
je 0x40f56c
xor ebp, ebp
lea eax, [esp + 0x1c]
mov ecx, esi
push eax
push ebx
mov dword [esp + 0x18], 0
call fcn.0040f1f0
test eax, eax
je 0x40f56c
cmp dword [esp + 0x28], 3
jne 0x40f56c
or ebx, 0xffffffff
test edi, edi
je 0x40f403
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40f55b
cmp word [esi + 0x14], 0
lea eax, [esi + 0x14]
jne 0x40f412
mov eax, str.Mozila_4.0__compatible__MSIE_5.0__360Safe_
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.WININET.dll_InternetOpenW]
test eax, eax
mov dword [esp + 0x14], eax
je 0x40f52c
mov ecx, dword [esi + 0x21c]
test ecx, ecx
jne 0x40f52c
push eax
mov ecx, esi
call fcn.0040f150
push 2
mov ecx, esi
call fcn.0040f680
mov ebp, dword [esp + 0x30]
cmp ebp, 0x7fffffff
ja 0x40f496
mov edi, dword [esp + 0x2c]
lea ecx, [esp + 0x58]
mov edx, 0x100
lea eax, [esp + 0x58]
sub edi, ecx
lea ecx, [edx + ebp - 0x100]
test ecx, ecx
je 0x40f48a
mov cx, word [edi + eax]
test cx, cx
je 0x40f48a
mov word [eax], cx
add eax, 2
dec edx
jne 0x40f46b
jmp 0x40f48e
test edx, edx
jne 0x40f491
sub eax, 2
mov word [eax], 0
mov edx, dword [esp + 0x34]
mov ecx, dword [esp + 0x14]
push 0
push 0
push 3
push 0
push 0
lea eax, [esp + 0x6c]
push edx
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov ebp, eax
test ebp, ebp
je 0x40f52c
mov eax, dword [esi + 0x21c]
test eax, eax
jne 0x40f52c
mov edx, dword [esp + 0x48]
push 0
push 0x84000100
push 0x42debc
push 0
push str.HTTP_1.1
push edx
push 0
push ebp
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov edi, eax
test edi, edi
je 0x40f530
mov eax, dword [esi + 0x21c]
test eax, eax
jne 0x40f530
lea eax, [esp + 0x10]
mov ecx, esi
push eax
push edi
call fcn.0040f250
test eax, eax
je 0x40f530
cmp dword [esi + 0x220], 0xc8
jne 0x40f530
mov eax, dword [esi + 0x21c]
test eax, eax
jne 0x40f530
push ebx
push edi
mov ecx, esi
call fcn.0040f580
mov dword [esp + 0x18], eax
jmp 0x40f530
mov edi, dword [esp + 0x10]
cmp ebx, 0xffffffff
je 0x40f53c
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
test edi, edi
je 0x40f549
push edi
call esi
test ebp, ebp
je 0x40f550
push ebp
call esi
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40f55b
push eax
call esi
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x248
ret 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x248
ret 8