Function at 0x409ac0
Capabilities:
Connect to http server
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
mov eax, 0x1383c
call fcn.00418620
mov eax, dword [0x424300]
xor eax, esp
mov dword [esp + 0x13838], eax
push ebx
push ebp
mov ebp, dword [esp + 0x13848]
push esi
push edi
mov ebx, ecx
xor edi, edi
mov esi, edx
cmp ebx, edi
je 0x409db7
cmp esi, edi
je 0x409db7
mov eax, ebp
call fcn.004098f0
test eax, eax
je 0x409db7
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, 0x208
jae 0x409db7
push esi
lea eax, [ebp + 0x42c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push edi
push edi
push edi
push 1
push 0x42099c
mov dword [ebp + 0x14], edi
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp + 4], eax
cmp eax, edi
je 0x409c6e
mov ecx, dword [ebp + 0x18]
cmp dword [ecx], edi
je 0x409c6e
push edi
push edi
push 3
push edi
push edi
push 0x50
lea edx, [ebp + 0x1c]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp + 8], eax
cmp eax, edi
je 0x409c6e
mov ecx, dword [ebp + 0x18]
cmp dword [ecx], edi
je 0x409c6e
push edi
push 0x84000000
lea edx, [esp + 0x24]
push edx
push edi
push str.HTTP_1.1
lea ecx, [ebp + 0x224]
push ecx
push 0x4209bc
push eax
mov dword [esp + 0x3c], 0x4209a0
mov dword [esp + 0x40], edi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp + 0xc], eax
cmp eax, edi
je 0x409c6e
mov edx, dword [ebp + 0x18]
cmp dword [edx], edi
je 0x409c6e
mov eax, ebp
call fcn.00409a50
mov ebx, eax
cmp ebx, 0xffffffff
je 0x409c6e
cmp ebx, edi
je 0x409c4d
mov ecx, 7
mov esi, str.Accept:__r_n_r_n
lea edi, [esp + 0x24]
rep movsd dword es:[edi], dword [esi]
push 0xa0000000
lea eax, [esp + 0x28]
movsw word es:[edi], word [esi]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
call edi
mov edx, dword [ebp + 0xc]
mov esi, dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
push eax
lea ecx, [esp + 0x2c]
push ecx
push edx
call esi
test eax, eax
je 0x409c6e
push 0x800
lea eax, [esp + 0x48]
push 0
push eax
call fcn.0040fed0
push ebx
lea ecx, [esp + 0x54]
push str.Range:bytes_d_
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
push 0xa0000000
lea edx, [esp + 0x48]
push edx
call edi
mov ecx, dword [ebp + 0xc]
push eax
lea eax, [esp + 0x4c]
push eax
push ecx
call esi
mov edx, dword [ebp + 0x18]
xor esi, esi
cmp dword [edx], esi
je 0x409c6e
mov eax, dword [ebp + 0xc]
push esi
push esi
push esi
push esi
push eax
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x409c7a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, ebp
call fcn.00409890
jmp 0x409db9
mov ecx, dword [ebp + 0x18]
cmp dword [ecx], esi
je 0x409c6e
mov ecx, ebp
call fcn.00409970
cmp eax, 0xffffffff
je 0x409c6e
push 0x11000
lea edx, [esp + 0x284c]
add eax, ebx
push esi
push edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x1c], esi
call fcn.0040fed0
add esp, 0xc
mov eax, dword [ebp + 0x18]
cmp dword [eax], 0
je 0x409c6e
mov eax, dword [ebp + 0xc]
lea ecx, [esp + 0x10]
push ecx
push 0x2000
lea edx, [esp + 0x84c]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x409c6e
mov ecx, dword [ebp + 0x18]
cmp dword [ecx], 0
je 0x409c6e
mov edi, dword [esp + 0x10]
mov eax, dword [ebp + 0x10]
add ebx, edi
test eax, eax
je 0x409cfd
mov edx, dword [esp + 0x18]
push ebx
push edx
call eax
mov edi, dword [esp + 0x18]
add esp, 8
lea eax, [esi + edi]
cmp eax, 0x10000
jbe 0x409d45
mov eax, dword [ebp]
push 0
lea ecx, [esp + 0x18]
push ecx
push esi
lea edx, [esp + 0x2854]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409c6e
push 0x11000
xor esi, esi
lea ecx, [esp + 0x284c]
push esi
push ecx
call fcn.0040fed0
mov edi, dword [esp + 0x1c]
add esp, 0xc
push edi
lea edx, [esp + 0x848]
push edx
lea eax, [esp + esi + 0x2850]
push eax
call fcn.0040d960
add esp, 0xc
add esi, edi
test edi, edi
jne 0x409cb1
mov eax, dword [ebp]
push edi
lea ecx, [esp + 0x18]
push ecx
push esi
lea edx, [esp + 0x2854]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409c6e
push 0x11000
xor esi, esi
lea ecx, [esp + 0x284c]
push esi
push ecx
call fcn.0040fed0
add esp, 0xc
cmp dword [esp + 0x10], esi
jne 0x409cb1
mov esi, ebp
call fcn.00409890
lea eax, [edi + 1]
jmp 0x409db9
xor eax, eax
mov ecx, dword [esp + 0x13848]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040ad1f
add esp, 0x1383c
ret 4