Function at 0x401d7a
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get client handle via schannel
Get outbound credentials handle via credssp
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff48
push ebx
push edi
push esi
lea ecx, [ebp - 0xc]
sub ecx, esp
push ecx
lea eax, [esp + 0x10]
push eax
call fcn.004037af
push 8
push dword [ebp + 0x10]
call fcn.004037af
push 8
push dword [ebp + 0x14]
call fcn.004037af
mov dword [ebp - 0x38], 4
mov dword [ebp - 8], 0x18
push 0
push dword [ebp + 0x14]
push 0
push 0
lea eax, [ebp - 0x38]
push eax
push 0
push 2
push str.Microsoft_Unified_Security_Protocol_Provider
push 0
call sub.secur32.dll_AcquireCredentialsHandleA
or eax, eax
jne 0x4021b5
push 6
push 1
push 2
call sub.wsock32.dll_socket
mov dword [ebp - 0x3c], eax
push 4
push dword [ebp + 0x18]
lea eax, [ebp - 0x3c]
push eax
call fcn.00403874
push dword [ebp + 8]
call fcn.00403633
or eax, eax
je 0x401e0a
mov eax, dword [ebp + 8]
jmp 0x401e1a
push 2
push dword [ebp + 8]
call fcn.0040316d
push eax
call sub.wsock32.dll_inet_ntoa
push eax
call sub.wsock32.dll_inet_addr
test eax, eax
je 0x4021b5
mov dword [ebp - 0x48], eax
mov eax, dword [ebp + 0xc]
cmp eax, 0x10000
jbe 0x401e3b
push eax
call fcn.004039b2
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x4a], ax
mov word [ebp - 0x4c], 2
mov dword [ebp - 0x50], 1
push 4
lea eax, [ebp - 0x50]
push eax
push 1
push 6
push dword [ebp - 0x3c]
call sub.wsock32.dll_setsockopt
mov dword [ebp - 0x50], 1
lea eax, [ebp - 0x50]
push eax
push 0x8004667e
push dword [ebp - 0x3c]
call sub.wsock32.dll_ioctlsocket
push 0x10
lea eax, [ebp - 0x4c]
push eax
push dword [ebp - 0x3c]
call sub.wsock32.dll_connect
push 0
push 0xa
lea eax, [ebp - 0x64]
push eax
push 0
push dword [ebp - 0x3c]
call fcn.004035f9
lea eax, [ebp - 0x58]
push eax
push 0
lea eax, [ebp - 0x64]
push eax
push 0
push 0
call sub.wsock32.dll_select
cmp eax, 1
jne 0x4021b5
mov dword [ebp - 0x50], 0
lea eax, [ebp - 0x50]
push eax
push 0x8004667e
push dword [ebp - 0x3c]
call sub.wsock32.dll_ioctlsocket
mov dword [ebp - 0x68], 0xc11c
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x7c], 2
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 1
lea eax, [ebp - 0x80]
mov dword [ebp - 0x6c], eax
push 0
lea eax, [ebp - 0xa8]
push eax
lea eax, [ebp - 0x74]
push eax
push dword [ebp + 0x10]
push 0
push 0
push 0x10
push 0
push dword [ebp - 0x68]
push dword [ebp + 8]
push 0
push dword [ebp + 0x14]
call sub.secur32.dll_InitializeSecurityContextA
cmp dword [ebp - 0x80], 0
je 0x4021b5
cmp dword [ebp - 0x78], 0
je 0x4021b5
push 0
push dword [ebp - 0x80]
push dword [ebp - 0x78]
push dword [ebp - 0x3c]
call fcn.00403011
push dword [ebp - 0x78]
call sub.secur32.dll_FreeContextBuffer
push 4
push 0x3000
push 0x8000
push 0
call sub.kernel32.dll_VirtualAlloc
test eax, eax
je 0x4021b5
mov dword [ebp - 0xac], eax
mov dword [ebp - 0xb8], 0x90312
mov dword [ebp - 0xb0], 0
jmp 0x40216b
cmp dword [ebp - 0xb0], 0
je 0x401fa3
cmp dword [ebp - 0xb8], 0x80090318
jne 0x401fdd
mov eax, dword [ebp - 0xac]
add eax, dword [ebp - 0xb0]
mov ecx, 0x8000
sub ecx, dword [ebp - 0xb0]
push 0xa
push ecx
push eax
push dword [ebp - 0x3c]
call fcn.004030a8
or eax, eax
je 0x40219b
cmp eax, 0
jl 0x40219b
add dword [ebp - 0xb0], eax
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x7c], 2
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 1
lea eax, [ebp - 0x80]
mov dword [ebp - 0x6c], eax
push 4
lea eax, [ebp - 0xa4]
push eax
lea eax, [ebp - 0xb0]
push eax
call fcn.00403874
mov dword [ebp - 0xa0], 2
push 4
lea eax, [ebp - 0x9c]
push eax
lea eax, [ebp - 0xac]
push eax
call fcn.00403874
mov dword [ebp - 0x98], 0
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x88], 2
lea eax, [ebp - 0xa4]
mov dword [ebp - 0x84], eax
push 0
lea eax, [ebp - 0xa8]
push eax
lea eax, [ebp - 0x74]
push eax
push 0
push 0
lea eax, [ebp - 0x8c]
push eax
push 0x10
push 0
push dword [ebp - 0x68]
push 0
push dword [ebp + 0x10]
push dword [ebp + 0x14]
call sub.secur32.dll_InitializeSecurityContextA
mov dword [ebp - 0xb8], eax
cmp dword [ebp - 0xb8], 0x80090318
je 0x40216b
cmp dword [ebp - 0xb8], 0
jl 0x40219b
cmp dword [ebp - 0xb8], 0
je 0x4020e8
cmp dword [ebp - 0xb8], 0x90312
jne 0x402100
cmp dword [ebp - 0x80], 0
je 0x402100
cmp dword [ebp - 0x78], 0
je 0x402100
push 0
push dword [ebp - 0x80]
push dword [ebp - 0x78]
push dword [ebp - 0x3c]
call fcn.00403011
push dword [ebp - 0x78]
call sub.secur32.dll_FreeContextBuffer
cmp dword [ebp - 0xb8], 0x90320
jne 0x402111
jmp 0x40219b
cmp dword [ebp - 0x94], 5
jne 0x402161
mov ecx, dword [ebp - 0xb0]
push 4
lea eax, [ebp - 0xb0]
push eax
lea eax, [ebp - 0x98]
push eax
call fcn.00403874
mov edx, dword [ebp - 0xac]
add edx, ecx
sub edx, dword [ebp - 0x98]
push dword [ebp - 0x98]
push dword [ebp - 0xac]
push edx
call fcn.00403874
mov dword [ebp - 0xb8], 0x90312
jmp 0x40216b
mov dword [ebp - 0xb0], 0
cmp dword [ebp - 0xb8], 0x90312
je 0x401f8e
cmp dword [ebp - 0xb8], 0x80090318
je 0x401f8e
cmp dword [ebp - 0xb8], 0x90320
je 0x401f8e
lea eax, [ebp - 0xac]
push eax
call fcn.0040258d
cmp dword [ebp - 0xb8], 0
jne 0x4021b5
mov eax, dword [ebp - 0x3c]
jmp 0x4021b7
xor eax, eax
pop esi
pop edi
pop ebx
leave
ret 0x14