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

Disassembly:
push ebp
lea ebp, [esp - 0x1f44]
mov eax, 0x1fc4
call fcn.0041bda0
mov eax, dword [0x42b1ec]
xor eax, ebp
mov dword [ebp + 0x1f40], eax
mov eax, dword [ebp + 0x1f4c]
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push ebx
push 0x42680c
push ebx
push str.AskPartnerCobranding
mov edi, ecx
mov dword [ebp - 0x7c], eax
mov esi, edx
mov dword [ebp - 0x6c], ebx
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x74], eax
cmp eax, ebx
je 0x40514f
push ebx
push 0x80000000
push ebx
push ebx
push edi
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov dword [ebp - 0x68], eax
cmp eax, ebx
jne 0x405156
mov ecx, dword [ebp - 0x74]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
jmp 0x4053e4
push 7
push str.http:__
push edi
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x80], 4
call fcn.0040e8d4
add esp, 0xc
test eax, eax
jne 0x4051b6
mov ecx, dword [ebp - 0x68]
push ebx
lea edx, [ebp - 0x80]
push edx
lea eax, [ebp - 0x78]
push eax
push 0x20000013
push ecx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4051ae
mov eax, dword [ebp - 0x78]
cmp eax, 0xc8
je 0x4051a5
cmp eax, 0xc9
jne 0x4053cf
mov dword [ebp - 0x6c], 1
jmp 0x4051b9
mov dword [ebp - 0x6c], ebx
jmp 0x4053cf
mov dword [ebp - 0x6c], ebx
cmp dword [ebp + 0x1f50], ebx
je 0x405309
cmp esi, ebx
je 0x4053cf
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jle 0x4051e0
xor eax, eax
jmp 0x4051fd
lea edi, [eax + eax]
mov eax, edi
call fcn.00416390
mov eax, esi
mov edx, 3
mov ecx, edi
mov esi, esp
mov dword [ebp - 0x64], esp
call fcn.00401000
push 0x426854
push eax
lea edx, [ebp - 0x70]
push edx
call fcn.0040e732
push 0x1f9f
lea eax, [ebp - 0x5f]
push ebx
push eax
mov dword [ebp - 0x64], ebx
mov byte [ebp - 0x60], bl
call fcn.00414c60
mov eax, dword [ebp - 0x68]
add esp, 0x18
lea ecx, [ebp - 0x64]
push ecx
push 0x1fa0
lea edx, [ebp - 0x60]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4052ef
mov ecx, dword [ebp - 0x64]
cmp ecx, ebx
je 0x4052ef
mov eax, dword [ebp - 0x70]
cmp eax, ebx
je 0x405265
push eax
push ecx
lea ecx, [ebp - 0x60]
push 1
push ecx
call fcn.0040db19
add esp, 0x10
lea edx, [ebp - 0x60]
push edx
mov byte [ebp - 0x60], bl
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
inc edi
cmp edi, 0x3fffffff
jle 0x405281
xor eax, eax
jmp 0x405297
lea eax, [edi + edi]
call fcn.00416390
mov esi, esp
push 3
mov edx, edi
lea eax, [ebp - 0x60]
call fcn.00404630
mov ecx, eax
lea esi, [ecx + 2]
lea esp, [esp]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x4052a0
sub ecx, esi
sar ecx, 1
push ecx
mov ecx, dword [ebp - 0x7c]
call fcn.00407f00
push 0x1f9f
lea eax, [ebp - 0x5f]
push ebx
push eax
mov dword [ebp - 0x64], ebx
mov byte [ebp - 0x60], bl
call fcn.00414c60
mov eax, dword [ebp - 0x68]
add esp, 0xc
lea ecx, [ebp - 0x64]
push ecx
push 0x1fa0
lea edx, [ebp - 0x60]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x405243
mov eax, dword [ebp - 0x70]
cmp eax, ebx
je 0x4052ff
push eax
call fcn.0040dd72
add esp, 4
call fcn.0040e3ad
jmp 0x4053cf
push 0x1f9f
lea ecx, [ebp - 0x5f]
push ebx
push ecx
mov dword [ebp - 0x64], ebx
mov byte [ebp - 0x60], bl
call fcn.00414c60
mov ecx, dword [ebp - 0x68]
add esp, 0xc
lea edx, [ebp - 0x64]
push edx
push 0x1fa0
lea eax, [ebp - 0x60]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4053cf
cmp dword [ebp - 0x64], ebx
je 0x4053cf
lea edx, [ebp - 0x60]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
inc edi
cmp edi, 0x3fffffff
jle 0x405362
xor eax, eax
jmp 0x405378
lea eax, [edi + edi]
call fcn.00416390
mov esi, esp
push 3
mov edx, edi
lea eax, [ebp - 0x60]
call fcn.00404630
mov ecx, eax
lea esi, [ecx + 2]
lea ecx, [ecx]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x405380
sub ecx, esi
sar ecx, 1
push ecx
mov ecx, dword [ebp - 0x7c]
call fcn.00407f00
push 0x1f9f
lea eax, [ebp - 0x5f]
push ebx
push eax
mov dword [ebp - 0x64], ebx
mov byte [ebp - 0x60], bl
call fcn.00414c60
mov eax, dword [ebp - 0x68]
add esp, 0xc
lea ecx, [ebp - 0x64]
push ecx
push 0x1fa0
lea edx, [ebp - 0x60]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x405340
mov ecx, dword [ebp - 0x68]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ecx
call esi
mov edx, dword [ebp - 0x74]
push edx
call esi
mov eax, dword [ebp - 0x6c]
lea esp, [ebp - 0x8c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x1f40]
xor ecx, ebp
call fcn.0040ce2f
add ebp, 0x1f44
mov esp, ebp
pop ebp
ret