Function at 0x409f40
Capabilities:
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
mov ebp, esp
mov eax, 0x1014
call fcn.0051cbe0
mov eax, dword [0xf996f0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push edi
mov edi, dword [ebp + 8]
push 0
push 0
push 0
push 1
push str.DownloadApp
mov dword [ebp - 0x1008], eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebx, eax
mov dword [ebp - 0x1014], ebx
test ebx, ebx
jne 0x409fae
push 0x54afa0
push 0xfa1468
call fcn.00409700
push eax
call fcn.00409ee0
add esp, 0xc
pop edi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051ac75
mov esp, ebp
pop ebp
ret
cmp dword [edi + 0x14], 0x10
jb 0x409fb8
mov eax, dword [edi]
jmp 0x409fba
mov eax, edi
push esi
push 0
push SysReAllocString
push 0
push 0
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
test esi, esi
jne 0x40a010
push edi
push 0x54af90
push 0xfa1468
call fcn.00409700
add esp, 8
push eax
call fcn.004099c0
push eax
call fcn.00409ee0
add esp, 0xc
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop esi
pop edi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051ac75
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x1008]
cmp dword [eax + 0x14], 0x10
jb 0x40a01e
mov eax, dword [eax]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40a085
mov ecx, dword [ebp - 0x1008]
push ecx
push 0x54af80
push 0xfa1468
call fcn.00409700
add esp, 8
push eax
call fcn.004099c0
push eax
call fcn.00409ee0
add esp, 0xc
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebx
call esi
pop esi
pop edi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051ac75
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x100c]
push edx
push 0x1000
lea eax, [ebp - 0x1004]
push eax
push esi
mov bl, 1
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40a123
mov eax, dword [ebp - 0x100c]
test eax, eax
je 0x40a123
push 0
lea ecx, [ebp - 0x1010]
push ecx
push eax
lea edx, [ebp - 0x1004]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a0f9
mov eax, dword [ebp - 0x1010]
cmp eax, dword [ebp - 0x100c]
jne 0x40a0f9
lea ecx, [ebp - 0x100c]
push ecx
push 0x1000
lea edx, [ebp - 0x1004]
push edx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40a0a5
jmp 0x40a123
mov eax, dword [ebp - 0x1008]
push eax
push 0x54af70
push 0xfa1468
call fcn.00409700
add esp, 8
push eax
call fcn.004099c0
push eax
call fcn.00409ee0
add esp, 0xc
xor bl, bl
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
mov ecx, dword [ebp - 0x1014]
push ecx
call esi
test bl, bl
je 0x409ffd
mov edx, dword [ebp - 0x1008]
push edx
push 0x54af60
push 0xfa1468
call fcn.00409700
add esp, 8
push eax
call fcn.004099c0
push eax
call fcn.00409ee0
mov ecx, dword [ebp - 4]
add esp, 0xc
pop esi
pop edi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.0051ac75
mov esp, ebp
pop ebp
ret