Function at 0x1021cc7d
Capabilities:
Connect socket
Initialize winsock library
Set socket configuration

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x23c
mov eax, dword [0x10285008]
xor eax, esp
mov dword [esp + 0x238], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [esp + 0x10], eax
push esi
push edi
mov edi, edx
mov dword [esp + 0x10], ebx
xor esi, esi
mov dword [esp + 0x14], edi
cmp dword [ebx], 3
jne 0x1021cd8b
xor eax, eax
push 0x7e
mov word [esp + 0x34], ax
lea eax, [esp + 0x36]
push esi
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [esp + 0xb0]
push eax
push 2
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x1021ccef
mov eax, 0x80004005
jmp 0x1021ce6d
mov ecx, dword [ebx + 4]
push 0x5c
pop eax
cmp word [ecx], ax
jne 0x1021cd10
cmp word [ecx + 2], ax
jne 0x1021cd10
cmp word [ecx + 4], 0x2e
jne 0x1021cd10
cmp word [ecx + 6], ax
jne 0x1021cd10
add ecx, 8
mov edx, dword [ebx + 0x10]
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x34]
push eax
push dword [ebx + 0x18]
push dword [ebx + 0x14]
call fcn.1021d20d
test eax, eax
jne 0x1021ce6d
movzx eax, word [esp + 0x30]
push 1
push esi
push esi
push esi
push 1
push eax
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov esi, eax
or ebx, 0xffffffff
cmp esi, ebx
je 0x1021cce5
push dword [esp + 0x14]
lea eax, [esp + 0x34]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, ebx
jne 0x1021cd6c
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x1021cce5
push 4
xor ecx, ecx
lea eax, [esp + 0x14]
push eax
inc ecx
push ecx
push 6
push esi
mov dword [esp + 0x24], ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [edi], esi
jmp 0x1021ce6b
push esi
push 0x40000080
push 4
push esi
push esi
push 0xc0000000
push dword [ebx + 4]
call dword [0x102a9c60]
mov edi, eax
or ebx, 0xffffffff
cmp edi, ebx
jne 0x1021cdd5
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x1021cce5
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1021ce6d
movzx eax, ax
or eax, 0x80070000
jmp 0x1021ce6d
mov eax, dword [esp + 0x10]
cmp dword [eax], 2
je 0x1021ce65
mov eax, 0x1000
push eax
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetupComm]
test eax, eax
jne 0x1021cdfd
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1021cdac
mov eax, dword [esp + 0x10]
mov ecx, edi
push dword [esp + 0x18]
mov edx, dword [eax + 8]
call fcn.1021cbd3
mov dword [esp + 0x18], eax
test eax, eax
je 0x1021ce24
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
jmp 0x1021ce6d
mov eax, dword [esp + 0x10]
mov dword [esp + 0x1c], esi
mov eax, dword [eax + 0xc]
test eax, eax
je 0x1021ce45
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], eax
jmp 0x1021ce55
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
lea eax, [esp + 0x1c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
test eax, eax
je 0x1021cdf4
mov eax, dword [esp + 0x14]
mov dword [eax], edi
xor eax, eax
mov ecx, dword [esp + 0x244]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.10236010
mov esp, ebp
pop ebp
ret 4