Function at 0x403240
Capabilities:
Check internet connectivity via wininet
Connect to http server
Create http request
Download and write a file
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 ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4612c4
mov eax, dword fs:[0]
push eax
mov eax, 0x10a0
call fcn.0043d5f0
mov eax, dword [0x49106c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1040], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1044], 0
cmp dword [ebx], 0
mov dword [ebp - 0x1064], eax
jne 0x403ae9
lea eax, [edi + 8]
push 7
push 0x47363c
mov ecx, eax
mov dword [ebp - 0x1068], eax
call fcn.004076f0
lea eax, [ebp - 0x1048]
mov dword [ebp - 0x1048], 8
push eax
lea eax, [ebp - 0x1058]
push eax
push 0x32
push 0
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
test eax, eax
je 0x403af7
mov eax, dword [ebp - 0x1058]
and eax, 1
je 0x403af7
push 0
lea eax, [ebp - 0x1048]
mov dword [ebp - 0x1048], 0
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test eax, eax
je 0x403af0
test byte [ebp - 0x1048], 0x20
jne 0x403af0
cmp dword [ebx], 0
jne 0x403ae9
push 0x47364c
lea ecx, [ebp - 0x1038]
call fcn.00406700
mov dword [ebp - 4], 0
mov ecx, 0x473654
mov eax, dword [edi + 4]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x403368
test dx, dx
je 0x403364
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x403368
add eax, 4
add ecx, 4
test dx, dx
jne 0x403342
xor eax, eax
jmp 0x40336d
sbb eax, eax
or eax, 1
test eax, eax
setne al
test al, al
jne 0x40337c
cmp dword [edi + 0x54], 0
je 0x40338e
push 4
push 0x473658
lea ecx, [ebp - 0x1038]
call fcn.004076f0
push 0
push 0
push 0
push 0
push dword [edi + 0x44]
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ecx, dword [edi + 0xc]
mov esi, eax
test ecx, ecx
je 0x4033b6
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [edi + 0xc], 0
mov eax, esi
mov dword [edi + 0xc], esi
test eax, eax
jne 0x4033d2
lea ecx, [ebp - 0x1038]
call fcn.004061b0
lea eax, [esi + 6]
jmp 0x403afc
cmp dword [ebx], 0
jne 0x403ade
push 4
lea ecx, [ebp - 0x106c]
mov dword [ebp - 0x106c], 1
push ecx
push 0x41
push eax
call dword [sym.imp.WININET.dll_InternetSetOptionW]
test eax, eax
je 0x403452
push 0x473664
lea ecx, [ebp - 0x1054]
call fcn.00406700
push 0x473680
lea ecx, [ebp - 0x1048]
mov byte [ebp - 4], 1
call fcn.00406700
lea eax, [ebp - 0x1054]
mov byte [ebp - 4], 2
push eax
lea eax, [ebp - 0x1048]
mov ecx, edi
push eax
call fcn.00404860
lea ecx, [ebp - 0x1048]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
mov byte [ebp - 4], 0
call fcn.004061b0
cmp dword [ebx], 0
jne 0x403ade
lea eax, [edi + 0x30]
push eax
lea eax, [ebp - 0x103c]
push eax
call fcn.00404180
mov byte [ebp - 4], 3
lea edx, [ebp - 0x10a8]
mov ecx, dword [ebp - 0x1040]
call fcn.00411460
test eax, eax
jne 0x4034a4
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 8
jmp 0x403afc
push 0
push 0
push 3
push 0x4736a0
push 0x4736a4
push dword [ebp - 0x1090]
push dword [ebp - 0x1098]
push dword [edi + 0xc]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov esi, eax
mov dword [ebp - 0x1040], esi
mov byte [ebp - 4], 4
test esi, esi
jne 0x403502
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
lea eax, [esi + 7]
jmp 0x403afc
cmp dword [ebx], 0
jne 0x403ac8
mov edx, 0x1bb
mov eax, 0x84403300
cmp word [ebp - 0x1090], dx
mov ecx, 0x84c03300
cmove eax, ecx
cmp dword [edi + 0x4c], 0
mov dword [ebp - 0x1048], eax
je 0x403554
push 0x4736a8
lea ecx, [ebp - 0x1034]
call fcn.00406010
mov dword [ebp - 0x1044], 1
cmp dword [eax + 0x14], 8
jb 0x403556
mov eax, dword [eax]
jmp 0x403556
xor eax, eax
push 0
push dword [ebp - 0x1048]
push 0
push 0
push eax
push dword [ebp - 0x107c]
push dword [ebp - 0x1038]
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
mov dword [ebp - 0x1054], esi
mov byte [ebp - 4], 5
test byte [ebp - 0x1044], 1
je 0x403596
lea ecx, [ebp - 0x1034]
call fcn.00406d00
test esi, esi
jne 0x4035ce
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
lea eax, [esi + 9]
jmp 0x403afc
cmp dword [ebx], 0
jne 0x403abd
mov eax, dword [ebp - 0x1038]
mov ecx, 0x4736bc
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x403608
test dx, dx
je 0x403604
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x403608
add eax, 4
add ecx, 4
test dx, dx
jne 0x4035e2
xor eax, eax
jmp 0x40360d
sbb eax, eax
or eax, 1
test eax, eax
sete al
test al, al
je 0x403630
mov eax, dword [ebp - 0x103c]
push 0
push 0
push dword [eax - 0xc]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
jmp 0x4036ba
mov ecx, dword [edi + 0x54]
test ecx, ecx
je 0x40364e
mov eax, dword [ebp - 0x103c]
push ecx
push dword [edi + 0x50]
push dword [eax - 0xc]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
jmp 0x4036ba
lea edx, [edi + 4]
lea ecx, [ebp - 0x1048]
call fcn.004114e0
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x1048]
cmp dword [ecx - 4], 1
mov eax, dword [ecx - 0xc]
mov dword [ebp - 0x1044], eax
jle 0x403687
push eax
lea ecx, [ebp - 0x1048]
call fcn.00407160
mov ecx, dword [ebp - 0x1048]
push dword [ebp - 0x1044]
mov eax, dword [ebp - 0x103c]
push ecx
push dword [eax - 0xc]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
lea ecx, [ebp - 0x1048]
mov dword [ebp - 0x1044], eax
mov byte [ebp - 4], 5
call fcn.004061b0
mov eax, dword [ebp - 0x1044]
test eax, eax
jne 0x4036f4
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 0xa
jmp 0x403afc
cmp dword [ebx], 0
jne 0x403abd
lea eax, [ebp - 0x1044]
mov dword [ebp - 0x1044], esi
push eax
lea eax, [ebp - 0x1050]
push eax
call fcn.00403ca0
lea eax, [ebp - 0x1044]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0x1048]
mov dword [ebp - 0x1044], esi
push eax
call fcn.00403b20
push eax
lea ecx, [edi + 8]
mov byte [ebp - 4], 8
call fcn.00406690
lea ecx, [ebp - 0x1048]
mov byte [ebp - 4], 7
call fcn.004061b0
lea eax, [ebp - 0x1044]
mov dword [ebp - 0x1044], esi
push eax
mov ecx, edi
call fcn.00403c10
test eax, eax
jne 0x4037a8
lea ecx, [ebp - 0x1050]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 0xb
jmp 0x403afc
lea eax, [edi + 0x28]
push eax
lea eax, [ebp - 0x1050]
push eax
call fcn.00403d90
cmp dword [ebx], 0
jne 0x403ab2
xor edi, edi
mov dword [ebp - 0x104c], edi
mov dword [ebp - 0x1048], edi
mov byte [ebp - 4], 9
cmp dword [ebp + 0x18], edi
je 0x403861
mov eax, dword [ebp - 0x1064]
push edi
push 0x80
push 2
push edi
push 3
push 0x40000000
push dword [eax]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x104c], edi
cmp edi, 0xffffffff
jne 0x403861
mov ecx, dword [ebp - 0x1068]
push 1
push 0x4736c4
call fcn.004076f0
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x1050]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 0xd
jmp 0x403afc
push 0x1001
lea eax, [ebp - 0x101c]
mov dword [ebp - 0x1060], 0
push 0
push eax
call fcn.0043e860
add esp, 0xc
lea ecx, [ebp - 0x105c]
push 0x471d6e
call fcn.004061d0
mov ecx, dword [ebp - 0x1064]
xor ebx, ebx
push ebx
push 0x4736c8
mov byte [ebp - 4], 0xa
call fcn.004076f0
mov eax, dword [ebp - 0x1060]
test eax, eax
jne 0x4038bb
cmp ebx, 1
je 0x4039c3
mov eax, dword [ebp + 0x10]
cmp dword [eax], 0
jne 0x403a9c
lea eax, [ebp - 0x1060]
push eax
push 0x1000
lea eax, [ebp - 0x101c]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov ebx, eax
test ebx, ebx
je 0x403a48
mov eax, dword [ebp - 0x1060]
test eax, eax
je 0x4038b2
cmp eax, 0x1000
jbe 0x403906
xor eax, eax
mov dword [ebp - 0x1060], eax
jmp 0x403911
cmp eax, 0x1001
jae 0x403a43
mov ecx, dword [ebp + 0x10]
mov byte [ebp + eax - 0x101c], 0
cmp dword [ecx], 0
jne 0x403a9c
cmp dword [ebp + 0x18], 0
jne 0x403942
lea eax, [ebp - 0x101c]
push eax
lea ecx, [ebp - 0x105c]
call fcn.00406970
jmp 0x4038a8
push 0
lea ecx, [ebp - 0x1068]
mov dword [ebp - 0x1068], 0
push ecx
push eax
lea eax, [ebp - 0x101c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4038a8
lea ecx, [ebp - 0x105c]
call fcn.004061b0
test edi, edi
je 0x403982
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x1050]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 0xe
jmp 0x403afc
mov edx, dword [ebp - 0x105c]
lea ecx, [ebp - 0x1044]
call fcn.00411680
mov ecx, dword [ebp - 0x1064]
push eax
mov byte [ebp - 4], 0xc
call fcn.00406690
lea ecx, [ebp - 0x1044]
call fcn.004061b0
lea ecx, [ebp - 0x105c]
call fcn.004061b0
test edi, edi
je 0x403a05
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x1050]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
xor eax, eax
jmp 0x403afc
call fcn.0043c70e
lea ecx, [ebp - 0x105c]
call fcn.004061b0
test edi, edi
je 0x403a5e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x1050]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 0xc
jmp 0x403afc
lea ecx, [ebp - 0x105c]
call fcn.004061b0
test edi, edi
je 0x403ab2
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x1050]
call fcn.004061b0
lea ecx, [ebp - 0x1054]
call fcn.00405be0
lea ecx, [ebp - 0x1040]
call fcn.00405be0
lea ecx, [ebp - 0x103c]
call fcn.004061b0
lea ecx, [ebp - 0x1038]
call fcn.004061b0
mov eax, 0xf
jmp 0x403afc
mov eax, 5
jmp 0x403afc
mov eax, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0043c397
mov esp, ebp
pop ebp
ret 0x14