Function at 0x4015b0
Capabilities:
Download and write a file
Read and send data from client to server
Read data from internet
Read file on windows
Receive and write data from server to client
Receive data
Send data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 0x2c
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
jne 0x401673
mov eax, dword [ebx + 0x30]
cmp eax, 7
je 0x401673
cmp eax, 6
ja case.default.0x4015e8
jmp dword [eax*4 + 0x4019c0]
lea eax, [ebx + 0x40]
mov dword [ebx + 0x30], 5
push eax
xor esi, esi
call ecx
cmp dword [ebx + 0x60], 1
lea eax, [ebx + 0x40]
push eax
jne 0x401611
call edi
mov esi, 0x3e3
jmp 0x401665
inc dword [ebx + 0x5c]
call edi
push 0
push 0
push 0
push 0
push dword [ebx]
call dword [sym.imp.WININET.dll_HttpSendRequestW]
mov dword [ebp + 0xc], eax
lea eax, [ebx + 0x40]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call eax
dec dword [ebx + 0x5c]
cmp dword [ebx + 0x60], 1
jne 0x401652
cmp dword [ebx + 0x5c], esi
jne 0x401652
lea eax, [ebx + 0x40]
push eax
call edi
push dword [ebx]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x401658
lea eax, [ebx + 0x40]
push eax
call edi
cmp dword [ebp + 0xc], esi
jne 0x401665
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test esi, esi
je 0x4015d3
cmp esi, 0x3e5
je 0x4019b9
mov eax, esi
test esi, esi
jne 0x401977
lea eax, [ebp + 0xc]
mov dword [ebp - 4], 4
push eax
lea eax, [ebp - 4]
mov dword [ebp + 0xc], esi
push eax
lea edi, [ebx + 0x38]
push edi
push 0x20000013
push dword [ebx]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x401985
mov dword [edi], eax
jmp 0x401985
mov eax, dword [ebx + 0x1c]
xor esi, esi
mov dword [ebp - 0x10], eax
lea eax, [ebx + 0x40]
push eax
mov dword [ebx + 0x30], 2
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x2c], 0x28
mov dword [ebp - 0x24], str.Content_Type:_application_x_www_form_urlencoded
mov dword [ebp - 0x20], 0x2f
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x14], esi
call ecx
cmp dword [ebx + 0x60], 1
lea eax, [ebx + 0x40]
push eax
jne 0x40170d
call edi
mov esi, 0x3e3
jmp 0x401665
inc dword [ebx + 0x5c]
call edi
push ebx
push 0
push 0
lea eax, [ebp - 0x2c]
push eax
push dword [ebx]
call dword [sym.imp.WININET.dll_HttpSendRequestExW]
jmp 0x401626
mov eax, dword [ebx + 0x1c]
lea ecx, [ebx + 0x10]
xor esi, esi
mov dword [ebx + 0x30], 3
mov dword [ecx], eax
test eax, eax
je 0x401665
cmp eax, 0x1000
jbe 0x401753
mov dword [ecx], 0x1000
mov eax, 0x1000
mov edx, dword [ebx + 0x14]
cmp edx, 0xffffffff
je 0x40177c
push 0
push ecx
push eax
push dword [ebx + 8]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40165d
mov eax, dword [ebx + 0x10]
sub dword [ebx + 0x1c], eax
jmp 0x401665
push eax
push dword [ebx + 0x18]
push dword [ebx + 8]
call fcn.00413f40
mov eax, dword [ebx + 0x10]
add esp, 0xc
add dword [ebx + 0x18], eax
sub dword [ebx + 0x1c], eax
jmp 0x401665
xor esi, esi
mov dword [ebx + 0x30], 2
mov dword [ebp + 0xc], esi
cmp dword [ebx + 0x10], esi
jne 0x4017b6
mov dword [ebx + 0x30], 4
jmp case.default.0x4015e8
lea eax, [ebx + 0x40]
push eax
call ecx
cmp dword [ebx + 0x60], 1
lea eax, [ebx + 0x40]
push eax
je 0x40196c
inc dword [ebx + 0x5c]
call edi
lea eax, [ebp + 0xc]
push eax
push dword [ebx + 0x10]
push dword [ebx + 8]
push dword [ebx]
call dword [sym.imp.WININET.dll_InternetWriteFile]
mov dword [ebp - 4], eax
lea eax, [ebx + 0x40]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call eax
dec dword [ebx + 0x5c]
cmp dword [ebx + 0x60], 1
jne 0x40180d
cmp dword [ebx + 0x5c], esi
jne 0x40180d
lea eax, [ebx + 0x40]
push eax
call edi
push dword [ebx]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x401813
lea eax, [ebx + 0x40]
push eax
call edi
cmp dword [ebp - 4], esi
jne 0x401665
jmp 0x40165d
lea eax, [ebx + 0x40]
mov dword [ebx + 0x30], 5
push eax
xor esi, esi
call ecx
cmp dword [ebx + 0x60], 1
lea eax, [ebx + 0x40]
push eax
jne 0x401846
call edi
mov esi, 0x3e3
jmp 0x401665
inc dword [ebx + 0x5c]
call edi
push 0
push 0
push 0
push dword [ebx]
call dword [sym.imp.WININET.dll_HttpEndRequestW]
jmp 0x401626
lea eax, [ebx + 0x40]
mov dword [ebx + 0x30], 6
push eax
xor esi, esi
call ecx
cmp dword [ebx + 0x60], 1
lea eax, [ebx + 0x40]
push eax
jne 0x401883
call edi
mov esi, 0x3e3
jmp 0x401665
inc dword [ebx + 0x5c]
call edi
lea eax, [ebx + 0xc]
push eax
push 0x1000
push dword [ebx + 8]
push dword [ebx]
call dword [sym.imp.WININET.dll_InternetReadFile]
jmp 0x401626
mov ecx, dword [ebx + 0xc]
mov dword [ebx + 0x30], 5
mov dword [ebp - 4], 0
test ecx, ecx
jne 0x4018c4
xor esi, esi
mov dword [ebx + 0x30], 7
jmp 0x401665
mov eax, dword [ebx + 0x20]
cmp eax, 0xffffffff
je 0x4018ec
push 0
lea edx, [ebp - 4]
push edx
push ecx
push dword [ebx + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40165d
xor esi, esi
jmp 0x401665
mov esi, dword [ebx + 0x24]
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push esi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapSize]
mov edx, dword [ebx + 0xc]
mov esi, dword [ebx + 0x28]
lea ecx, [edx + 1]
add ecx, esi
cmp eax, ecx
jae 0x40193d
add eax, eax
mov dword [ebp + 0xc], eax
cmp eax, ecx
jae 0x40191a
mov dword [ebp + 0xc], ecx
mov esi, dword [ebx + 0x24]
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push dword [ebp + 0xc]
push esi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
test eax, eax
je 0x401970
mov edx, dword [ebx + 0xc]
mov esi, dword [ebx + 0x28]
mov dword [ebx + 0x24], eax
mov eax, dword [ebx + 0x24]
push edx
push dword [ebx + 8]
add eax, esi
push eax
call fcn.00413f40
mov eax, dword [ebx + 0xc]
add esp, 0xc
add dword [ebx + 0x28], eax
mov ecx, dword [ebx + 0x28]
mov eax, dword [ebx + 0x24]
mov byte [ecx + eax], 0
mov ecx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor esi, esi
jmp 0x4015d3
call edi
jmp 0x401980
mov esi, 8
jmp 0x401985
mov esi, eax
cmp eax, 0x2ef1
jne 0x401985
mov esi, 0x3e3
push 1
lea eax, [ebx + 0x60]
mov dword [ebx + 0x34], esi
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
jne 0x4019b9
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea edi, [ebx + 0x40]
push edi
call eax
mov esi, dword [ebx + 0x5c]
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
jne 0x4019b9
push dword [ebx]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret