Function at 0x401450
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 0x53091b
mov eax, dword fs:[0]
push eax
mov eax, 0x2428
call fcn.005070d0
mov eax, dword [0x656c90]
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.00506060
lea edx, [ebp - 0x410]
push edx
push esi
call fcn.00521859
add esp, 0x14
test eax, eax
je 0x4016ce
mov eax, dword [ebp - 0x2414]
test eax, eax
je 0x4014f4
mov dword [eax], edi
test ebx, ebx
jne 0x40151e
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 0x4016ce
mov edi, ebx
cmp byte [ebp + 0x1c], 0
mov esi, 0x84000000
je 0x40152e
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 0x401564
test edi, edi
je 0x4016ce
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x4016ce
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 0x40158e
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x4016c4
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x4016bb
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 0x4015f0
mov eax, dword [ebp - 0x2414]
test eax, eax
je 0x4016bb
mov dword [eax], 0x194
jmp 0x4016bb
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 0x4016bb
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 0x4016aa
lea ebx, [ebx]
mov eax, dword [ebp - 0x2420]
test eax, eax
je 0x4016ec
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 0x4016aa
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 0x401650
mov eax, dword [ebp - 0x2418]
test eax, eax
je 0x4016bb
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 0x4016ce
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.00506042
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 0x40170f
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 0x401722
push edi
call esi
mov eax, dword [ebp - 0x241c]
jmp 0x4016d0