Function at 0x40945f
Capabilities:
Check http status code
Check internet connectivity via wininet
Create http request
Download and write a file
Inspect section memory permissions
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov dword [ebp - 4], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x40], 0
push dword [ebp + 8]
call fcn.00408ac5
and eax, 1
xor eax, 1
test eax, eax
je 0x4094f8
mov eax, 0
jmp 0x409da3
mov dword [ebp - 0x44], esp
push 0
lea eax, [ebp - 4]
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409520
push 6
call fcn.0044f0de
add esp, 4
push 0x80000301
push 0
push 4
push 0x80000301
push 0
push dword [ebp - 4]
push 2
mov ebx, 0xc4
call fcn.00454370
add esp, 0x1c
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0
jne 0x409628
push 0x80000101
push 0
push 0
push 1
mov ebx, 0x140
call fcn.00453c60
add esp, 0x10
mov dword [ebp - 0x44], eax
push 0x80000101
push 0
push 0
push 1
mov ebx, 0x140
call fcn.00453c60
add esp, 0x10
mov dword [ebp - 0x48], eax
push 0x80000101
push 0
push 0
push 1
mov ebx, 0x140
call fcn.00453c60
add esp, 0x10
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], esp
push 0
push dword [ebp - 0x4c]
push dword [ebp - 0x48]
push 4
push dword [ebp - 0x44]
call dword [sym.imp.WININET.dll_InternetOpenA]
nop
nop
nop
nop
cmp dword [ebp - 0x50], esp
je 0x4095ea
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x54], eax
mov ebx, dword [ebp - 0x44]
test ebx, ebx
je 0x4095fd
push ebx
call fcn.0044f0d8
add esp, 4
mov ebx, dword [ebp - 0x48]
test ebx, ebx
je 0x40960d
push ebx
call fcn.0044f0d8
add esp, 4
mov ebx, dword [ebp - 0x4c]
test ebx, ebx
je 0x40961d
push ebx
call fcn.0044f0d8
add esp, 4
mov eax, dword [ebp - 0x54]
mov dword [ebp - 8], eax
jmp 0x4096f6
push 0x80000101
push 0
push 0
push 1
mov ebx, 0x140
call fcn.00453c60
add esp, 0x10
mov dword [ebp - 0x44], eax
push 0x80000101
push 0
push 0
push 1
mov ebx, 0x140
call fcn.00453c60
add esp, 0x10
mov dword [ebp - 0x48], eax
push 0x80000101
push 0
push 0
push 1
mov ebx, 0x140
call fcn.00453c60
add esp, 0x10
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], esp
push 0
push dword [ebp - 0x4c]
push dword [ebp - 0x48]
push 0
push dword [ebp - 0x44]
call dword [sym.imp.WININET.dll_InternetOpenA]
nop
nop
nop
nop
cmp dword [ebp - 0x50], esp
je 0x4096bd
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x54], eax
mov ebx, dword [ebp - 0x44]
test ebx, ebx
je 0x4096d0
push ebx
call fcn.0044f0d8
add esp, 4
mov ebx, dword [ebp - 0x48]
test ebx, ebx
je 0x4096e0
push ebx
call fcn.0044f0d8
add esp, 4
mov ebx, dword [ebp - 0x4c]
test ebx, ebx
je 0x4096f0
push ebx
call fcn.0044f0d8
add esp, 4
mov eax, dword [ebp - 0x54]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40970a
mov eax, 0
jmp 0x409da3
mov eax, 0x4a3c0f
push eax
mov ebx, dword [ebp - 0xc]
test ebx, ebx
je 0x409720
push ebx
call fcn.0044f0d8
add esp, 4
pop eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x44], esp
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409746
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x48], eax
push 0x80000301
push 0
push SysReAllocString
push 0x80000301
push 0
push 0x100
push 0x80000301
push 0
push 0x4000000
push 3
mov ebx, 0xc8
call fcn.00453d90
add esp, 0x28
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], esp
push 0
push dword [ebp - 0x4c]
push dword [ebp - 0x48]
push dword [ebp - 0xc]
mov ebx, dword [ebp + 8]
push dword [ebx]
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
nop
nop
nop
nop
cmp dword [ebp - 0x50], esp
je 0x4097b7
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4097f0
mov dword [ebp - 0x44], esp
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x4097e6
push 6
call fcn.0044f0de
add esp, 4
mov eax, 0
jmp 0x409da3
cmp dword [ebp + 0x20], 0
je 0x409a97
push 0x80000301
push 0
push 0xa
push 1
mov ebx, 0x1bc
call fcn.004543b0
add esp, 0x10
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x44]
push eax
mov ebx, dword [ebp - 0x14]
test ebx, ebx
je 0x40982f
push ebx
call fcn.0044f0d8
add esp, 4
pop eax
mov dword [ebp - 0x14], eax
push VariantCopy
push 0
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x409846
mov eax, 0x476373
push eax
push 1
mov ebx, 0x194
call fcn.00454f10
add esp, 0x10
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x44], esp
push 0
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x409872
add eax, 8
push eax
push 0x13
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409897
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jne 0x4098f2
mov dword [ebp - 0x44], esp
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x4098c6
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x44], esp
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x4098e8
push 6
call fcn.0044f0de
add esp, 4
mov eax, 0
jmp 0x409da3
push 0
push 0
push 0
push 0x80000301
push 0
push 0xa
push VariantCopy
push 0
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x409917
mov eax, 0x476373
push eax
push 3
mov ebx, 0x19c
call fcn.00455070
add esp, 0x28
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], edx
mov dword [ebp - 0x44], ecx
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x4c]
cmp ecx, reloc.WS2_32.dll_connect
jne 0x40994f
test eax, eax
jne 0x409960
mov eax, 0x4762fd
jmp 0x409960
cmp ecx, 0x80000005
jne 0x409960
test eax, eax
jne 0x409960
mov eax, 0x476373
push ecx
push edx
push eax
push 1
mov ebx, 0x9dc
call fcn.00454e30
add esp, 0x10
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 0x44]
cmp ecx, reloc.WS2_32.dll_connect
je 0x40998f
cmp ecx, 0x80000005
jne 0x40999f
mov ebx, dword [ebp - 0x4c]
test ebx, ebx
je 0x40999f
push ebx
call fcn.0044f0d8
add esp, 4
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0x190
jle 0x4099c6
cmp dword [ebp - 0x1c], 0x1f4
jge 0x4099c6
mov eax, 1
jmp 0x4099c8
xor eax, eax
test eax, eax
je 0x409a1e
mov dword [ebp - 0x44], esp
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x4099f2
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x44], esp
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409a14
push 6
call fcn.0044f0de
add esp, 4
mov eax, 0
jmp 0x409da3
cmp dword [ebp - 0x1c], 0x1f4
jle 0x409a3f
cmp dword [ebp - 0x1c], 0x258
jge 0x409a3f
mov eax, 1
jmp 0x409a41
xor eax, eax
test eax, eax
je 0x409a97
mov dword [ebp - 0x44], esp
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409a6b
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x44], esp
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409a8d
push 6
call fcn.0044f0de
add esp, 4
mov eax, 0
jmp 0x409da3
mov dword [ebp - 0x20], 4
push 0x80000301
push 0
push 0x20000000
push 0x80000301
push 0
push 5
push 2
mov ebx, 0xc8
call fcn.00453d90
add esp, 0x1c
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x48], esp
push 0
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x44]
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
nop
nop
nop
nop
cmp dword [ebp - 0x48], esp
je 0x409afd
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jne 0x409b11
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x44], esp
push 0
push 0x20
push 2
push 0
push 0
push 0x40000000
mov ebx, dword [ebp + 0xc]
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409b53
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xffffffff
jne 0x409bae
mov dword [ebp - 0x44], esp
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409b82
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x44], esp
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409ba4
push 6
call fcn.0044f0de
add esp, 4
mov eax, 0
jmp 0x409da3
push 0x80000301
push 0
push 0x1000
push 1
mov ebx, 0x1bc
call fcn.004543b0
add esp, 0x10
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x44]
push eax
mov ebx, dword [ebp - 0x2c]
test ebx, ebx
je 0x409be3
push ebx
call fcn.0044f0d8
add esp, 4
pop eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x44], esp
lea eax, [ebp - 0x30]
push eax
push 0x1000
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x409c04
add eax, 8
push eax
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetReadFile]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409c24
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 1
jne 0x409c42
cmp dword [ebp - 0x30], 0
jne 0x409c42
mov eax, 1
jmp 0x409c44
xor eax, eax
test eax, eax
je 0x409c58
mov dword [ebp - 0x38], 1
jmp 0x409d35
cmp dword [ebp - 0x30], 0
jne 0x409c6e
mov dword [ebp - 0x38], 0
jmp 0x409d35
mov dword [ebp - 0x44], esp
push 0
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x409c87
add eax, 8
push eax
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409ca7
push 6
call fcn.0044f0de
add esp, 4
fild dword [ebp - 0x40]
fstp qword [ebp - 0x48]
fld qword [ebp - 0x48]
fild dword [ebp - 0x3c]
fstp qword [ebp - 0x50]
fadd qword [ebp - 0x50]
fstp qword [ebp - 0x58]
fld qword [ebp - 0x58]
call fcn.00401142
mov dword [ebp - 0x40], eax
cmp dword [ebp + 0x10], 0
je 0x409d30
mov dword [ebp - 0x44], 0
push 0
push dword [ebp - 0x44]
mov dword [ebp - 0x48], 0
push 0
push dword [ebp - 0x48]
mov dword [ebp - 0x4c], 0
push 0
push dword [ebp - 0x4c]
mov dword [ebp - 0x50], 0
push 0
push dword [ebp - 0x50]
mov dword [ebp - 0x54], 0
push 0
push dword [ebp - 0x54]
mov dword [ebp - 0x58], 0
push 0
push dword [ebp - 0x58]
push 1
push dword [ebp + 0x18]
push 1
push dword [ebp - 0x40]
push 1
push dword [ebp - 0x24]
push dword [ebp + 0x10]
call fcn.004073fe
jmp 0x409bee
mov dword [ebp - 0x44], esp
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409d57
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x44], esp
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409d79
push 6
call fcn.0044f0de
add esp, 4
mov dword [ebp - 0x44], esp
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
nop
nop
nop
nop
cmp dword [ebp - 0x44], esp
je 0x409d9b
push 6
call fcn.0044f0de
add esp, 4
mov eax, dword [ebp - 0x38]
jmp 0x409da3
push eax
mov ebx, dword [ebp - 0xc]
test ebx, ebx
je 0x409db4
push ebx
call fcn.0044f0d8
add esp, 4
mov ebx, dword [ebp - 0x14]
test ebx, ebx
je 0x409dc4
push ebx
call fcn.0044f0d8
add esp, 4
mov ebx, dword [ebp - 0x2c]
test ebx, ebx
je 0x409dd4
push ebx
call fcn.0044f0d8
add esp, 4
pop eax
mov esp, ebp
pop ebp
ret 0x20