Function at 0x40a150
Capabilities:
Encode data using xor
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x10
test eax, eax
push ebx
mov ebx, ecx
jne 0x40a184
lea eax, [esp + 0x18]
lea ecx, [esp + 8]
push eax
mov dword [esp + 0x1c], 0x4213b4
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea ecx, [esp + 8]
push 0x41c9c0
push ecx
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [esp + 0x20]
cmp eax, 0x10
je 0x40a1bd
cmp eax, 0x18
je 0x40a1bd
cmp eax, 0x20
je 0x40a1bd
lea edx, [esp + 0x18]
lea ecx, [esp + 8]
push edx
mov dword [esp + 0x1c], 0x4213b4
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea eax, [esp + 8]
push 0x41c9c0
push eax
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [esp + 0x24]
cmp ecx, 0x10
je 0x40a1f6
cmp ecx, 0x18
je 0x40a1f6
cmp ecx, 0x20
je 0x40a1f6
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], 0x4213b4
push ecx
lea ecx, [esp + 0xc]
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea edx, [esp + 8]
push 0x41c9c0
push edx
call sub.MSVCRT.dll__CxxThrowException
push ebp
mov dword [ebx + 0x3c8], eax
mov eax, dword [esp + 0x20]
mov dword [ebx + 0x3cc], ecx
push esi
mov edx, ecx
push edi
mov esi, eax
lea edi, [ebx + 0x3d0]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x3cc]
mov esi, eax
mov eax, ecx
lea edi, [ebx + 0x3f0]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 0x3c8]
cmp eax, 0x10
je 0x40a272
cmp eax, 0x18
je 0x40a257
mov dword [ebx + 0x410], 0xe
jmp 0x40a297
mov ecx, dword [ebx + 0x3cc]
sub ecx, 0x20
neg ecx
sbb ecx, ecx
and ecx, 0xfffffffe
add ecx, 0xe
mov dword [ebx + 0x410], ecx
jmp 0x40a297
mov eax, dword [ebx + 0x3cc]
cmp eax, 0x10
jne 0x40a284
mov eax, 0xa
jmp 0x40a291
sub eax, 0x18
neg eax
sbb eax, eax
and eax, 2
add eax, 0xc
mov dword [ebx + 0x410], eax
mov eax, dword [ebx + 0x3cc]
cdq
and edx, 3
add eax, edx
xor edx, edx
mov ecx, eax
mov eax, dword [ebx + 0x410]
sar ecx, 2
test eax, eax
mov dword [esp + 0x2c], ecx
jl 0x40a2d7
lea esi, [ebx + 8]
test ecx, ecx
jle 0x40a2c9
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x2c]
mov eax, dword [ebx + 0x410]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x40a2bb
mov eax, dword [ebx + 0x410]
xor edx, edx
test eax, eax
jl 0x40a305
lea esi, [ebx + 0x1e8]
test ecx, ecx
jle 0x40a2f7
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x2c]
mov eax, dword [ebx + 0x410]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x40a2e9
mov edi, dword [ebx + 0x410]
mov eax, dword [ebx + 0x3c8]
inc edi
lea esi, [ebx + 0x414]
cdq
imul edi, ecx
and edx, 3
mov dword [esp + 0x30], edi
add eax, edx
mov ebp, eax
mov eax, dword [esp + 0x24]
sar ebp, 2
test ebp, ebp
mov dword [esp + 0x10], ebp
jle 0x40a36e
mov dword [esp + 0x24], ebp
xor edx, edx
add esi, 4
mov dl, byte [eax]
shl edx, 0x18
mov dword [esi - 4], edx
inc eax
xor edx, edx
mov dl, byte [eax]
shl edx, 0x10
or dword [esi - 4], edx
inc eax
xor edx, edx
mov dh, byte [eax]
or dword [esi - 4], edx
inc eax
xor edx, edx
mov dl, byte [eax]
or dword [esi - 4], edx
mov edx, dword [esp + 0x24]
inc eax
dec edx
mov dword [esp + 0x24], edx
jne 0x40a33a
xor esi, esi
test ebp, ebp
jle 0x40a3cf
lea eax, [ebx + 0x414]
mov dword [esp + 0x24], eax
cmp esi, edi
jge 0x40a576
mov eax, esi
cdq
idiv ecx
mov edi, eax
mov eax, esi
cdq
idiv ecx
mov dword [esp + 0x28], edx
lea eax, [edx + edi*8]
mov edx, dword [esp + 0x24]
mov edx, dword [edx]
mov dword [ebx + eax*4 + 8], edx
mov eax, dword [ebx + 0x410]
mov edx, dword [esp + 0x28]
sub eax, edi
inc esi
lea edx, [edx + eax*8]
mov eax, dword [esp + 0x24]
mov edi, dword [eax]
add eax, 4
mov dword [ebx + edx*4 + 0x1e8], edi
mov edi, dword [esp + 0x30]
cmp esi, ebp
mov dword [esp + 0x24], eax
jl 0x40a37e
cmp esi, edi
jge 0x40a576
mov dword [esp + 0x28], 0x41a1b0
mov eax, dword [ebx + ebp*4 + 0x410]
xor ecx, ecx
mov dword [esp + 0x24], eax
mov cl, byte [esp + 0x26]
xor edx, edx
movsx edi, byte [ecx + str.cw]
mov ecx, dword [esp + 0x28]
movsx ecx, byte [ecx]
xor edi, ecx
xor ecx, ecx
mov cl, ah
and eax, 0xff
shl edi, 8
mov dl, byte [ecx + str.cw]
xor ecx, ecx
xor edi, edx
xor edx, edx
mov dl, byte [eax + str.cw]
xor eax, eax
mov al, byte [esp + 0x27]
shl edi, 8
mov cl, byte [eax + str.cw]
xor edi, edx
mov edx, dword [ebx + 0x414]
shl edi, 8
xor edi, ecx
mov ecx, dword [esp + 0x28]
xor edx, edi
inc ecx
cmp ebp, 8
mov dword [ebx + 0x414], edx
mov dword [esp + 0x28], ecx
je 0x40a478
cmp ebp, 1
jle 0x40a507
lea eax, [ebx + 0x418]
lea ecx, [ebp - 1]
mov edx, dword [eax - 4]
mov edi, dword [eax]
xor edi, edx
mov dword [eax], edi
add eax, 4
dec ecx
jne 0x40a464
jmp 0x40a507
lea eax, [ebx + 0x418]
mov ecx, 3
mov edx, dword [eax - 4]
mov edi, dword [eax]
xor edi, edx
mov dword [eax], edi
add eax, 4
dec ecx
jne 0x40a483
mov eax, dword [ebx + 0x420]
xor ecx, ecx
mov dword [esp + 0x24], eax
mov cl, byte [esp + 0x27]
xor edx, edx
movsx edi, byte [ecx + str.cw]
xor ecx, ecx
mov cl, byte [esp + 0x26]
shl edi, 8
mov dl, byte [ecx + str.cw]
xor ecx, ecx
xor edi, edx
xor edx, edx
mov dl, ah
and eax, 0xff
shl edi, 8
mov cl, byte [edx + str.cw]
xor edx, edx
mov dl, byte [eax + str.cw]
mov eax, dword [ebx + 0x424]
xor edi, ecx
mov ecx, 3
shl edi, 8
xor edi, edx
xor eax, edi
mov dword [ebx + 0x424], eax
lea eax, [ebx + 0x428]
mov edx, dword [eax - 4]
mov edi, dword [eax]
xor edi, edx
mov dword [eax], edi
add eax, 4
dec ecx
jne 0x40a4f8
test ebp, ebp
mov dword [esp + 0x24], 0
jle 0x40a566
lea edi, [ebx + 0x414]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
cmp esi, eax
jge 0x40a576
mov eax, esi
mov ebp, dword [edi]
cdq
idiv ecx
add edi, 4
mov ecx, eax
mov eax, esi
cdq
idiv dword [esp + 0x2c]
lea eax, [edx + ecx*8]
mov dword [ebx + eax*4 + 8], ebp
mov eax, dword [ebx + 0x410]
mov ebp, dword [esp + 0x10]
sub eax, ecx
lea ecx, [edx + eax*8]
mov eax, dword [esp + 0x24]
mov edx, dword [edi - 4]
inc eax
inc esi
cmp eax, ebp
mov dword [ebx + ecx*4 + 0x1e8], edx
mov dword [esp + 0x24], eax
jl 0x40a519
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
cmp esi, eax
jl 0x40a3df
mov edx, dword [ebx + 0x410]
mov eax, 1
cmp edx, eax
mov dword [esp + 0x30], eax
jle 0x40a5f3
lea ebp, [ebx + 0x208]
test ecx, ecx
jle 0x40a5dd
mov esi, ebp
mov edi, ecx
mov eax, dword [esi]
xor ecx, ecx
mov dword [esp + 0x24], eax
mov cl, byte [esp + 0x27]
xor edx, edx
add esi, 4
mov dl, byte [esp + 0x26]
mov ecx, dword [ecx*4 + 0x4191b0]
xor ecx, dword [edx*4 + 0x4195b0]
xor edx, edx
mov dl, ah
and eax, 0xff
xor ecx, dword [edx*4 + 0x4199b0]
mov edx, dword [eax*4 + 0x419db0]
xor ecx, edx
dec edi
mov dword [esi - 4], ecx
jne 0x40a597
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x30]
mov edx, dword [ebx + 0x410]
inc eax
add ebp, 0x20
cmp eax, edx
mov dword [esp + 0x30], eax
jl 0x40a58f
pop edi
pop esi
mov byte [ebx + 4], 1
pop ebp
pop ebx
add esp, 0x10
ret 0x10