Function at 0x406f57
Capabilities:
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push 0x510
mov eax, 0x43871c
call fcn.00422f63
mov dword [ebp - 0x510], edx
mov dword [ebp - 0x500], ecx
mov dword [ebp - 4], 1
xor ebx, ebx
mov byte [ebp - 0x4e9], bl
mov dword [ebp - 0x4f8], 4
mov dword [ebp - 0x4f4], 0xece8e8d4
mov dword [ebp - 0x4f0], 0xef8d7c
lea ecx, [ebp - 0x4f8]
call fcn.0040495b
push eax
lea ecx, [ebp - 0x50c]
call fcn.00402546
mov byte [ebp - 4], 2
push ebx
push ebx
push ebx
push ebx
push dword [eax]
call dword [sym.imp.WININET.dll_InternetOpenW]
mov edi, eax
mov dword [ebp - 0x518], edi
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x50c]
lea ecx, [ecx - 0x10]
call fcn.00401564
test edi, edi
je 0x407217
push ebx
push SysReAllocString
push ebx
push ebx
push dword [ebp + 8]
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov esi, eax
mov dword [ebp - 0x51c], esi
test esi, esi
je 0x40720e
push 0xc8
push ebx
lea eax, [ebp - 0xdc]
push eax
call fcn.004247d0
add esp, 0xc
mov dword [ebp - 0x4e8], 0xc8
push ebx
lea eax, [ebp - 0x4e8]
push eax
lea eax, [ebp - 0xdc]
push eax
push 5
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
lea eax, [ebp - 0xdc]
push eax
call fcn.004293ba
pop ecx
mov dword [ebp - 0x514], eax
test eax, eax
je 0x407203
push ebx
push 0x80
push 2
push ebx
push ebx
push 0xc0000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x504], eax
test eax, eax
je 0x407203
mov byte [ebp - 4], 4
mov dword [ebp - 0x4e4], ebx
mov dword [ebp - 0x4fc], ebx
mov dword [ebp - 0x4e0], ebx
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 0x4e0]
call fcn.004025e0
mov byte [ebp - 4], 5
push 0x5c
lea ecx, [ebp - 0x4e0]
call fcn.004049b0
mov ecx, eax
cmp ecx, 0xffffffff
je 0x407104
mov eax, dword [ebp - 0x4e0]
mov eax, dword [eax - 0xc]
sub eax, ecx
dec eax
push eax
lea eax, [ebp - 0x508]
push eax
lea ecx, [ebp - 0x4e0]
call fcn.00402462
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp - 0x4e0]
call fcn.004028dc
mov byte [ebp - 4], 7
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x508]
lea ecx, [ecx - 0x10]
call fcn.00401564
push 0x400
push ebx
lea eax, [ebp - 0x4dc]
push eax
call fcn.004247d0
add esp, 0xc
lea eax, [ebp - 0x4e4]
push eax
push 0x400
lea eax, [ebp - 0x4dc]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
push ebx
lea eax, [ebp - 0x4e4]
push eax
push dword [ebp - 0x4e4]
lea eax, [ebp - 0x4dc]
push eax
push dword [ebp - 0x504]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x4e4]
mov eax, dword [ebp - 0x4fc]
add eax, ecx
mov dword [ebp - 0x4fc], eax
test ecx, ecx
je 0x4071b6
cmp dword [ebp - 0x500], 0
je 0x4071ae
push dword [ebp - 0x510]
push eax
push dword [ebp - 0x514]
push ecx
mov ecx, esp
mov dword [ebp - 0x508], esp
lea eax, [ebp - 0x4e0]
push eax
call fcn.004025e0
mov byte [ebp - 4], 8
mov byte [ebp - 4], 5
call dword [ebp - 0x500]
add esp, 0x10
mov ecx, dword [ebp - 0x4e4]
test ecx, ecx
jne 0x407104
push dword [ebp - 0x504]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 0x4e9], 1
mov byte [ebp - 4], 9
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x4e0]
lea ecx, [ecx - 0x10]
call fcn.00401564
mov dword [ebp - 4], 1
jmp 0x407203
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
jmp 0x407214
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
mov byte [ebp - 4], bl
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00401564
or dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp + 0xc]
add ecx, 0xfffffff0
call fcn.00401564
mov al, byte [ebp - 0x4e9]
call fcn.00422eb5
ret