Function at 0x402160
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
and esp, 0xfffffff8
mov eax, 0x101c
call fcn.00426660
mov eax, dword [0x450670]
xor eax, esp
mov dword [esp + 0x1018], eax
push ebx
push esi
push edi
push 0
push 0
push 0
push 1
mov ebx, edx
push str.DownloadApp
mov esi, ecx
mov dword [esp + 0x2c], ebx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x40221f
push 0x446190
push 0xf54750
call fcn.004074a0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00403df0
mov eax, dword [esi]
mov ecx, dword [eax + 4]
lea eax, [ecx + esi]
xor edi, edi
test byte [eax + 8], 6
jne 0x4021e7
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x4021e7
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x402208
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x402200
or eax, 4
push 0
push eax
call fcn.00401700
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1018]
xor ecx, esp
call fcn.00424daa
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x18], 0x10
jb 0x40222a
mov ecx, dword [esi + 4]
jmp 0x40222d
lea ecx, [esi + 4]
push 0
push SysReAllocString
push 0
push 0
push ecx
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov edi, eax
test edi, edi
jne 0x4022d8
push esi
push ecx
push 0x4461a8
push 0xf54750
call fcn.004074a0
add esp, 0xc
push eax
call fcn.004076d0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00403df0
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
test byte [eax + 8], 6
jne 0x402295
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x402295
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x4022b6
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x4022ae
or eax, 4
push 0
push eax
call fcn.00401700
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1018]
xor ecx, esp
call fcn.00424daa
mov esp, ebp
pop ebp
ret
cmp dword [ebx + 0x18], 0x10
jb 0x4022e3
mov eax, dword [ebx + 4]
jmp 0x4022e6
lea eax, [ebx + 4]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4023a0
push ebx
push ecx
push 0x4461b8
push 0xf54750
call fcn.004074a0
add esp, 0xc
push eax
call fcn.004076d0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00403df0
mov eax, dword [esi]
mov ecx, dword [eax + 4]
lea eax, [ecx + esi]
xor ebx, ebx
test byte [eax + 8], 6
jne 0x402358
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x402358
mov ebx, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test ebx, ebx
je 0x402379
mov eax, dword [ecx + 8]
or eax, ebx
cmp dword [ecx + 0x28], 0
jne 0x402371
or eax, 4
push 0
push eax
call fcn.00401700
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
mov edx, dword [esp + 0x10]
push edx
call esi
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1018]
xor ecx, esp
call fcn.00424daa
mov esp, ebp
pop ebp
ret
mov ebx, dword [sym.imp.WININET.dll_InternetReadFile]
lea eax, [esp + 0x14]
push eax
push 0x1000
lea ecx, [esp + 0x28]
push ecx
push edi
call ebx
test eax, eax
je 0x4023f2
lea esp, [esp]
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x4023f2
push 0
lea edx, [esp + 0x20]
push edx
push eax
lea eax, [esp + 0x2c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [esp + 0x14]
push ecx
push 0x1000
lea edx, [esp + 0x28]
push edx
push edi
call ebx
test eax, eax
jne 0x4023c0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
mov ecx, dword [esp + 0x18]
push ecx
push ecx
push 0x4461c8
push 0xf54750
call fcn.004074a0
add esp, 0xc
push eax
call fcn.004076d0
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00403df0
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x40245a
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x40245a
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x40247b
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x402473
or eax, 4
push 0
push eax
call fcn.00401700
mov ecx, dword [esp + 0x1024]
pop edi
pop esi
pop ebx
xor ecx, esp
mov al, 1
call fcn.00424daa
mov esp, ebp
pop ebp
ret