Function at 0x45873d
Capabilities:
Check internet connectivity via wininet
Create http request
Delete file
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
mov eax, 0x4a094d
call fcn.0049e6bc
sub esp, 0x44
push ebx
push esi
push edi
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 4], 1
lea eax, [ebp + 0x20]
cmp dword [ebp + 0x34], 8
cmovae eax, dword [ebp + 0x20]
xor ebx, ebx
push ebx
push ebx
push 2
push ebx
push 3
push 0x10000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x458814
push ebx
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test byte [ebp - 0x28], 4
push ebx
push ebx
push ebx
jne 0x4587a2
push 4
push 0x4cade8
jmp 0x4587a8
push ebx
push str.MyOpen
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebx, eax
test ebx, ebx
je 0x458812
cmp dword [ebp + 0x1c], 8
lea edi, [ebp - 0x50]
push 8
pop ecx
push 0
mov esi, str.Accept:___r_n_r_n
lea eax, [ebp - 0x50]
rep movsd dword es:[edi], dword [esi]
push 0x84000100
lea esi, [ebp + 8]
cmovae esi, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
lea eax, [ebp - 0x50]
push eax
push esi
push ebx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov edi, eax
test edi, edi
jne 0x45883f
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0x34], 8
lea eax, [ebp + 0x20]
cmovae eax, dword [ebp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
xor ebx, ebx
push 0
push 1
lea ecx, [ebp + 8]
call fcn.0041f6b8
push 0
push 1
lea ecx, [ebp + 0x20]
call fcn.0041f6b8
mov ecx, dword [ebp - 0xc]
mov al, bl
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov dword [ebp - 0x2c], 4
push eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x20]
push eax
push 0x20000005
push edi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x458875
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
push ebx
call esi
jmp 0x4587f7
and dword [ebp - 0x14], 0
push 0x5000
call fcn.00434eee
mov dword [esp], 0x5000
mov esi, eax
push 0
push esi
call fcn.00438560
add esp, 0xc
jmp 0x458910
mov ecx, dword [ebp - 0x14]
test ecx, ecx
je 0x458975
mov eax, dword [ebp + 0x3c]
cmp byte [eax], 0
jne 0x458975
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
add eax, ecx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edx
cmp edx, 0x800
jbe 0x4588cf
shr eax, 0xa
shr edx, 0xa
mov dword [ebp - 0x18], edx
imul eax, eax, 0x64
xor edx, edx
div dword [ebp - 0x18]
cmp dword [ebp - 0x24], 0
mov edx, dword [ebp + 0x38]
mov dword [edx], eax
je 0x4588fb
mov eax, dword [ebp - 0x30]
cmp eax, 1
jbe 0x4588fb
push dword [edx]
push 0
push eax
push dword [ebp - 0x24]
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, dword [ebp - 0x14]
push 0
lea eax, [ebp - 0x14]
push eax
push ecx
push esi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x45895e
lea eax, [ebp - 0x14]
push eax
push 0x5000
push esi
push edi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x458899
push edi
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call edi
push ebx
call edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0x34], 8
lea eax, [ebp + 0x20]
cmovae eax, dword [ebp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
xor bl, bl
push esi
call fcn.00435bbf
pop ecx
jmp 0x458814
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call edi
push ebx
call edi
jmp 0x458950
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call edi
push ebx
call edi
mov bl, 1
jmp 0x458952