Function at 0x403270
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 0x46462c
mov eax, dword fs:[0]
push eax
mov eax, 0x10a0
call fcn.00440940
mov eax, dword [0x49806c]
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]
xor ecx, ecx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1050], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1038], ecx
mov dword [ebp - 0x1068], eax
mov dword [ebp - 0x1048], ecx
cmp dword [ebx], ecx
jne 0x403bc9
push ecx
mov edx, 0x477668
lea ecx, [ebp - 0x1038]
call fcn.0040fa80
add esp, 4
lea ecx, [edi + 8]
mov dword [ebp - 4], 0
push eax
mov dword [ebp - 0x1064], ecx
call fcn.00406a60
mov dword [ebp - 4], 0xffffffff
or esi, 0xffffffff
mov edx, dword [ebp - 0x1038]
mov eax, esi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x403320
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [ebp - 0x1038]
mov dword [ebp - 0x1038], 8
push eax
lea eax, [ebp - 0x1060]
push eax
push 0x32
push 0
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
test eax, eax
je 0x403bd7
mov eax, dword [ebp - 0x1060]
and eax, 1
je 0x403bd7
push 0
lea eax, [ebp - 0x1038]
mov dword [ebp - 0x1038], 0
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test eax, eax
je 0x403bd0
test byte [ebp - 0x1038], 0x20
jne 0x403bd0
cmp dword [ebx], 0
jne 0x403bc9
push ecx
mov edx, 0x477684
lea ecx, [ebp - 0x103c]
call fcn.0040fa80
add esp, 4
mov dword [ebp - 4], 1
mov ecx, 0x477690
mov eax, dword [edi + 4]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4033d9
test dx, dx
je 0x4033d5
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4033d9
add eax, 4
add ecx, 4
test dx, dx
jne 0x4033b3
xor eax, eax
jmp 0x4033de
sbb eax, eax
or eax, 1
test eax, eax
setne al
test al, al
jne 0x4033ed
cmp dword [edi + 0x54], 0
je 0x403430
push ecx
mov edx, 0x477694
lea ecx, [ebp - 0x1038]
call fcn.0040fa80
add esp, 4
push eax
lea ecx, [ebp - 0x103c]
mov byte [ebp - 4], 2
call fcn.00406a60
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x1038]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x403430
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
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 0x403458
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 0x403474
lea ecx, [ebp - 0x103c]
call fcn.00406490
lea eax, [esi + 6]
jmp 0x403bdc
cmp dword [ebx], 0
jne 0x403bbe
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 0x4034ee
push ecx
mov edx, 0x4776a8
lea ecx, [ebp - 0x1044]
call fcn.0040fa80
mov esi, eax
mov edx, 0x4776cc
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x1038]
call fcn.0040fa80
add esp, 4
push esi
push eax
mov ecx, edi
mov byte [ebp - 4], 4
call fcn.00404a10
lea ecx, [ebp - 0x1038]
call fcn.00406490
lea ecx, [ebp - 0x1044]
mov byte [ebp - 4], 1
call fcn.00406490
cmp dword [ebx], 0
jne 0x403bbe
lea eax, [edi + 0x30]
push eax
lea eax, [ebp - 0x1040]
push eax
call fcn.00404300
mov byte [ebp - 4], 5
lea edx, [ebp - 0x10a8]
mov ecx, dword [ebp - 0x1050]
call fcn.004120e0
test eax, eax
jne 0x403540
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
mov eax, 8
jmp 0x403bdc
push 0
push 0
push 3
push 0x4776f8
push 0x4776fc
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 - 0x1044], esi
mov byte [ebp - 4], 6
test esi, esi
jne 0x40359e
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
lea eax, [esi + 7]
jmp 0x403bdc
cmp dword [ebx], 0
jne 0x403ba8
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 - 0x1050], eax
je 0x403610
push ecx
mov edx, 0x477700
lea ecx, [ebp - 0x105c]
call fcn.0040fa80
add esp, 4
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x1034]
push dword [eax]
mov dword [ebp - 0x1038], 1
call fcn.004062f0
mov ecx, 3
mov dword [ebp - 0x1048], ecx
cmp dword [eax + 0x14], 8
jb 0x403612
mov eax, dword [eax]
jmp 0x403612
xor eax, eax
push 0
push dword [ebp - 0x1050]
push 0
push 0
push eax
push dword [ebp - 0x107c]
push dword [ebp - 0x103c]
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
mov dword [ebp - 0x1038], esi
mov dword [ebp - 4], 8
mov eax, dword [ebp - 0x1048]
test al, 2
je 0x403665
and eax, 0xfffffffd
lea ecx, [ebp - 0x1034]
mov dword [ebp - 0x1048], eax
call fcn.00407030
mov eax, dword [ebp - 0x1048]
mov byte [ebp - 4], 9
test al, 1
je 0x403678
lea ecx, [ebp - 0x105c]
call fcn.00406490
test esi, esi
jne 0x4036b0
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
lea eax, [esi + 9]
jmp 0x403bdc
cmp dword [ebx], 0
jne 0x403b9d
push ecx
mov edx, 0x47771c
lea ecx, [ebp - 0x1050]
call fcn.0040fa80
add esp, 4
lea ecx, [ebp - 0x103c]
mov edx, eax
call fcn.00406600
lea ecx, [ebp - 0x1050]
mov bl, al
call fcn.00406490
test bl, bl
je 0x403704
mov eax, dword [ebp - 0x1040]
push 0
push 0
push dword [eax - 0xc]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
mov ebx, eax
jmp 0x40377b
mov ecx, dword [edi + 0x54]
test ecx, ecx
je 0x403724
mov eax, dword [ebp - 0x1040]
push ecx
push dword [edi + 0x50]
push dword [eax - 0xc]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
mov ebx, eax
jmp 0x40377b
lea edx, [edi + 4]
lea ecx, [ebp - 0x1048]
call fcn.00412160
mov byte [ebp - 4], 0xa
mov ecx, dword [ebp - 0x1048]
cmp dword [ecx - 4], 1
mov ebx, dword [ecx - 0xc]
jle 0x403757
push ebx
lea ecx, [ebp - 0x1048]
call fcn.00407490
mov ecx, dword [ebp - 0x1048]
mov eax, dword [ebp - 0x1040]
push ebx
push ecx
push dword [eax - 0xc]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
lea ecx, [ebp - 0x1048]
mov byte [ebp - 4], 9
mov ebx, eax
call fcn.00406490
test ebx, ebx
jne 0x4037b3
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
lea eax, [ebx + 0xa]
jmp 0x403bdc
mov ebx, dword [ebp + 0x10]
cmp dword [ebx], 0
jne 0x403b9d
lea eax, [ebp - 0x1050]
mov dword [ebp - 0x1050], esi
push eax
lea eax, [ebp - 0x104c]
push eax
call fcn.00403df0
lea eax, [ebp - 0x105c]
mov byte [ebp - 4], 0xb
push eax
lea eax, [ebp - 0x1050]
mov dword [ebp - 0x105c], esi
push eax
call fcn.00403c00
push eax
lea ecx, [edi + 8]
mov byte [ebp - 4], 0xc
call fcn.00406a60
lea ecx, [ebp - 0x1050]
mov byte [ebp - 4], 0xb
call fcn.00406490
lea eax, [ebp - 0x105c]
mov dword [ebp - 0x105c], esi
push eax
mov ecx, edi
call fcn.00403cf0
test eax, eax
jne 0x40386a
lea ecx, [ebp - 0x104c]
call fcn.00406490
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
mov eax, 0xb
jmp 0x403bdc
lea eax, [edi + 0x28]
push eax
lea eax, [ebp - 0x104c]
push eax
call fcn.00403ee0
cmp dword [ebx], 0
jne 0x403b92
xor edi, edi
mov dword [ebp - 0x1060], edi
mov dword [ebp - 0x105c], edi
mov byte [ebp - 4], 0xd
cmp dword [ebp + 0x18], edi
je 0x403923
mov eax, dword [ebp - 0x1068]
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 - 0x1060], edi
cmp edi, 0xffffffff
jne 0x403923
mov ecx, dword [ebp - 0x1064]
push 1
push 0x477728
call fcn.00407a80
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0x104c]
call fcn.00406490
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
mov eax, 0xd
jmp 0x403bdc
push 0x1001
lea eax, [ebp - 0x101c]
mov dword [ebp - 0x1058], 0
push 0
push eax
call fcn.00441bb0
add esp, 0xc
lea ecx, [ebp - 0x1054]
push 0x475d8e
call fcn.004064b0
mov ecx, dword [ebp - 0x1068]
push 0
mov byte [ebp - 4], 0xe
push 0x47772c
mov dword [ebp - 0x1048], 0
call fcn.00407a80
mov eax, dword [ebp - 0x1058]
test eax, eax
jne 0x40398a
cmp dword [ebp - 0x1048], 1
je 0x403aa3
cmp dword [ebx], 0
jne 0x403b7c
lea eax, [ebp - 0x1058]
push eax
push 0x1000
lea eax, [ebp - 0x101c]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov dword [ebp - 0x1048], eax
test eax, eax
je 0x403b28
mov eax, dword [ebp - 0x1058]
test eax, eax
je 0x40397d
cmp eax, 0x1000
jbe 0x4039d6
xor eax, eax
mov dword [ebp - 0x1058], eax
jmp 0x4039e1
cmp eax, 0x1001
jae 0x403b23
cmp dword [ebx], 0
mov byte [ebp + eax - 0x101c], 0
jne 0x403b7c
cmp dword [ebp + 0x18], 0
jne 0x403a22
lea ecx, [ebp - 0x101c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403a01
sub ecx, edx
lea eax, [ebp - 0x101c]
push ecx
push eax
lea ecx, [ebp - 0x1054]
call fcn.00407520
jmp 0x403973
push 0
lea ecx, [ebp - 0x1064]
mov dword [ebp - 0x1064], 0
push ecx
push eax
lea eax, [ebp - 0x101c]
push eax
push edi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
jne 0x403973
lea ecx, [ebp - 0x1054]
call fcn.00406490
test edi, edi
je 0x403a62
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0x104c]
call fcn.00406490
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
mov eax, 0xe
jmp 0x403bdc
mov edx, dword [ebp - 0x1054]
lea ecx, [ebp - 0x1064]
call fcn.00412300
mov ecx, dword [ebp - 0x1068]
push eax
mov byte [ebp - 4], 0x10
call fcn.00406a60
lea ecx, [ebp - 0x1064]
call fcn.00406490
lea ecx, [ebp - 0x1054]
call fcn.00406490
test edi, edi
je 0x403ae5
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0x104c]
call fcn.00406490
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
xor eax, eax
jmp 0x403bdc
call fcn.0043fa63
lea ecx, [ebp - 0x1054]
call fcn.00406490
test edi, edi
je 0x403b3e
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0x104c]
call fcn.00406490
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
mov eax, 0xc
jmp 0x403bdc
lea ecx, [ebp - 0x1054]
call fcn.00406490
test edi, edi
je 0x403b92
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0x104c]
call fcn.00406490
lea ecx, [ebp - 0x1038]
call fcn.00405ec0
lea ecx, [ebp - 0x1044]
call fcn.00405ec0
lea ecx, [ebp - 0x1040]
call fcn.00406490
lea ecx, [ebp - 0x103c]
call fcn.00406490
mov eax, 0xf
jmp 0x403bdc
mov eax, 5
jmp 0x403bdc
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.0043f6c1
mov esp, ebp
pop ebp
ret 0x14