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

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
mov ebx, ecx
test ebp, ebp
je 0x10046443
mov ecx, dword [esp + 0x24]
cmp ecx, 0x10
je 0x1004604a
cmp ecx, 0x18
je 0x1004604a
cmp ecx, 0x20
jne 0x10046468
mov eax, dword [esp + 0x28]
cmp eax, 0x10
je 0x10046061
cmp eax, 0x18
je 0x10046061
cmp eax, 0x20
jne 0x1004648d
push esi
mov esi, dword [esp + 0x24]
push edi
push eax
mov dword [ebx + 0x3cc], eax
lea eax, [ebx + 0x3d4]
push esi
push eax
mov dword [ebx + 0x3c8], ecx
call fcn.10026f60
push dword [ebx + 0x3cc]
lea eax, [ebx + 0x3f4]
push esi
push eax
call fcn.10026f60
mov eax, dword [ebx + 0x3c8]
add esp, 0x18
cmp eax, 0x10
je 0x100460c1
cmp eax, 0x18
je 0x100460b3
mov dword [ebx + 0x3d0], 0xe
jmp 0x100460e6
xor eax, eax
cmp dword [ebx + 0x3cc], 0x20
sete al
jmp 0x100460d9
mov ecx, dword [ebx + 0x3cc]
cmp ecx, 0x10
jne 0x100460d1
lea eax, [ecx - 6]
jmp 0x100460e0
xor eax, eax
cmp ecx, 0x18
setne al
lea eax, [eax*2 + 0xc]
mov dword [ebx + 0x3d0], eax
mov eax, dword [ebx + 0x3cc]
cdq
and edx, 3
lea esi, [edx + eax]
sar esi, 2
xor edx, edx
mov dword [esp + 0x30], esi
cmp dword [ebx + 0x3d0], edx
jl 0x10046123
lea ebp, [ebx + 8]
test esi, esi
jle 0x10046113
mov ecx, esi
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
inc edx
add ebp, 0x20
cmp edx, dword [ebx + 0x3d0]
jle 0x10046107
mov ebp, dword [esp + 0x24]
xor edx, edx
cmp dword [ebx + 0x3d0], edx
jl 0x1004614f
lea ebp, [ebx + 0x1e8]
test esi, esi
jle 0x1004613f
mov ecx, esi
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
inc edx
add ebp, 0x20
cmp edx, dword [ebx + 0x3d0]
jle 0x10046133
mov ebp, dword [esp + 0x24]
mov eax, dword [ebx + 0x3d0]
inc eax
imul eax, esi
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x3c8]
cdq
and edx, 3
add edx, eax
sar edx, 2
lea eax, [ebx + 0x414]
mov dword [esp + 0x24], edx
mov ecx, eax
test edx, edx
jle 0x100461b0
mov edi, edx
mov edi, edi
movzx eax, byte [ebp]
shl eax, 0x18
mov dword [ecx], eax
movzx eax, byte [ebp + 1]
shl eax, 0x10
or dword [ecx], eax
movzx eax, byte [ebp + 2]
shl eax, 8
or dword [ecx], eax
movzx eax, byte [ebp + 3]
or dword [ecx], eax
lea ebp, [ebp + 4]
lea ecx, [ecx + 4]
dec edi
jne 0x10046180
lea eax, [ebx + 0x414]
mov ebp, dword [esp + 0x2c]
xor edi, edi
test edx, edx
jle 0x10046204
mov ecx, eax
mov dword [esp + 0x28], ecx
cmp edi, ebp
jge 0x100463a3
mov eax, edi
cdq
idiv esi
mov ecx, dword [ecx]
inc edi
lea esi, [edx + eax*8]
mov dword [ebx + esi*4 + 8], ecx
mov ecx, dword [ebx + 0x3d0]
mov esi, dword [esp + 0x30]
sub ecx, eax
mov eax, dword [esp + 0x28]
lea ecx, [edx + ecx*8]
mov eax, dword [eax]
mov dword [ebx + ecx*4 + 0x1e8], eax
mov ecx, dword [esp + 0x28]
add ecx, 4
mov dword [esp + 0x28], ecx
cmp edi, dword [esp + 0x24]
jl 0x100461c0
cmp edi, ebp
jge 0x100463a3
mov ebp, dword [esp + 0x24]
mov dword [esp + 0x28], 0x1005b230
jmp 0x10046220
mov edx, dword [ebx + ebp*4 + 0x410]
mov eax, edx
sar eax, 0x10
and eax, 0xff
movsx ecx, byte [eax + str.cw]
mov eax, dword [esp + 0x28]
inc dword [esp + 0x28]
movsx eax, byte [eax]
xor ecx, eax
mov eax, edx
sar eax, 8
and eax, 0xff
shl ecx, 8
movzx eax, byte [eax + str.cw]
xor ecx, eax
movzx eax, dl
shl ecx, 8
movzx eax, byte [eax + str.cw]
sar edx, 0x18
xor ecx, eax
and edx, 0xff
shl ecx, 8
movzx eax, byte [edx + str.cw]
xor ecx, eax
xor dword [ebx + 0x414], ecx
lea eax, [ebx + 0x414]
cmp ebp, 8
je 0x100462b2
cmp ebp, 1
jle 0x10046341
lea ecx, [ebx + 0x418]
lea edx, [ebp - 1]
mov eax, dword [ecx - 4]
xor dword [ecx], eax
lea ecx, [ecx + 4]
dec edx
jne 0x100462a2
jmp 0x1004633b
lea eax, [ebx + 0x418]
mov edx, 3
lea ecx, [ecx]
mov ecx, dword [eax - 4]
xor dword [eax], ecx
lea eax, [eax + 4]
dec edx
jne 0x100462c0
mov edx, dword [ebx + 0x420]
mov eax, edx
sar eax, 0x18
and eax, 0xff
movsx ecx, byte [eax + str.cw]
mov eax, edx
sar eax, 0x10
and eax, 0xff
shl ecx, 8
movzx eax, byte [eax + str.cw]
xor ecx, eax
mov eax, edx
sar eax, 8
and eax, 0xff
shl ecx, 8
movzx eax, byte [eax + str.cw]
xor ecx, eax
movzx eax, dl
shl ecx, 8
movzx eax, byte [eax + str.cw]
xor ecx, eax
xor dword [ebx + 0x424], ecx
lea ecx, [ebx + 0x428]
mov edx, 3
mov edi, edi
mov eax, dword [ecx - 4]
xor dword [ecx], eax
lea ecx, [ecx + 4]
dec edx
jne 0x10046330
lea eax, [ebx + 0x414]
mov dword [esp + 0x10], 0
test ebp, ebp
jle 0x10046395
mov ebp, eax
nop
cmp edi, dword [esp + 0x2c]
jge 0x100463a3
mov eax, edi
cdq
idiv esi
mov ecx, dword [ebp]
add ebp, 4
inc edi
lea esi, [edx + eax*8]
mov dword [ebx + esi*4 + 8], ecx
mov ecx, dword [ebx + 0x3d0]
mov esi, dword [esp + 0x30]
sub ecx, eax
mov eax, dword [ebp - 4]
lea ecx, [edx + ecx*8]
mov dword [ebx + ecx*4 + 0x1e8], eax
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
cmp eax, dword [esp + 0x24]
jl 0x10046350
mov ebp, dword [esp + 0x24]
mov esi, dword [esp + 0x30]
cmp edi, dword [esp + 0x2c]
jl 0x10046220
mov eax, 1
mov dword [esp + 0x24], eax
cmp dword [ebx + 0x3d0], eax
jle 0x10046435
mov ebp, dword [esp + 0x30]
lea ecx, [ebx + 0x208]
mov dword [esp + 0x2c], ecx
test ebp, ebp
jle 0x10046421
mov esi, ecx
mov edi, ebp
mov edi, edi
mov edx, dword [esi]
mov ecx, edx
sar ecx, 0x18
and ecx, 0xff
mov eax, edx
mov ecx, dword [ecx*4 + 0x1005a230]
sar eax, 0x10
and eax, 0xff
lea esi, [esi + 4]
xor ecx, dword [eax*4 + 0x1005a630]
mov eax, edx
sar eax, 8
and eax, 0xff
xor ecx, dword [eax*4 + 0x1005aa30]
movzx eax, dl
xor ecx, dword [eax*4 + 0x1005ae30]
mov dword [esi - 4], ecx
dec edi
jne 0x100463d0
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x2c]
inc eax
add ecx, 0x20
mov dword [esp + 0x24], eax
mov dword [esp + 0x2c], ecx
cmp eax, dword [ebx + 0x3d0]
jl 0x100463c6
pop edi
pop esi
pop ebp
mov byte [ebx + 4], 1
pop ebx
add esp, 0x10
ret 0x10
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x10]
mov dword [esp + 0x20], str.Empty_key
call fcn.100266f4
push 0x10065018
lea eax, [esp + 0x10]
push eax
call fcn.10026abe
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x10]
mov dword [esp + 0x20], str.Incorrect_key_length
call fcn.100266f4
push 0x10065018
lea eax, [esp + 0x10]
push eax
call fcn.10026abe
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x10]
mov dword [esp + 0x20], str.Incorrect_block_length
call fcn.100266f4
push 0x10065018
lea eax, [esp + 0x10]
push eax
call fcn.10026abe
int3