Function at 0x10beb90
Capabilities:
Encrypt data using chaskey

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xc
push esi
mov esi, dword [ebp + 8]
push edi
push esi
call fcn.01046120
push esi
call fcn.010be650
push esi
call fcn.010be7a0
push esi
call fcn.010be8f0
push esi
call fcn.010bea40
mov eax, dword [esi]
push 0
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 8]
push edx
push 0x10165d0
push 0x1014eb8
push connect
push eax
call fcn.010b5740
mov edi, eax
test edi, edi
je 0x10bec1c
cmp word [edi], 0
je 0x10bebf9
jmp 0x10bebf0
add eax, 2
cmp word [eax], 0
jne 0x10bebf0
sub eax, edi
sar eax, 1
push eax
push edi
call fcn.0102b7a0
mov ecx, dword [esi]
push edi
push 0
mov dword [ecx + 0x1d660], eax
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.DLL_HeapFree]
mov eax, dword [esi]
xor edi, edi
push edi
lea edx, [ebp + 8]
push edx
lea ecx, [ebp - 8]
push ecx
push 0x10165b4
push 0x1014eb8
push connect
push eax
call fcn.010b5740
test eax, eax
je 0x10bec54
mov edi, dword [eax]
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.DLL_HeapFree]
mov edx, dword [esi]
push ebx
push 0
mov dword [edx + 0x1d65c], edi
mov eax, dword [esi]
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 8]
push edx
push 0x1016590
push 0x1016564
push connect
push eax
call fcn.010b5740
push 0
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 8]
push edx
push 0x1016540
push 0x1016564
mov edi, eax
mov eax, dword [esi]
push connect
push eax
call fcn.010b5740
push 0
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 8]
push edx
push 0x1016518
push 0x1016564
mov ebx, eax
mov eax, dword [esi]
push connect
push eax
call fcn.010b5740
push 0
lea ecx, [ebp - 8]
push ecx
lea edx, [ebp - 4]
push edx
push 0x10164f8
push 0x1016564
mov dword [ebp + 8], eax
mov eax, dword [esi]
push connect
push eax
call fcn.010b5740
push 0
lea ecx, [ebp - 8]
push ecx
lea edx, [ebp - 0xc]
push edx
push 0x10164d8
push 0x1016564
mov dword [ebp - 4], eax
mov eax, dword [esi]
push connect
push eax
call fcn.010b5740
mov ecx, dword [ebp + 8]
mov edx, dword [esi]
push eax
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
push eax
push ecx
push ebx
push edi
push edx
call fcn.01063dd0
test edi, edi
je 0x10bed3a
push edi
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
mov edi, dword [sym.imp.KERNEL32.DLL_HeapFree]
push eax
call edi
jmp 0x10bed40
mov edi, dword [sym.imp.KERNEL32.DLL_HeapFree]
test ebx, ebx
je 0x10bed54
push ebx
mov ebx, dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push 0
call ebx
push eax
call edi
jmp 0x10bed5a
mov ebx, dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
mov eax, dword [ebp + 8]
test eax, eax
je 0x10bed69
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [ebp - 4]
test eax, eax
je 0x10bed78
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [ebp - 8]
test eax, eax
je 0x10bed87
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [esi]
push 0
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 0xc]
push edx
push 0x1014ee8
push 0x1014eb8
push connect
push eax
call fcn.010b5740
mov edi, eax
test edi, edi
je 0x10bee5c
cmp byte [edi], 0
je 0x10bee48
mov eax, dword [esi]
push 0
push 0
push 0
push 0
push 0
push edi
push 0
push eax
call fcn.01061d90
push 0x105
lea ebx, [esi + 0xa7c]
push 0
push ebx
call sub.msvcrt.dll_memset
push edi
push 0x1014fe4
push 0x103
push ebx
call fcn.0102ac00
mov ecx, dword [esi]
mov ebx, dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
add esp, 0x1c
push 1
add ecx, 0x1d658
push ecx
mov dword [esi + 0x109c], 1
mov dword [esi + 0x10a0], 0
call ebx
mov edx, dword [esi]
push 0x10164bc
push 0x1014eb8
push connect
push edx
call fcn.010b59a0
mov edx, dword [esi]
xor ecx, ecx
test eax, eax
setne cl
add edx, 0x1d654
push ecx
push edx
call ebx
push edi
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
mov ebx, dword [sym.imp.KERNEL32.DLL_HeapFree]
push eax
call ebx
jmp 0x10bee62
mov ebx, dword [sym.imp.KERNEL32.DLL_HeapFree]
mov eax, dword [esi]
push 0x10164a8
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
mov edx, dword [ecx + 0x1c8e4]
xor edx, eax
push 0x1016478
and edx, 1
xor dword [ecx + 0x1c8e4], edx
mov eax, dword [esi]
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
lea edx, [eax + eax]
xor edx, dword [ecx + 0x1c8e4]
push 0x1016464
and edx, 2
xor dword [ecx + 0x1c8e4], edx
mov eax, dword [esi]
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
lea edx, [eax*4]
xor edx, dword [ecx + 0x1c8e4]
push 0x1016454
and edx, 4
xor dword [ecx + 0x1c8e4], edx
mov eax, dword [esi]
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
lea edx, [eax*8]
xor edx, dword [ecx + 0x1c8e4]
push 0x101643c
and edx, 8
xor dword [ecx + 0x1c8e4], edx
mov eax, dword [esi]
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 4
xor eax, dword [ecx + 0x1c8e4]
push 0x1016430
and eax, 0x10
xor dword [ecx + 0x1c8e4], eax
mov ecx, dword [esi]
push 0x1016490
push connect
push ecx
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 5
xor eax, dword [ecx + 0x1c8e4]
push 0x101641c
and eax, 0x20
xor dword [ecx + 0x1c8e4], eax
mov edx, dword [esi]
push 0x1016490
push connect
push edx
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 6
xor eax, dword [ecx + 0x1c8e4]
push 0x1016410
and eax, 0x40
xor dword [ecx + 0x1c8e4], eax
mov eax, dword [esi]
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 7
xor eax, dword [ecx + 0x1c8e4]
push 0x10163fc
and eax, 0x80
xor dword [ecx + 0x1c8e4], eax
mov ecx, dword [esi]
push 0x1016490
push connect
push ecx
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 8
xor eax, dword [ecx + 0x1c8e4]
push 0x10163f0
and eax, 0x100
xor dword [ecx + 0x1c8e4], eax
mov edx, dword [esi]
push 0x1016490
push connect
push edx
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 9
xor eax, dword [ecx + 0x1c8e4]
push 0x10163dc
and eax, 0x200
xor dword [ecx + 0x1c8e4], eax
mov eax, dword [esi]
push 0x1016490
push connect
push eax
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 0xa
xor eax, dword [ecx + 0x1c8e4]
push 0x10163c4
and eax, 0x400
xor dword [ecx + 0x1c8e4], eax
mov ecx, dword [esi]
push 0x1016490
push connect
push ecx
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 0xb
xor eax, dword [ecx + 0x1c8e4]
push 0x10163b0
and eax, 0x800
xor dword [ecx + 0x1c8e4], eax
mov edx, dword [esi]
push 0x1016490
push connect
push edx
call fcn.010b5b10
mov ecx, dword [esi]
shl eax, 0xc
xor eax, dword [ecx + 0x1c8e4]
xor edi, edi
push edi
and eax, 0x1000
xor dword [ecx + 0x1c8e4], eax
mov eax, dword [esi]
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 0xc]
push edx
push 0x1016380
push 0x1014eb8
push connect
push eax
call fcn.010b5740
test eax, eax
je 0x10bf0d8
mov edi, dword [eax]
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call ebx
mov eax, dword [esi]
mov dword [eax + 0x1ca08], edi
mov eax, dword [esi]
xor edi, edi
push edi
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 0xc]
push edx
push 0x1016358
push 0x1014eb8
push connect
push eax
call fcn.010b5740
test eax, eax
je 0x10bf114
mov edi, dword [eax]
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call ebx
mov eax, dword [esi]
shl edi, 0xd
xor edi, dword [eax + 0x1c8e4]
lea ecx, [ebp + 8]
and edi, 0x2000
xor dword [eax + 0x1c8e4], edi
mov eax, dword [esi]
xor edi, edi
push edi
push ecx
lea edx, [ebp - 0xc]
push edx
push 0x101632c
push 0x1014eb8
push connect
push eax
call fcn.010b5740
test eax, eax
je 0x10bf15f
mov edi, dword [eax]
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call ebx
mov eax, dword [esi]
shl edi, 0xe
xor edi, dword [eax + 0x1c8e4]
lea ecx, [ebp + 8]
and edi, 0x4000
xor dword [eax + 0x1c8e4], edi
mov eax, dword [esi]
xor edi, edi
push edi
push ecx
lea edx, [ebp - 0xc]
push edx
push 0x1016314
push 0x1014eb8
push connect
push eax
call fcn.010b5740
test eax, eax
je 0x10bf1aa
mov edi, dword [eax]
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call ebx
mov eax, dword [esi]
shl edi, 0xf
xor edi, dword [eax + 0x1c8e4]
pop ebx
and edi, 0x8000
xor dword [eax + 0x1c8e4], edi
mov eax, dword [esi]
cmp dword [eax + 0x1c8e4], 0
jne 0x10bf22b
or dword [eax + 0x1c8e4], 1
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 2
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 4
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 0x40
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 0x100
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 0x400
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 0x800
mov eax, dword [esi]
or dword [eax + 0x1c8e4], 0x1000
mov esi, dword [esi]
and dword [esi + 0x1c8e4], 0xffff7fff
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4