Function at 0x401420
Capabilities:
Decrypt data via sspi
Get socket status
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x164
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0x20c]
test eax, eax
js 0x4018ab
cmp eax, 2
jne 0x40173c
cmp byte [edi + 0x244], 0
je 0x4014dd
mov eax, dword [edi + 0x21c]
lea ecx, [ebp - 8]
push ecx
push 0
lea ecx, [ebp - 0x160]
mov dword [ebp - 0x15c], eax
push ecx
push 0
inc eax
mov dword [ebp - 0x160], 1
push eax
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 1
jne 0x4014d0
lea eax, [ebp - 0x1c]
mov dword [ebp + 0xc], 0xffffffff
push eax
lea eax, [ebp + 0xc]
mov dword [ebp - 0x1c], 4
push eax
push 0x1007
push 0xffff
push dword [edi + 0x21c]
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
js 0x4014d0
cmp dword [ebp + 0xc], 0
jne 0x4014d0
mov byte [edi + 0x244], 0
cmp byte [edi + 0x244], 0
jne 0x4018a5
mov cl, byte [edi + 0x245]
test cl, cl
jne 0x4014f4
cmp dword [edi + 0x248], 0
je 0x40168c
mov dword [ebp - 0x20], 0
xorps xmm0, xmm0
movq qword [ebp - 8], xmm0
lea eax, [edi + 0x258]
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 2
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 2
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 1
mov dword [ebp + 0xc], 0x819c
movups xmmword [ebp - 0x30], xmm0
mov dword [ebp - 0x2c], eax
mov eax, dword [edi + 0x248]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x34]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0xc]
mov dword [ebp - 0x30], 2
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x50], eax
test cl, cl
je 0x401578
mov esi, dword [edi + 0x210]
lea eax, [edi + 0x228]
xor edx, edx
jmp 0x401582
xor esi, esi
lea edx, [edi + 0x228]
xor eax, eax
push 0
lea ebx, [ebp + 0xc]
push ebx
lea ebx, [ebp - 0x58]
push ebx
push eax
push 0
xor ebx, ebx
lea eax, [ebp - 0x18]
test cl, cl
cmovne eax, ebx
push eax
push ebx
push ebx
push 0x819c
push esi
push edx
lea eax, [edi + 0x220]
push eax
call dword [sym.imp.Secur32.dll_InitializeSecurityContextA]
mov ebx, eax
mov byte [edi + 0x245], 0
mov eax, dword [ebp - 0x24]
cmp eax, 5
jne 0x4015ec
mov eax, dword [edi + 0x248]
mov esi, dword [ebp - 0x28]
sub eax, esi
add eax, 0x258
add eax, edi
push esi
push eax
lea eax, [edi + 0x258]
push eax
call fcn.00406f00
add esp, 0xc
mov dword [edi + 0x248], esi
jmp 0x4015fb
cmp eax, 4
je 0x4015fb
mov dword [edi + 0x248], 0
test ebx, ebx
jne 0x401629
lea eax, [edi + 0x230]
push eax
push 4
lea eax, [edi + 0x228]
push eax
call dword [sym.imp.Secur32.dll_QueryContextAttributesW]
mov dword [edi + 0x20c], 3
lea eax, [ebx + 3]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x90320
jne 0x401647
mov dword [edi + 0x20c], 0xfffffff9
mov eax, 0xfffffff9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x90312
jne 0x4016b0
mov esi, dword [ebp - 0xc]
mov ebx, dword [ebp - 4]
test esi, esi
je 0x40167d
nop dword [eax]
push 0
push esi
push ebx
push dword [edi + 0x21c]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jle 0x40167a
add ebx, eax
sub esi, eax
jne 0x401660
mov ebx, dword [ebp - 4]
push ebx
call dword [sym.imp.Secur32.dll_FreeContextBuffer]
test esi, esi
jne 0x4018de
cmp dword [edi + 0x248], 0x4400
je 0x4018de
mov ecx, edi
call fcn.00401160
mov eax, dword [edi + 0x20c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x80090318
je 0x40168c
cmp ebx, 0x80090328
jne 0x4016d6
mov dword [edi + 0x20c], 0xfffffffa
mov eax, 0xfffffffa
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x80090322
jne 0x4016f4
mov dword [edi + 0x20c], 0xfffffffb
mov eax, 0xfffffffb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x80090325
jne 0x401712
mov dword [edi + 0x20c], 0xfffffffc
mov eax, 0xfffffffc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x80090326
je 0x401726
cmp ebx, 0x80090331
jne 0x4018de
mov dword [edi + 0x20c], 0xfffffffd
mov eax, 0xfffffffd
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [edi], 0x40
jne 0x40174d
mov eax, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, edi
call fcn.00401160
mov ecx, dword [edi + 0x248]
test ecx, ecx
je 0x4017e5
lea eax, [edi + 0x258]
mov dword [ebp - 0x48], 1
mov dword [ebp - 0x44], eax
lea eax, [ebp - 0x4c]
push 0
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x18]
push 0
push eax
lea eax, [edi + 0x228]
mov dword [ebp - 0x4c], ecx
push eax
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 4
call dword [sym.imp.Secur32.dll_DecryptMessage]
test eax, eax
jne 0x4018b2
mov eax, dword [ebp - 0x38]
xor ecx, ecx
cmp dword [ebp - 0x24], 5
mov dword [edi + 0x254], eax
mov eax, dword [ebp - 0x40]
cmove ecx, dword [ebp - 0x28]
mov dword [edi + 0x250], eax
mov eax, dword [edi + 0x248]
sub eax, ecx
mov dword [edi + 0x24c], eax
cmp dword [edi + 0x254], 0
je 0x4018a5
mov esi, dword [edi + 0x250]
push esi
call fcn.0040c1d2
add esp, 4
mov ebx, eax
push esi
push dword [edi + 0x254]
push ebx
call fcn.00406f00
mov ecx, dword [edi + 0x24c]
add esp, 0xc
mov eax, dword [edi + 0x248]
sub eax, ecx
push eax
lea eax, [ecx + 0x258]
add eax, edi
push eax
lea eax, [edi + 0x258]
push eax
call fcn.00406f00
mov eax, dword [edi + 0x24c]
add esp, 0xc
sub dword [edi + 0x248], eax
mov dword [edi + 0x24c], 0
mov dword [edi + 0x250], 0
mov dword [edi + 0x254], 0
mov eax, dword [edi]
cmp eax, 0x40
jge 0x401892
inc eax
mov dword [edi], eax
mov eax, dword [edi + 8]
mov dword [edi + eax*4 + 0xc], esi
mov eax, dword [edi + 8]
mov dword [edi + eax*4 + 0x10c], ebx
mov eax, dword [edi + 8]
inc eax
and eax, 0x8000003f
jns 0x40188f
dec eax
or eax, 0xffffffc0
inc eax
mov dword [edi + 8], eax
cmp dword [edi + 0x20c], 0
jne 0x4018a5
mov dword [edi + 0x20c], 1
mov eax, dword [edi + 0x20c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 0x90317
jne 0x4018cc
mov dword [edi + 0x20c], 0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 0x90321
je 0x4018de
cmp eax, 0x80090318
je 0x4017e5
mov dword [edi + 0x20c], 0xffffffff
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret