Function at 0x407650
Capabilities:
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
mov ebp, esp
mov eax, 0x2218
call fcn.00414f30
mov eax, dword [0x429460]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
push str._ELEMENTAL_URL
push str.http:__api.elementsbrowser.com_download_attachment_version_1.0.43
mov edi, edx
mov dword [ebp - 0x2214], eax
mov esi, ecx
mov dword [ebp - 0x2218], ebx
mov dword [ebp - 0x2210], 0
mov dword [ebp - 0x2208], 0x100
mov dword [0x42e2e0], ebx
mov dword [eax], 0
mov dword [0x42e2ec], 1
call fcn.0040ed00
add esp, 8
test eax, eax
jne 0x4076d9
push 0x200
push str.http:__api.elementsbrowser.com_download_attachment_elements.bin
push 0xffffffffffffffff
push str.http:__api.elementsbrowser.com_download_attachment_version_1.0.43
push eax
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp word [str.http:__api.elementsbrowser.com_download_attachment_elements.bin], 0
jne 0x4076e7
xor ecx, ecx
jmp 0x4076ff
mov ecx, str.http:__api.elementsbrowser.com_download_attachment_elements.bin
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4076f0
sub ecx, edx
sar ecx, 1
push ecx
push str.http:__api.elementsbrowser.com_download_attachment_elements.bin
mov ecx, 0x42cca0
call fcn.00401c10
push 3
push 0x84000300
push 0
push 0
push str.http:__api.elementsbrowser.com_download_attachment_elements.bin
push esi
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov esi, eax
test esi, esi
je 0x40778b
lea eax, [ebp - 0x2210]
push eax
lea eax, [ebp - 0x2208]
push eax
lea eax, [ebp - 0x204]
push eax
push 0x13
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
mov ecx, 0x425550
lea eax, [ebp - 0x204]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40777b
test dx, dx
je 0x407777
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40777b
add eax, 4
add ecx, 4
test dx, dx
jne 0x407755
xor eax, eax
jmp 0x407780
sbb eax, eax
or eax, 1
test eax, eax
je 0x40779e
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040dfe8
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x4072a0
push 0x64
push 1
push ebx
mov dword [0x42e2e8], eax
call dword [sym.imp.USER32.dll_SetTimer]
push 0x2000
mov dword [0x42e2e4], eax
lea eax, [ebp - 0x2204]
push 0
push eax
call fcn.00414f60
add esp, 0xc
mov dword [ebp - 0x2208], 0
mov ecx, edi
call fcn.00407550
mov edi, eax
cmp edi, 0xffffffff
je 0x40778b
lea eax, [ebp - 0x2208]
mov bl, 1
push eax
push 0x2000
lea eax, [ebp - 0x2204]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x407885
lea esp, [esp]
mov eax, dword [ebp - 0x2208]
test eax, eax
je 0x407885
cmp byte [0x42e125], 0
jne 0x407885
push 0
lea ecx, [ebp - 0x220c]
push ecx
push eax
lea eax, [ebp - 0x2204]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x2208]
cmp eax, dword [ebp - 0x220c]
jne 0x407877
mov ecx, dword [ebp - 0x2214]
add dword [0x42e2ec], eax
add dword [ecx], eax
lea eax, [ebp - 0x2208]
push eax
push 0x2000
lea eax, [ebp - 0x2204]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x407810
jmp 0x407885
mov eax, dword [ebp - 0x2214]
xor bl, bl
mov dword [eax], 0
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2214]
cmp dword [eax], 0x2160ec0
jae 0x4078af
xor eax, eax
movzx ebx, bl
cmp byte [0x42e125], al
cmove ebx, eax
push dword [0x42e2e4]
push dword [ebp - 0x2218]
call dword [sym.imp.USER32.dll_KillTimer]
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040dfe8
mov esp, ebp
pop ebp
ret