Function at 0x4017b0
Capabilities:
Check http status code
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
Send data
Send http request
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4121fb
mov eax, dword fs:[0]
push eax
mov eax, 0x2428
call fcn.00404e90
mov eax, dword [0x4170e0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x20]
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0x18]
mov dword [ebp - 0x2430], eax
mov eax, dword [ebp + 0x24]
xor edi, edi
mov dword [ebp - 0x241c], ecx
mov dword [ebp - 0x2414], edx
mov dword [ebp - 0x2418], eax
mov dword [ebp - 0x2434], edi
push 0x3ff
lea ecx, [ebp - 0x40f]
push edi
push ecx
mov dword [ebp - 4], edi
mov byte [ebp - 0x410], 0
call fcn.00404e10
lea edx, [ebp - 0x410]
push edx
push esi
call fcn.0040436e
add esp, 0x14
test eax, eax
je 0x401a2e
mov eax, dword [ebp - 0x2414]
test eax, eax
je 0x401854
mov dword [eax], edi
test ebx, ebx
jne 0x40187e
xor eax, eax
cmp dword [ebp - 0x2418], eax
push ebx
setne al
push ebx
push ebx
push eax
push str.HAAgent
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebx, eax
test ebx, ebx
je 0x401a2e
mov edi, ebx
cmp byte [ebp + 0x1c], 0
mov esi, 0x84000000
je 0x40188e
mov esi, 0x84000002
mov ecx, dword [ebp + 0xc]
push 0
push 0
push 3
push 0
push 0
push ecx
lea edx, [ebp - 0x410]
push edx
push ebx
call dword [sym.imp.WININET.dll_InternetConnectA]
mov ebx, eax
test ebx, ebx
jne 0x4018c4
test edi, edi
je 0x401a2e
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x401a2e
mov eax, dword [ebp - 0x2430]
push 0
push esi
push 0
push 0
push 0
push eax
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov esi, eax
test esi, esi
jne 0x4018ee
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x401a24
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x401a1b
push 0
lea ecx, [ebp - 0x242c]
push ecx
lea edx, [ebp - 0x2424]
push edx
push 0x20000013
push esi
mov dword [ebp - 0x242c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
cmp dword [ebp - 0x2424], 0x194
jne 0x401950
mov eax, dword [ebp - 0x2414]
test eax, eax
je 0x401a1b
mov dword [eax], 0x194
jmp 0x401a1b
mov eax, dword [ebp - 0x241c]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x2418], eax
cmp eax, 0xffffffff
je 0x401a1b
lea ecx, [ebp - 0x2420]
push ecx
push 0x2000
lea edx, [ebp - 0x2410]
xor eax, eax
push edx
push esi
mov dword [ebp - 0x2420], eax
mov dword [ebp - 0x2414], eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x401a0a
lea ebx, [ebx]
mov eax, dword [ebp - 0x2420]
test eax, eax
je 0x401a4c
push 0
lea ecx, [ebp - 0x2428]
push ecx
push eax
mov eax, dword [ebp - 0x2418]
lea edx, [ebp - 0x2410]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401a0a
mov ecx, dword [ebp - 0x2428]
add dword [ebp - 0x2414], ecx
lea edx, [ebp - 0x2420]
push edx
push 0x2000
lea eax, [ebp - 0x2410]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x4019b0
mov eax, dword [ebp - 0x2418]
test eax, eax
je 0x401a1b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebx
call esi
test edi, edi
je 0x401a2e
push edi
call esi
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00404d71
mov esp, ebp
pop ebp
ret
xor ecx, ecx
cmp ecx, dword [ebp - 0x2414]
sbb eax, eax
neg eax
mov dword [ebp - 0x241c], eax
mov eax, dword [ebp - 0x2418]
test eax, eax
je 0x401a6f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebx
call esi
test edi, edi
je 0x401a82
push edi
call esi
mov eax, dword [ebp - 0x241c]
jmp 0x401a30