Function at 0x40ad90
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:
sub esp, 0x474
push ebx
mov eax, dword [esp + 0x47c]
push ebp
push esi
push edi
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x40afe3
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.WININET.dll_InternetOpenA]
test eax, eax
mov dword [esp + 0x18], eax
je 0x40afe3
mov ecx, dword [esp + 0x498]
mov edx, dword [esp + 0x494]
push 0
push 0
push ecx
mov ecx, dword [esp + 0x498]
push 0
push 0
push edx
push ecx
push eax
call dword [sym.imp.WININET.dll_InternetConnectA]
test eax, eax
mov dword [esp + 0x20], eax
je 0x40afe3
mov ecx, dword [esp + 0x490]
push 0
lea edx, [esp + 0x2c]
push 0x84400000
push edx
push 0
push 0
push ecx
push 0
push eax
mov dword [esp + 0x48], 0x41066c
mov dword [esp + 0x4c], 0
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
test ebx, ebx
je 0x40afe3
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x40afe3
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
lea edx, [esp + 0x14]
push 0
lea eax, [esp + 0x34]
push edx
push eax
mov ebp, 0x20
push 0x13
push ebx
mov dword [esp + 0x28], ebp
call esi
test eax, eax
je 0x40afe3
mov edi, dword [sym.imp.MSVCRT.dll_atol]
lea ecx, [esp + 0x30]
push ecx
call edi
add esp, 4
cmp eax, 0x197
je 0x40afc6
cmp eax, 0x191
je 0x40afc6
mov dword [esp + 0x14], ebp
xor ebp, ebp
lea edx, [esp + 0x14]
push ebp
lea eax, [esp + 0x34]
push edx
push eax
push 5
push ebx
call esi
test eax, eax
je 0x40afe3
lea ecx, [esp + 0x30]
push ecx
call edi
mov esi, dword [esp + 0x4a0]
add esp, 4
cmp esi, ebp
je 0x40aef8
push eax
push 5
push 0x401
push esi
call dword [sym.imp.USER32.dll_PostMessageA]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
lea edx, [esp + 0x10]
lea eax, [esp + 0x84]
push edx
push 0x400
push eax
push ebx
mov dword [esp + 0x20], ebp
xor edi, edi
mov dword [esp + 0x34], ebp
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40afe3
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40af97
lea ecx, [esp + 0x24]
push 0
push ecx
push eax
mov eax, dword [esp + 0x28]
lea edx, [esp + 0x90]
push edx
push eax
call ebp
add edi, dword [esp + 0x10]
test esi, esi
je 0x40af65
push edi
push 6
push 0x401
push esi
call dword [sym.imp.USER32.dll_PostMessageA]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40af97
lea ecx, [esp + 0x10]
lea edx, [esp + 0x84]
push ecx
push 0x400
push edx
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40af2f
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x474
ret
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebx
call esi
mov eax, dword [esp + 0x20]
push eax
call esi
mov ecx, dword [esp + 0x18]
push ecx
call esi
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x474
ret
mov esi, dword [sym.imp.WININET.dll_InternetReadFile]
lea eax, [esp + 0x18]
lea ecx, [esp + 0x50]
push eax
push 0x32
push ecx
push ebx
call esi
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x40afcc
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x474
ret