Function at 0x4022c6
Capabilities:
Connect to http server
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:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43397b
mov eax, dword fs:[0]
push eax
mov eax, 0x2050
call fcn.00414c30
mov eax, dword [0x448020]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2048], ecx
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x2024]
mov ebx, dword [ebp + 0x14]
xor edi, edi
mov esi, dword [ebp + 0x1c]
and dword [ebp - 0x2028], 0
and dword [ebp - 0x2024], edi
mov dword [ebp - 0x204c], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x2018], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x2044], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x2034], ebx
mov dword [ebp - 0x2050], eax
call fcn.00402a99
and dword [ebp - 4], edi
push 0x2000
call fcn.0041d3b3
mov dword [ebp - 0x2040], eax
pop ecx
test eax, eax
jne 0x40237d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Memory_Allocation_Failed_:__d
push ebx
call fcn.00402e1a
add esp, 0xc
or edi, 0xffffffff
jmp 0x402883
and dword [ebp - 0x2030], 0
lea ecx, [ebp - 0x2030]
call fcn.00402a99
and dword [ebp - 0x202c], 0
lea ecx, [ebp - 0x202c]
call fcn.00402a99
lea eax, [ebp - 0x202c]
mov byte [ebp - 4], 2
push eax
lea eax, [ebp - 0x2030]
push eax
push dword [ebp - 0x204c]
call fcn.0040290e
test eax, eax
jne 0x4023c9
mov esi, 0x4420e0
jmp 0x40240e
xor eax, eax
cmp dword [esi + 8], eax
jne 0x4023e0
push str.Ready...
push dword [esi + 4]
call dword [sym.imp.USER32.dll_SetWindowTextW]
xor eax, eax
push eax
push eax
push 3
push eax
push eax
mov eax, dword [ebp - 0x2048]
push 0x1bb
push dword [ebp - 0x2030]
push dword [eax]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x204c], eax
test eax, eax
jne 0x402421
mov esi, str.InternetConnect_Failed_:__d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push ebx
call fcn.00402e1a
add esp, 0xc
jmp 0x40246d
xor ecx, ecx
push ecx
push 0x4802000
push ecx
push ecx
push str.HTTP_1.1
push dword [ebp - 0x202c]
push 0x44216c
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp - 0x203c], eax
test eax, eax
jne 0x402475
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HttpOpenRequest_Failed_:__d
push ebx
call fcn.00402e1a
add esp, 0xc
push dword [ebp - 0x204c]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
or edi, 0xffffffff
jmp 0x40286d
cmp dword [esi + 8], 0
jne 0x40248c
push 0
push 5
push 0x402
push dword [esi]
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [ebp - 0x2048]
add eax, 0x10
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x2048]
mov eax, dword [ebp - 0x203c]
mov dword [ecx + 4], eax
lea eax, [ecx + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
cmp dword [esi + 8], eax
jne 0x4024cc
push str.Donwloading_:_0_
push dword [esi + 4]
call dword [sym.imp.USER32.dll_SetWindowTextW]
xor eax, eax
push eax
push eax
push eax
push eax
push dword [ebp - 0x203c]
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x4024ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
or edi, 0xffffffff
jmp 0x402830
cmp dword [esi + 8], 0
push 0xa
pop eax
jne 0x402507
push 0
push eax
push 0x402
push dword [esi]
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, dword [ebp - 0x2044]
lea eax, [ebp - 0x201c]
and dword [ebp - 0x201c], 0
push eax
lea eax, [ebp - 0x2020]
mov dword [ebp - 0x2020], 0x1ff
push eax
push 0x200
call fcn.00402ae0
push eax
push 0x13
push dword [ebp - 0x203c]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
push ecx
mov ecx, dword [ebp - 0x2044]
call fcn.00402ac0
and dword [ebp - 0x201c], 0
lea eax, [ebp - 0x201c]
push eax
lea eax, [ebp - 0x2020]
mov dword [ebp - 0x2020], 0x1ff
push eax
push 0x200
mov ecx, ebx
call fcn.00402ae0
push eax
push 0x14
push dword [ebp - 0x203c]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
push ecx
mov ecx, ebx
call fcn.00402ac0
mov ecx, dword [ebp - 0x2044]
push 0x4421e4
call fcn.00402b18
test eax, eax
jne 0x402830
and dword [ebp - 0x201c], eax
lea ecx, [ebp - 0x2024]
lea eax, [ebp - 0x201c]
mov dword [ebp - 0x2020], 0x1ff
push eax
lea eax, [ebp - 0x2020]
push eax
push 0x200
call fcn.00402ae0
push eax
push 5
push dword [ebp - 0x203c]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
push ecx
lea ecx, [ebp - 0x2024]
call fcn.00402ac0
push dword [ebp - 0x2024]
call fcn.0041d2e7
pop ecx
mov ecx, dword [ebp - 0x2050]
mov dword [ecx], eax
test eax, eax
jle 0x402830
push 0
push 0x80
push 2
push 0
push 1
push 0xc0000000
push dword [ebp - 0x2018]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2018], eax
test eax, eax
je 0x4027b9
and dword [ebp - 0x2058], 0
push 0xa
pop eax
push 0x2000
push 0
push dword [ebp - 0x2040]
mov dword [ebp - 0x2054], eax
call fcn.00415870
mov ebx, dword [ebp - 0x203c]
add esp, 0xc
lea eax, [ebp - 0x2028]
push eax
push 0x2000
push dword [ebp - 0x2040]
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4027a7
cmp dword [ebp - 0x2028], 0
je 0x4027a7
and dword [ebp - 0x2038], 0
lea eax, [ebp - 0x2038]
push 0
push eax
push dword [ebp - 0x2028]
push dword [ebp - 0x2040]
push dword [ebp - 0x2018]
call dword [sym.imp.KERNEL32.dll_WriteFile]
add edi, dword [ebp - 0x2028]
push 0x2000
push 0
push dword [ebp - 0x2040]
call fcn.00415870
mov eax, dword [ebp - 0x2050]
add esp, 0xc
movd xmm1, edi
cvtdq2pd xmm1, xmm1
movd xmm0, dword [eax]
mulsd xmm1, qword [0x442c38]
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
cvttsd2si eax, xmm1
mov dword [ebp - 0x2014], eax
cmp eax, dword [ebp - 0x2054]
jle 0x402667
lea ecx, [eax + 0xa]
mov dword [ebp - 0x2054], eax
push ecx
mov ecx, esi
call fcn.00401d13
mov eax, dword [ebp - 0x2014]
push 0xa
cdq
pop ecx
idiv ecx
mov dword [ebp - 0x205c], eax
cmp eax, dword [ebp - 0x2058]
jle 0x402667
and dword [ebp - 0x2014], 0
lea ecx, [ebp - 0x2014]
mov dword [ebp - 0x2058], eax
call fcn.00402a99
push dword [ebp - 0x205c]
lea eax, [ebp - 0x2014]
mov byte [ebp - 4], 3
push str.Downloading_:__d__
push eax
call fcn.00402e1a
add esp, 0xc
cmp dword [esi + 8], 0
jne 0x402793
cmp dword [ebp - 0x2014], 0
je 0x402793
push dword [ebp - 0x2014]
push dword [esi + 4]
call dword [sym.imp.USER32.dll_SetWindowTextW]
lea ecx, [ebp - 0x2014]
mov byte [ebp - 4], 2
call fcn.00402b89
jmp 0x402667
push dword [ebp - 0x2018]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x2034]
mov eax, dword [ebp - 0x2050]
cmp edi, dword [eax]
jge 0x402830
and dword [ebp - 0x2018], 0
lea eax, [ebp - 0x2010]
push 0x2000
push 0
push eax
call fcn.00415870
add esp, 0xc
mov dword [ebp - 0x2034], 0xffe
lea eax, [ebp - 0x2034]
push eax
lea eax, [ebp - 0x2010]
push eax
lea eax, [ebp - 0x2018]
push eax
call dword [sym.imp.WININET.dll_InternetGetLastResponseInfoW]
test eax, eax
je 0x402830
push dword [ebp - 0x2018]
push 0x4421ec
push dword [ebp - 0x2044]
call fcn.00402e1a
add esp, 0xc
lea eax, [ebp - 0x2010]
mov ecx, ebx
push eax
call fcn.004029f8
push dword [ebp - 0x2040]
call fcn.00418693
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
pop ecx
push dword [ebp - 0x203c]
call esi
push dword [ebp - 0x204c]
call esi
mov esi, dword [ebp - 0x2048]
lea ebx, [esi + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
and dword [esi + 4], 0
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [ebp - 0x202c]
call fcn.00402b89
lea ecx, [ebp - 0x2030]
call fcn.00402b89
lea ecx, [ebp - 0x2024]
call fcn.00402b89
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00413a04
leave
ret 0x18