Function at 0x40a7d9
Capabilities:
Check internet connectivity via wininet
Connect to http server
Create http request
Download and write a file
Get file size
Parse url
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
push 0xd8
mov eax, 0x4296ee
call fcn.004120da
mov eax, dword [ebp + 0x40]
mov dword [ebp - 0x94], eax
mov eax, dword [ebp + 0x44]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp + 0x48]
mov dword [ebp - 0x90], eax
mov edi, 0x42e920
xor ebx, ebx
push edi
lea esi, [ebp - 0x2c]
mov dword [ebp - 4], 1
mov dword [ebp - 0x88], ebx
call fcn.0040b587
push edi
lea esi, [ebp - 0x48]
mov byte [ebp - 4], 2
call fcn.0040b587
mov byte [ebp - 4], 3
mov dword [ebp - 0xa4], ebx
cmp dword [ebp - 0x68], ebx
jne 0x40a842
lea eax, [ebp - 0xa4]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x68]
mov dword [eax], ebx
mov eax, dword [ebp - 0x90]
cmp eax, ebx
je 0x40a853
mov dword [eax], ebx
mov eax, dword [ebp - 0x94]
cmp eax, ebx
je 0x40a85f
mov dword [eax], ebx
xor ecx, ecx
push 2
mov edi, 0x800
pop edx
mov eax, edi
mul edx
seto cl
mov dword [ebp - 0x84], ebx
mov dword [ebp - 0x74], ebx
mov dword [ebp - 0x7c], ebx
mov dword [ebp - 0x70], ebx
neg ecx
or ecx, eax
push ecx
call fcn.0040d87f
mov dword [ebp - 0x6c], eax
mov dword [esp], 0x100000
call fcn.0040d87f
pop ecx
mov dword [ebp - 0x78], eax
cmp eax, ebx
je 0x40acda
cmp dword [ebp - 0x6c], ebx
je 0x40acda
cmp dword [ebp + 0x38], 8
mov eax, dword [ebp + 0x24]
jae 0x40a8b9
lea eax, [ebp + 0x24]
push ebx
push 0x80
push 4
push ebx
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x70], esi
cmp esi, 0xffffffff
jne 0x40a8eb
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x70], ebx
mov dword [eax], 0x3ea
jmp 0x40acf4
push 2
push ebx
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebp - 0x94]
mov dword [ebp - 0xa0], eax
cmp ecx, ebx
je 0x40a910
mov dword [ecx], eax
mov eax, dword [ebp - 0x6c]
push 0x1000
push ebx
push eax
lea esi, [eax + 0x800]
call fcn.0041a070
push 0x3c
lea eax, [ebp - 0xe4]
push ebx
push eax
call fcn.0041a070
mov eax, dword [ebp - 0x6c]
add esp, 0x18
cmp dword [ebp + 0x1c], 8
mov dword [ebp - 0xd4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xe4], 0x3c
mov dword [ebp - 0xd0], edi
mov dword [ebp - 0xb8], esi
mov dword [ebp - 0xb4], edi
jae 0x40a968
lea eax, [ebp + 8]
lea ecx, [ebp - 0xe4]
push ecx
push ebx
push dword [ebp + 0x18]
push eax
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40a97f
sub eax, edx
sar eax, 1
mov ebx, eax
push esi
lea eax, [ebp - 0x2c]
call fcn.0040c629
test al, al
je 0x40a9bb
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x40a9a9
lea eax, [ebp - 0x2c]
sub esi, eax
push ebx
sar esi, 1
lea eax, [ebp - 0x2c]
push esi
mov ecx, eax
call fcn.0040c057
jmp 0x40a9f9
xor edi, edi
push edi
lea eax, [ebp - 0x2c]
call fcn.0040c5bd
test al, al
je 0x40a9fb
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x40a9d6
lea eax, [ebp - 0x2c]
lea edi, [ebx + ebx]
push edi
push esi
push eax
call fcn.004118e0
mov eax, dword [ebp - 0x2c]
add esp, 0xc
cmp dword [ebp - 0x18], 8
mov dword [ebp - 0x1c], ebx
jae 0x40a9f3
lea eax, [ebp - 0x2c]
xor ecx, ecx
mov word [edi + eax], cx
xor edi, edi
mov eax, dword [ebp - 0x6c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40aa01
push dword [ebp - 0x6c]
sub eax, edx
sar eax, 1
mov ebx, eax
lea eax, [ebp - 0x48]
call fcn.0040c629
test al, al
je 0x40aa42
cmp dword [ebp - 0x34], 8
mov eax, dword [ebp - 0x48]
jae 0x40aa2d
lea eax, [ebp - 0x48]
mov ecx, dword [ebp - 0x6c]
sub ecx, eax
sar ecx, 1
push ebx
lea eax, [ebp - 0x48]
push ecx
mov ecx, eax
call fcn.0040c057
jmp 0x40aa80
push edi
lea eax, [ebp - 0x48]
call fcn.0040c5bd
test al, al
je 0x40aa80
cmp dword [ebp - 0x34], 8
mov eax, dword [ebp - 0x48]
jae 0x40aa5b
lea eax, [ebp - 0x48]
lea esi, [ebx + ebx]
push esi
push dword [ebp - 0x6c]
push eax
call fcn.004118e0
mov eax, dword [ebp - 0x48]
add esp, 0xc
cmp dword [ebp - 0x34], 8
mov dword [ebp - 0x38], ebx
jae 0x40aa7a
lea eax, [ebp - 0x48]
xor ecx, ecx
mov word [esi + eax], cx
movzx esi, word [ebp - 0xcc]
push edi
push edi
push edi
push edi
push str.Mozilla_4.0__compatible__MSIE_5.0__Windows_NT_5.0_
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x7c], eax
cmp eax, edi
jne 0x40aaab
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3eb
jmp 0x40acf4
cmp dword [ebp - 0x34], 8
mov eax, dword [ebp - 0x48]
jae 0x40aab7
lea eax, [ebp - 0x48]
push edi
push 0x400000
push 3
push edi
push edi
push esi
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x74], eax
cmp eax, edi
jne 0x40aae1
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3ec
jmp 0x40acf4
push edi
call dword [sym.imp.WININET.dll_InternetAttemptConnect]
test eax, eax
jne 0x40aad3
mov ebx, 0x42e920
push ebx
lea esi, [ebp - 0x64]
call fcn.0040b587
push str.Accept:__r_n
mov eax, esi
push eax
mov byte [ebp - 4], 4
call fcn.0040b5cf
push str.Pragma:no_cache_r_n
mov eax, esi
push eax
call fcn.0040b5cf
push str.Cache_Control:no_cache_r_n
mov eax, esi
push eax
call fcn.0040b5cf
push str.Connection:Keep_Alive_r_n
mov eax, esi
push eax
call fcn.0040b5cf
push dword [ebp - 0xa0]
push str.Range:bytes_d__r_n
push 0x400
push dword [ebp - 0x6c]
call fcn.0040e7a0
add esp, 0x10
push dword [ebp - 0x6c]
mov eax, esi
push eax
call fcn.0040b5cf
push 0x42f3c0
mov eax, esi
push eax
call fcn.0040b5cf
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x40ab71
lea eax, [ebp - 0x2c]
push edi
push edi
push edi
push ebx
push edi
push eax
push 0x42f3c8
push dword [ebp - 0x74]
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
mov dword [ebp - 0x84], esi
cmp esi, edi
jne 0x40abab
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3ed
push 1
xor edi, edi
lea esi, [ebp - 0x64]
call fcn.0040c1b5
jmp 0x40acf4
cmp dword [ebp - 0x50], 8
mov eax, dword [ebp - 0x64]
jae 0x40abb7
lea eax, [ebp - 0x64]
push 0xa0000000
push 0xffffffffffffffff
push eax
push esi
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
test eax, eax
jne 0x40abd5
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3ee
jmp 0x40ab9a
push 4
pop ebx
push ebx
lea eax, [ebp - 0xa8]
push eax
push 2
push esi
mov dword [ebp - 0xa8], 0x7530
call dword [sym.imp.WININET.dll_InternetSetOptionW]
test eax, eax
jne 0x40ac02
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3ef
jmp 0x40ab9a
push edi
push edi
push edi
push edi
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x40ac1f
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3f0
jmp 0x40ab9a
push edi
lea eax, [ebp - 0x9c]
push eax
lea eax, [ebp - 0x98]
push eax
push 0x20000013
push esi
mov dword [ebp - 0x98], edi
mov dword [ebp - 0x9c], ebx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x40ac58
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3f1
jmp 0x40ab9a
xor ebx, ebx
mov dword [ebp - 0x80], edi
mov dword [ebp - 0x8c], edi
lea eax, [ebp - 0x80]
push eax
push 0x100000
push dword [ebp - 0x78]
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, edi
je 0x40acc2
cmp dword [ebp - 0x80], edi
jne 0x40ac8f
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
inc ebx
cmp ebx, 0xa
jg 0x40accc
jmp 0x40ac91
xor ebx, ebx
push edi
lea eax, [ebp - 0x8c]
push eax
push dword [ebp - 0x80]
push dword [ebp - 0x78]
push dword [ebp - 0x70]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40acb7
mov eax, dword [ebp - 0x8c]
cmp eax, dword [ebp - 0x80]
je 0x40ac63
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3f2
jmp 0x40accc
mov dword [ebp - 0x88], 1
push 1
xor edi, edi
lea esi, [ebp - 0x64]
call fcn.0040c1b5
jmp 0x40ace3
mov eax, dword [ebp - 0x68]
mov dword [eax], 0x3e9
xor edi, edi
cmp dword [ebp - 0x88], edi
je 0x40acf4
mov eax, dword [ebp - 0x68]
cmp dword [eax], edi
je 0x40ad08
mov esi, dword [ebp - 0x90]
xor edi, edi
cmp esi, edi
je 0x40ad08
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi], eax
cmp dword [ebp - 0x78], edi
je 0x40ad16
push dword [ebp - 0x78]
call fcn.0040e17b
pop ecx
cmp dword [ebp - 0x6c], edi
je 0x40ad24
push dword [ebp - 0x6c]
call fcn.0040e17b
pop ecx
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x84], edi
je 0x40ad3a
push dword [ebp - 0x84]
call esi
cmp dword [ebp - 0x74], edi
je 0x40ad44
push dword [ebp - 0x74]
call esi
cmp dword [ebp - 0x7c], edi
je 0x40ad4e
push dword [ebp - 0x7c]
call esi
cmp dword [ebp - 0x70], edi
je 0x40ad5c
push dword [ebp - 0x70]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
inc ebx
push ebx
xor edi, edi
lea esi, [ebp - 0x48]
call fcn.0040c1b5
push ebx
lea esi, [ebp - 0x2c]
call fcn.0040c1b5
push ebx
lea esi, [ebp + 8]
call fcn.0040c1b5
push ebx
lea esi, [ebp + 0x24]
call fcn.0040c1b5
mov eax, dword [ebp - 0x88]
call fcn.0041215d
ret 0x44