Function at 0x40c23b
Capabilities:
Create http request
Download and write a file
Query remote server for available data
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, 0x291c
call fcn.0040e2d0
push ebx
push esi
mov esi, 0x41662c
push edi
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x416658]
inc eax
mov dword [0x416658], eax
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], 1
push dword [esi + 0xc1c]
mov dword [ebp - 0x14], 0x80
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov eax, dword [esi + 0xc24]
cmp eax, ebx
je 0x40c2a8
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
mov edi, eax
push ebx
push ebx
push ebx
lea eax, [esi + 0x810]
push ebx
push eax
call dword [sym.imp.WININET.dll_InternetOpenW]
cmp eax, ebx
mov dword [ebp - 0x10], eax
jne 0x40c2c8
mov dword [ebp - 4], ebx
jmp 0x40c55f
mov ecx, dword [0x414f7c]
mov dword [ebp + 8], ecx
lea ecx, [ebp + 8]
push 4
push ecx
push 2
push eax
call dword [sym.imp.WININET.dll_InternetSetOptionW]
push ebx
push 0x84000300
push edi
lea eax, [esi + 4]
push dword [esi + 0xc24]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x40c31b
cmp dword [esi + 0xc28], ebx
je 0x40c313
mov dword [0x41665c], 1
mov dword [ebp - 4], ebx
jmp 0x40c56d
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
lea ecx, [ebp - 0x14]
push ebx
push ecx
lea ecx, [ebp - 0x11c]
push ecx
push 5
push eax
call edi
test eax, eax
jne 0x40c33b
or eax, 0xffffffff
jmp 0x40c349
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.MSVCRT.dll__wtoi]
pop ecx
mov ecx, dword [esi + 0xc20]
cmp ecx, ebx
je 0x40c355
mov dword [ecx], eax
push eax
push dword [esi + 0x808]
push dword [0x41664c]
push dword [esi + 0x80c]
call dword [sym.imp.USER32.dll_PostMessageW]
lea eax, [ebp - 0x14]
push ebx
push eax
lea eax, [ebp - 0x11c]
push eax
push 0x13
push dword [ebp + 8]
call edi
test eax, eax
je 0x40c393
cmp word [ebp - 0x11c], 0x32
jne 0x40c2c0
push ebx
lea eax, [ebp - 0x1c]
push ebx
push eax
push dword [ebp + 8]
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
je 0x40c540
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x291c]
push 0x2800
push eax
push dword [ebp + 8]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40c540
cmp dword [esi], ebx
je 0x40c401
mov eax, dword [esi + 0x804]
cmp eax, 0xffffffff
je 0x40c4c8
lea ecx, [ebp - 0x18]
push ebx
push ecx
lea ecx, [ebp - 0x291c]
push dword [ebp - 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c540
jmp 0x40c4c8
mov ecx, dword [ebp - 8]
cmp ecx, ebx
je 0x40c5ec
mov eax, dword [esi + 0xc14]
cmp eax, ebx
je 0x40c4c2
cmp dword [eax], ebx
jne 0x40c45e
inc ecx
push ecx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
pop ecx
cmp eax, ebx
mov ecx, dword [esi + 0xc14]
mov dword [ecx], eax
je 0x40c540
push dword [ebp - 8]
lea eax, [ebp - 0x291c]
push eax
mov eax, dword [esi + 0xc14]
push dword [eax]
call dword [sym.imp.MSVCRT.dll_memmove]
mov eax, dword [esi + 0xc14]
mov ecx, dword [ebp - 8]
add esp, 0xc
mov eax, dword [eax]
jmp 0x40c4bf
mov eax, dword [ebp - 0xc]
lea eax, [ecx + eax + 1]
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
pop ecx
cmp edi, ebx
je 0x40c540
push dword [ebp - 0xc]
mov eax, dword [esi + 0xc14]
push dword [eax]
push edi
call dword [sym.imp.MSVCRT.dll_memmove]
push dword [ebp - 8]
lea eax, [ebp - 0x291c]
push eax
push edi
call dword [sym.imp.MSVCRT.dll_memmove]
mov eax, dword [esi + 0xc14]
push dword [eax]
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [esi + 0xc14]
mov ecx, dword [ebp - 0xc]
add esp, 0x1c
mov dword [eax], edi
mov eax, dword [esi + 0xc14]
mov eax, dword [eax]
add eax, dword [ebp - 8]
mov byte [eax + ecx], bl
mov eax, dword [ebp - 8]
mov dword [ebp - 0x18], eax
mov edi, dword [ebp - 0xc]
mov eax, dword [esi + 0xc18]
add edi, dword [ebp - 0x18]
cmp eax, ebx
mov dword [ebp - 0xc], edi
je 0x40c4dd
mov dword [eax], edi
mov eax, dword [esi + 0x80c]
cmp eax, ebx
je 0x40c4fb
push edi
push dword [esi + 0x808]
push dword [0x416648]
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
cmp dword [0x416650], ebx
je 0x40c519
cmp dword [0x416654], 0xffffffff
je 0x40c540
mov eax, dword [0x416654]
cmp eax, dword [esi + 0x808]
je 0x40c53a
mov eax, dword [esi + 0xc10]
cmp eax, 0xffffffff
je 0x40c52c
cmp eax, edi
jle 0x40c5ec
cmp dword [ebp - 8], ebx
je 0x40c5ec
jmp 0x40c393
mov dword [0x416650], ebx
mov eax, dword [esi + 0xc14]
lea edi, [esi + 0xc14]
cmp eax, ebx
mov dword [ebp - 4], ebx
je 0x40c55f
push dword [eax]
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [edi]
pop ecx
mov dword [eax], ebx
cmp dword [ebp + 8], ebx
je 0x40c56d
push dword [ebp + 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x10], ebx
je 0x40c57b
push dword [ebp - 0x10]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esi + 0x804]
cmp eax, 0xffffffff
je 0x40c58d
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x80c]
cmp eax, ebx
je 0x40c5ad
push dword [ebp - 4]
push dword [esi + 0x808]
push dword [0x416644]
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [esi + 0xc24]
cmp eax, ebx
je 0x40c5bf
push eax
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
pop ecx
mov esi, 0x41662c
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x416658]
dec eax
mov dword [0x416658], eax
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret
mov eax, dword [esi + 0xc18]
cmp eax, ebx
je 0x40c55f
mov ecx, dword [ebp - 0xc]
mov dword [eax], ecx
jmp 0x40c55f