Function at 0x40da20
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:
sub esp, 0x34
mov eax, dword [0x4f4930]
xor eax, esp
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x38]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x54]
push 0
push 0
push 2
push 0
push 1
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x64]
push 0xc0000000
mov dword [edi], 0
push eax
mov esi, edx
mov dword [esp + 0x48], edi
mov byte [ecx], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40da93
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi], eax
xor al, al
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.0046fdae
add esp, 0x34
ret
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebp, eax
mov dword [esp + 0x3c], ebp
test ebp, ebp
jne 0x40dad0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov dword [edi], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.0046fdae
add esp, 0x34
ret
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 4
lea edx, [esp + 0x20]
push edx
push 0x37
push ebp
mov dword [esp + 0x2c], 0x7530
call esi
push 4
lea eax, [esp + 0x20]
push eax
push 6
push ebp
call esi
push 4
lea ecx, [esp + 0x20]
push ecx
push 8
push ebp
call esi
mov byte [esp + 0x13], 0
jmp 0x40db10
mov edx, dword [esp + 0x18]
push 0
push 0x84000000
push 0
push 0
push edx
push ebp
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov esi, eax
test esi, esi
je 0x40db88
push 0
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x30]
push ecx
push 0x20000013
push esi
mov dword [esp + 0x3c], 0
mov dword [esp + 0x44], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
mov eax, dword [esp + 0x28]
je 0x40db64
cmp eax, 0xc8
je 0x40dbb3
cmp eax, 0x1a0
jne 0x40dd06
cmp byte [esp + 0x13], 0
jne 0x40dd06
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov byte [esp + 0x13], 1
jmp 0x40db10
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov dword [edi], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.0046fdae
add esp, 0x34
ret
xor edi, edi
push edi
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0x28]
push eax
push 0x20000005
push esi
mov dword [esp + 0x34], edi
mov dword [esp + 0x4c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x40dbe2
mov dword [esp + 0x20], edi
jmp 0x40dc0d
mov ecx, dword [esp + 0x20]
cmp ecx, edi
je 0x40dc0d
mov eax, 0x51eb851f
mul ecx
mov ebp, edx
shr ebp, 4
cmp ebp, 0x400
jae 0x40dc05
mov ebp, 0x400
jmp 0x40dc12
cmp ebp, 0x20000
jbe 0x40dc12
mov ebp, 0x20000
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
push 0
push 0
push ebx
mov edi, eax
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 1
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x14]
mov byte [esp + 0x13], 1
test eax, eax
jbe 0x40dc7c
mov ecx, dword [esp + 0x34]
add dword [ecx], eax
push 0
lea ecx, [esp + 0x28]
push ecx
push eax
push edi
push ebx
mov dword [esp + 0x38], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x24]
cmp edx, dword [esp + 0x14]
jne 0x40dc9e
lea eax, [esp + 0x14]
push eax
push ebp
push edi
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov ecx, eax
mov dword [esp + 0x18], ecx
test ecx, ecx
je 0x40dcb7
mov eax, dword [esp + 0x14]
test eax, eax
ja 0x40dc54
jmp 0x40dcb3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x2c]
mov dword [ecx], eax
mov ecx, dword [esp + 0x18]
mov byte [esp + 0x13], 0
test ecx, ecx
jne 0x40dcc8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x2c]
mov dword [edx], eax
mov byte [esp + 0x13], 0
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
mov eax, dword [esp + 0x3c]
push eax
call esi
mov al, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.0046fdae
add esp, 0x34
ret
push ebx
mov dword [edi], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebp
call esi
mov ecx, dword [esp + 0x40]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor al, al
call fcn.0046fdae
add esp, 0x34
ret