Function at 0x40aa00
Capabilities:
Connect to http server
Create http request
Download and write a file
Get http content length
Parse url
Read data from internet
Receive and write data from server to client
Receive data
Resolve function by parsing pe exports
Write file on windows

Disassembly:
mov eax, 0x24f4
call fcn.00484d50
mov eax, dword [0x4e97d0]
xor eax, esp
mov dword [esp + 0x24f0], eax
push esi
push edi
xor eax, eax
push 0x1fe
mov esi, ecx
push eax
lea ecx, [esp + 0x272]
mov edi, edx
push ecx
mov dword [esp + 0x14], edi
mov word [esp + 0x274], ax
call fcn.00484550
xor edx, edx
push 0xfe
push edx
lea eax, [esp + 0x7e]
push eax
mov word [esp + 0x80], dx
call fcn.00484550
xor ecx, ecx
push 0xfe
push ecx
lea edx, [esp + 0x18a]
push edx
mov word [esp + 0x18c], cx
call fcn.00484550
xor eax, eax
push 0x1046
push eax
lea ecx, [esp + 0x14de]
push ecx
mov word [esp + 0x14e0], ax
call fcn.00484550
push 0x38
lea edx, [esp + 0x64]
push 0
push edx
call fcn.00484550
lea eax, [esp + 0x2a4]
mov dword [esp + 0x78], eax
mov eax, 0x80
mov dword [esp + 0x88], eax
mov dword [esp + 0x90], eax
add esp, 0x3c
lea ecx, [esp + 0x68]
lea edx, [esp + 0x168]
lea eax, [esp + 0x14b0]
mov dword [esp + 0x2c], 0x3c
mov dword [esp + 0x40], 0x100
mov dword [esp + 0x48], ecx
mov dword [esp + 0x50], edx
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], 0x824
test edi, edi
je 0x40ae50
lea ecx, [esp + 0x2c]
push ecx
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
test eax, eax
mov eax, dword [esp + 0x38]
je 0x40ab1d
cmp eax, 3
je 0x40ab3d
cmp eax, 4
je 0x40ab3d
xor edi, edi
mov eax, edi
pop edi
pop esi
mov ecx, dword [esp + 0x24f0]
xor ecx, esp
call fcn.00484647
add esp, 0x24f4
ret
push ebx
xor edx, edx
push 0
cmp eax, 4
push 0
sete dl
push 0
push 0
push str.Beacon
mov esi, edx
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebx, eax
mov dword [esp + 0x24], ebx
test ebx, ebx
jne 0x40ab6c
xor edi, edi
jmp 0x40ae2b
mov edx, dword [esp + 0x48]
push ebp
push 0
push 0
push 3
lea eax, [esp + 0x17c]
push eax
lea ecx, [esp + 0x80]
push ecx
push edx
lea eax, [esp + 0x288]
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov ebp, eax
mov dword [esp + 0x18], ebp
test ebp, ebp
jne 0x40aba8
xor edi, edi
jmp 0x40ae1f
xor ecx, ecx
push 0x1046
push ecx
lea edx, [esp + 0x47a]
push edx
mov word [esp + 0x47c], cx
call fcn.00484550
add esp, 0xc
cmp dword [esp + 0x64], 0
je 0x40abf1
mov eax, dword [esp + 0x60]
lea edx, [esp + 0x470]
sub edx, eax
lea esp, [esp]
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40abe0
jmp 0x40ac17
xor eax, eax
jmp 0x40ac00
movzx ecx, word [eax + 0x4cd6f4]
mov word [esp + eax + 0x470], cx
add eax, 2
test cx, cx
jne 0x40ac00
neg esi
sbb esi, esi
push 0
and esi, 0x800000
add esi, 0x80000000
mov ebx, esi
push ebx
push 0
push 0x4ccc68
push 0x4cd6f8
lea eax, [esp + 0x484]
push eax
push str.HEAD
push ebp
mov ebp, dword [sym.imp.WININET.dll_HttpOpenRequestW]
call ebp
mov esi, eax
mov dword [esp + 0x24], eax
call fcn.0040a900
mov edi, eax
test edi, edi
je 0x40ae08
push 0
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x24]
push edx
push 0x20000005
mov eax, esi
push eax
mov dword [esp + 0x30], 0
mov dword [esp + 0x40], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x40aca2
cmp dword [esp + 0x1c], 0x3e800000
jbe 0x40aca2
xor edi, edi
jmp 0x40ae08
mov edx, dword [esp + 0x18]
push 0
push ebx
push 0
push 0x4ccc68
push 0x4cd6f8
lea ecx, [esp + 0x484]
push ecx
push 0x4cd718
push edx
call ebp
mov edi, dword [sym.imp.WININET.dll_InternetSetOptionW]
mov esi, eax
push 4
lea eax, [esp + 0x24]
push eax
push 5
push esi
mov dword [esp + 0x30], 0x2bf20
call edi
push 4
lea ecx, [esp + 0x24]
push ecx
push 6
push esi
call edi
call fcn.0040a900
mov edi, eax
test edi, edi
je 0x40adfd
mov edx, dword [esp + 0x10]
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40ad27
xor edi, edi
jmp 0x40adfd
push 0x80000
call fcn.00480d3a
mov ebx, eax
xor edi, edi
add esp, 4
cmp ebx, edi
je 0x40ade2
push 0x80000
push edi
push ebx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x20], edi
call fcn.00484550
add esp, 0xc
lea eax, [esp + 0x14]
push eax
push 0x80000
push ebx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov edi, eax
test edi, edi
je 0x40ade2
mov eax, dword [esp + 0x14]
xor edi, edi
test eax, eax
jbe 0x40ad9f
add dword [esp + 0x10], eax
push edi
lea ecx, [esp + 0x34]
push ecx
push eax
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, eax
test edi, edi
je 0x40ade2
push ebp
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
jmp 0x40ada1
je 0x40add3
push 0x80000
push 0
push ebx
mov dword [esp + 0x20], 0
call fcn.00484550
add esp, 0xc
lea edx, [esp + 0x14]
push edx
push 0x80000
push ebx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov edi, eax
test edi, edi
jne 0x40ad73
jmp 0x40ade2
mov eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x1c]
jne 0x40ade2
mov edi, 1
push ebp
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x40adfd
push ebx
call fcn.00485811
add esp, 4
test esi, esi
je 0x40ae08
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x40ae17
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebx, dword [esp + 0x28]
mov ebp, dword [esp + 0x18]
test ebp, ebp
je 0x40ae2a
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop ebp
test ebx, ebx
je 0x40ae36
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop ebx
mov eax, edi
pop edi
pop esi
mov ecx, dword [esp + 0x24f0]
xor ecx, esp
call fcn.00484647
add esp, 0x24f4
ret
mov ecx, dword [esp + 0x24f8]
pop edi
pop esi
xor ecx, esp
xor eax, eax
call fcn.00484647
add esp, 0x24f4
ret