Function at 0x40ac49
Capabilities:
Check http status code
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
push ebx
push esi
push edi
push 4
pop esi
xor ebx, ebx
push 0x3f
xor eax, eax
pop ecx
lea edi, [ebp - 0x123]
mov byte [ebp - 0x124], bl
push ebx
rep stosd dword es:[edi], eax
push 0x80
push 2
push ebx
push ebx
stosw word es:[edi], ax
push 0x40000000
mov dword [ebp - 8], ebx
push dword [ebp + 0x14]
mov dword [ebp - 0x18], esi
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
je 0x40ae2e
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 0xc]
call dword [sym.imp.WININET.dll_InternetOpenA]
mov edi, eax
cmp edi, ebx
je 0x40ae2e
push ebx
push 0x84000000
push ebx
push ebx
push dword [ebp + 0x10]
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
cmp eax, ebx
mov dword [ebp + 0xc], eax
jne 0x40acdf
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x40ae2e
lea ecx, [ebp - 0x1c]
push ebx
push ecx
lea ecx, [ebp - 0x14]
push ecx
mov dword [ebp - 0x1c], esi
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
push 0x20000013
push eax
mov dword [ebp - 0x14], ebx
call esi
test eax, eax
je 0x40ae17
cmp dword [ebp - 0x14], 0xc8
jne 0x40ae17
lea eax, [ebp - 0x24]
push ebx
push eax
lea eax, [ebp - 0x124]
push eax
push 1
push dword [ebp + 0xc]
mov dword [ebp - 0x24], 0xff
call esi
lea eax, [ebp - 0x18]
push ebx
push eax
lea eax, [ebp - 8]
push eax
push 0x20000005
push dword [ebp + 0xc]
call esi
test eax, eax
jne 0x40ad45
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 8]
cmp eax, ebx
jne 0x40ad55
mov dword [ebp + 0x14], 0x20000
jmp 0x40ad79
push 0x32
xor edx, edx
pop ecx
div ecx
mov dword [ebp + 0x14], eax
mov eax, 0x400
cmp dword [ebp + 0x14], eax
jae 0x40ad6c
mov dword [ebp + 0x14], eax
mov eax, 0x20000
cmp dword [ebp + 0x14], eax
jbe 0x40ad79
mov dword [ebp + 0x14], eax
push dword [ebp + 0x14]
mov esi, dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.DLL_HeapAlloc]
cmp ebx, ebx
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], ebx
mov dword [ebp + 0x10], ebx
jbe 0x40add1
mov eax, dword [ebp - 4]
add dword [ebp + 0x10], eax
mov eax, dword [ebp + 8]
cmp eax, ebx
je 0x40adba
push dword [ebp - 8]
push dword [ebp + 0x10]
push 0x465
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_SendMessageA]
lea eax, [ebp - 0x20]
push ebx
push eax
mov dword [ebp - 0x20], ebx
push dword [ebp - 4]
push dword [ebp - 0x10]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x14]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
call dword [sym.imp.WININET.dll_InternetReadFile]
mov edi, eax
cmp edi, ebx
je 0x40adef
cmp dword [ebp - 4], ebx
ja 0x40ad99
push dword [ebp - 0x10]
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.DLL_HeapFree]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [ebp + 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
cmp edi, ebx
setne al
jmp 0x40ae30
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
push dword [ebp + 0xc]
call esi
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret