Function at 0x40e2b0
Capabilities:
Check http status code
Create http request
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:
push ebp
mov ebp, esp
sub esp, 0x14c
mov eax, dword [0x413008]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x28], 0x10
push 0
push 0
push 0
push 1
push 0x4157e8
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x40e326
mov dword [ebp - 0x3c], 1
jmp 0x40e527
push 0
push SysReAllocString
push 0
push 0
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov dword [ebp - 0x14c], eax
cmp dword [ebp - 0x14c], 0
jne 0x40e35a
mov dword [ebp - 0x3c], 2
jmp 0x40e527
push 0
lea edx, [ebp - 0x28]
push edx
lea eax, [ebp - 0x24]
push eax
push 0x13
mov ecx, dword [ebp - 0x14c]
push ecx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
lea edx, [ebp - 0x24]
push edx
call fcn.00401825
add esp, 4
cmp eax, 0xc8
je 0x40e392
mov dword [ebp - 0x3c], 3
jmp 0x40e527
push 0
push 0x80
push 2
push 0
push 1
push 0xc0000000
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jne 0x40e3c3
mov dword [ebp - 0x3c], 4
jmp 0x40e527
mov dword [ebp - 0x30], 4
push 0
lea ecx, [ebp - 0x30]
push ecx
lea edx, [ebp - 0x34]
push edx
push 0x20000005
mov eax, dword [ebp - 0x14c]
push eax
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
cmp dword [ebp - 0x34], 0
jne 0x40e3f8
mov dword [ebp - 0x3c], 5
jmp 0x40e527
mov ecx, dword [ebp - 0x34]
shr ecx, 8
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
and edx, 0xffff
movzx eax, dx
shl eax, 0x10
push eax
push 0
push 0x401
mov ecx, dword [0x418cf8]
push ecx
call dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 0
push 0x402
mov edx, dword [0x418cf8]
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 1
push 0x404
mov eax, dword [0x418cf8]
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
lea ecx, [ebp - 0x34]
push ecx
push 0x100
lea edx, [ebp - 0x148]
push edx
mov eax, dword [ebp - 0x14c]
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40e4b3
cmp dword [ebp - 0x34], 0
jbe 0x40e4b3
push 0
lea ecx, [ebp - 0x40]
push ecx
mov edx, dword [ebp - 0x34]
push edx
lea eax, [ebp - 0x148]
push eax
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push 0
push 0x405
mov edx, dword [0x418cf8]
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x34]
mov dword [ebp - 0x2c], eax
jmp 0x40e450
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x38], 0
mov eax, dword [ebp - 0x14c]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [ebp - 0x14c], 0
push 0
mov ecx, dword [ebp - 0x30]
push ecx
push 0x402
mov edx, dword [0x418cf8]
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
cmp dword [ebp - 0x2c], 0
jne 0x40e50c
mov dword [ebp - 0x3c], 6
jmp 0x40e527
cmp dword [ebp + 0x10], 0
je 0x40e527
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040f330
cmp eax, dword [ebp + 0x10]
je 0x40e527
mov dword [ebp - 0x3c], 7
cmp dword [ebp - 0x44], 0
je 0x40e537
mov ecx, dword [ebp - 0x44]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x14c], 0
je 0x40e54d
mov edx, dword [ebp - 0x14c]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x38], 0
je 0x40e55d
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401006
mov esp, ebp
pop ebp
ret 0xc