Function at 0x40e0f0
Capabilities:
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
Resolve function by parsing pe exports
Send data
Send http request
Write file on windows

Disassembly:
sub esp, 0x5c
mov eax, dword [0x42c708]
xor eax, esp
mov dword [esp + 0x58], eax
mov eax, dword [0x42dbf8]
mov edx, dword [eax + 0xc]
push ebx
mov ebx, dword [esp + 0x6c]
push ebp
push esi
push edi
mov ecx, 0x42dbf8
call edx
add eax, 0x10
mov dword [esp + 0x14], eax
mov eax, dword [0x42dbf8]
mov edx, dword [eax + 0xc]
mov ecx, 0x42dbf8
call edx
mov edi, dword [esp + 0x70]
add eax, 0x10
mov dword [esp + 0x10], eax
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
push ecx
push ecx
add edi, 0xfffffff0
mov esi, esp
push edi
mov dword [esp + 0x48], 0x426510
mov dword [esp + 0x4c], 0
call fcn.00401910
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.0040df40
add esp, 0xc
test eax, eax
jne 0x40e210
push 9
push 0x4264fc
mov ecx, ebx
call fcn.00402e30
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e1a2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e1c2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
or edx, 0xffffffff
lea ecx, [edi + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e1db
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov eax, dword [esp + 0x74]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e1fb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.004143e5
add esp, 0x5c
ret
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.WININET.dll_InternetOpenW]
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x40e241
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x40e196
mov esi, dword [esp + 0x14]
push 0
push 0
push 3
push 0
push 0
push 0x50
push esi
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x20], ebp
jne 0x40e2a1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push 0x4264c0
push ebx
call fcn.004035d0
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
add esp, 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e299
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
jmp 0x40e1a9
mov edx, dword [esp + 0x10]
push 1
push 0
lea ecx, [esp + 0x40]
push ecx
push 0
push 0
push edx
push 0x4264b8
push ebp
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
test esi, esi
jne 0x40e323
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x426498
push ebx
call fcn.004035d0
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 0xc
push ebp
call esi
mov eax, dword [esp + 0x1c]
push eax
call esi
lea ecx, [esp + 0x10]
call fcn.00401c80
lea ecx, [esp + 0x14]
call fcn.00401c80
lea ecx, [esp + 0x70]
call fcn.00401c80
lea ecx, [esp + 0x74]
call fcn.00401c80
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.004143e5
add esp, 0x5c
ret
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x40e35e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x426478
push ebx
call fcn.004035d0
add esp, 0xc
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebp
call esi
mov ecx, dword [esp + 0x1c]
push ecx
jmp 0x40e2e8
push 0x27
lea edx, [esp + 0x45]
push 0
push edx
mov byte [esp + 0x4c], 0
call fcn.00414400
add esp, 0xc
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x48]
push edx
push 5
push esi
mov dword [esp + 0x44], 0x28
mov dword [esp + 0x48], 0
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
lea eax, [esp + 0x40]
push eax
call fcn.00414c6b
mov ecx, dword [esp + 0x78]
add esp, 4
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push ecx
mov dword [esp + 0x48], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40e3e4
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
mov edx, dword [esp + 0x20]
push edx
jmp 0x40e2e1
push 0x2800
mov dword [esp + 0x1c], 0
call fcn.00414fbd
add esp, 4
mov edi, eax
jmp 0x40e400
lea ecx, [esp + 0x24]
push ecx
push 0x2800
push edi
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40e444
mov eax, dword [esp + 0x24]
test eax, eax
jbe 0x40e43a
push 0
lea edx, [esp + 0x2c]
push edx
push eax
push edi
push ebp
mov dword [esp + 0x3c], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x24]
add dword [esp + 0x18], eax
test eax, eax
ja 0x40e400
jmp 0x40e459
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x426458
push ebx
call fcn.004035d0
add esp, 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.00414ee0
mov eax, dword [ebx]
add esp, 4
cmp dword [eax - 0xc], 0
jne 0x40e47b
mov ecx, dword [esp + 0x2c]
cmp ecx, dword [esp + 0x18]
je 0x40e483
mov dword [esp + 0x18], 0
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
mov edx, dword [esp + 0x20]
push edx
call esi
mov eax, dword [esp + 0x1c]
push eax
call esi
lea ecx, [esp + 0x10]
call fcn.00401c80
lea ecx, [esp + 0x14]
call fcn.00401c80
lea ecx, [esp + 0x70]
call fcn.00401c80
lea ecx, [esp + 0x74]
call fcn.00401c80
mov ecx, dword [esp + 0x68]
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004143e5
add esp, 0x5c
ret