Function at 0x4010c0
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, 0x14
test eax, eax
push ebp
mov ebp, ecx
jne 0x4010f3
lea eax, [esp + 0x1c]
lea ecx, [esp + 0xc]
push eax
mov dword [esp + 0x20], str.Empty_key
call fcn.00408322
lea ecx, [esp + 0xc]
push 0x432670
push ecx
call fcn.00408411
mov ecx, dword [esp + 0x24]
cmp ecx, 0x10
je 0x40112b
cmp ecx, 0x18
je 0x40112b
cmp ecx, 0x20
je 0x40112b
lea edx, [esp + 0x1c]
lea ecx, [esp + 0xc]
push edx
mov dword [esp + 0x20], str.Incorrect_key_length
call fcn.00408322
lea eax, [esp + 0xc]
push 0x432670
push eax
call fcn.00408411
mov eax, dword [esp + 0x28]
cmp eax, 0x10
je 0x401163
cmp eax, 0x18
je 0x401163
cmp eax, 0x20
je 0x401163
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], str.Incorrect_block_length
push ecx
lea ecx, [esp + 0x10]
call fcn.00408322
lea edx, [esp + 0xc]
push 0x432670
push edx
call fcn.00408411
mov dword [ebp + 0x14], eax
mov eax, dword [ebp + 0x1c]
test eax, eax
mov dword [ebp + 0x10], ecx
je 0x401179
push eax
call fcn.00422c9e
add esp, 4
mov eax, dword [ebp + 0x14]
push eax
call fcn.00422c75
mov dword [ebp + 0x1c], eax
mov eax, dword [ebp + 0x20]
add esp, 4
test eax, eax
je 0x401198
push eax
call fcn.00422c9e
add esp, 4
mov ecx, dword [ebp + 0x14]
push ebx
push esi
push edi
push ecx
call fcn.00422c75
mov ecx, dword [ebp + 0x14]
mov edi, dword [ebp + 0x1c]
mov dword [ebp + 0x20], eax
mov eax, dword [esp + 0x30]
mov edx, ecx
mov esi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
add esp, 4
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x14]
mov edi, dword [ebp + 0x20]
mov esi, eax
mov eax, ecx
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 [ebp + 8]
test eax, eax
je 0x40120d
mov eax, dword [ebp + 0x18]
xor esi, esi
test eax, eax
jl 0x401201
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + esi*4]
push edx
call fcn.00422c9e
mov eax, dword [ebp + 0x18]
add esp, 4
inc esi
cmp esi, eax
jle 0x4011ea
mov eax, dword [ebp + 8]
push eax
call fcn.00422c9e
add esp, 4
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x401240
mov eax, dword [ebp + 0x18]
xor esi, esi
test eax, eax
jl 0x401234
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + esi*4]
push edx
call fcn.00422c9e
mov eax, dword [ebp + 0x18]
add esp, 4
inc esi
cmp esi, eax
jle 0x40121d
mov eax, dword [ebp + 0xc]
push eax
call fcn.00422c9e
add esp, 4
mov eax, dword [ebp + 0x10]
cmp eax, 0x10
je 0x40126b
cmp eax, 0x18
je 0x401256
mov dword [ebp + 0x18], 0xe
jmp 0x40128a
mov ecx, dword [ebp + 0x14]
sub ecx, 0x20
neg ecx
sbb ecx, ecx
and ecx, 0xfffffffe
add ecx, 0xe
mov dword [ebp + 0x18], ecx
jmp 0x40128a
mov eax, dword [ebp + 0x14]
cmp eax, 0x10
jne 0x40127a
mov eax, 0xa
jmp 0x401287
sub eax, 0x18
neg eax
sbb eax, eax
and eax, 2
add eax, 0xc
mov dword [ebp + 0x18], eax
mov eax, dword [ebp + 0x14]
cdq
and edx, 3
add eax, edx
mov edx, dword [ebp + 0x18]
mov esi, eax
lea eax, [edx*4 + 4]
push eax
sar esi, 2
call fcn.00422c75
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0x18]
add esp, 4
xor edi, edi
test eax, eax
jl 0x4012ee
lea ebx, [esi*4]
push ebx
call fcn.00422c75
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + edi*4], eax
xor eax, eax
test esi, esi
jle 0x4012e6
mov edx, dword [ebp + 8]
inc eax
cmp eax, esi
mov ecx, dword [edx + edi*4]
mov dword [ecx + eax*4 - 4], 0
jl 0x4012d3
mov eax, dword [ebp + 0x18]
inc edi
cmp edi, eax
jle 0x4012be
mov edx, dword [ebp + 0x18]
lea eax, [edx*4 + 4]
push eax
call fcn.00422c75
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x18]
add esp, 4
xor edi, edi
test eax, eax
jl 0x401344
lea ebx, [esi*4]
push ebx
call fcn.00422c75
mov ecx, dword [ebp + 0xc]
add esp, 4
mov dword [ecx + edi*4], eax
xor eax, eax
test esi, esi
jle 0x40133c
mov edx, dword [ebp + 0xc]
inc eax
cmp eax, esi
mov ecx, dword [edx + edi*4]
mov dword [ecx + eax*4 - 4], 0
jl 0x401329
mov eax, dword [ebp + 0x18]
inc edi
cmp edi, eax
jle 0x401314
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp + 0x18]
cdq
inc ebx
and edx, 3
imul ebx, esi
add eax, edx
mov dword [esp + 0x34], ebx
mov edi, eax
sar edi, 2
mov dword [esp + 0x14], edi
lea eax, [edi*4]
push eax
call fcn.00422c75
mov ecx, dword [esp + 0x2c]
add esp, 4
test edi, edi
mov dword [esp + 0x30], eax
mov edx, eax
jle 0x4013bb
mov dword [esp + 0x28], edi
xor ebx, ebx
add edx, 4
mov bl, byte [ecx]
shl ebx, 0x18
mov dword [edx - 4], ebx
inc ecx
xor ebx, ebx
mov bl, byte [ecx]
shl ebx, 0x10
or dword [edx - 4], ebx
inc ecx
xor ebx, ebx
mov bh, byte [ecx]
or dword [edx - 4], ebx
inc ecx
xor ebx, ebx
mov bl, byte [ecx]
or dword [edx - 4], ebx
mov ebx, dword [esp + 0x28]
inc ecx
dec ebx
mov dword [esp + 0x28], ebx
jne 0x401383
mov ebx, dword [esp + 0x34]
xor ecx, ecx
test edi, edi
jle 0x40141f
mov dword [esp + 0x28], eax
cmp ecx, ebx
jge 0x4015d0
mov eax, ecx
cdq
idiv esi
mov ebx, eax
mov eax, ecx
cdq
idiv esi
mov eax, dword [ebp + 8]
mov dword [esp + 0x2c], ebx
mov eax, dword [eax + ebx*4]
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx]
shl edx, 2
mov dword [eax + edx], ebx
mov eax, dword [ebp + 0x18]
mov ebx, dword [esp + 0x2c]
sub eax, ebx
mov ebx, dword [ebp + 0xc]
inc ecx
mov eax, dword [ebx + eax*4]
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx]
mov dword [eax + edx], ebx
mov edx, dword [esp + 0x28]
mov ebx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
add edx, 4
cmp ecx, edi
mov dword [esp + 0x28], edx
jl 0x4013c5
cmp ecx, ebx
jge 0x4015d0
mov dword [esp + 0x2c], 0x42ed90
mov eax, dword [eax + edi*4 - 4]
mov ebx, dword [esp + 0x2c]
xor edx, edx
mov dword [esp + 0x28], eax
mov dl, byte [esp + 0x2a]
movsx ebx, byte [ebx]
movsx edx, byte [edx + str.cw]
xor edx, ebx
xor ebx, ebx
mov bl, ah
xor eax, eax
shl edx, 8
mov al, byte [ebx + str.cw]
xor ebx, ebx
xor edx, eax
mov eax, dword [esp + 0x28]
and eax, 0xff
shl edx, 8
mov bl, byte [eax + str.cw]
xor eax, eax
mov al, byte [esp + 0x2b]
xor edx, ebx
xor ebx, ebx
mov bl, byte [eax + str.cw]
mov eax, dword [esp + 0x30]
shl edx, 8
xor edx, ebx
mov ebx, dword [eax]
xor ebx, edx
mov dword [eax], ebx
mov ebx, dword [esp + 0x2c]
inc ebx
cmp edi, 8
mov dword [esp + 0x2c], ebx
je 0x4014ca
cmp edi, 1
jle 0x401562
lea ebx, [edi - 1]
lea edx, [eax + 4]
mov dword [esp + 0x28], ebx
mov ebx, dword [edx - 4]
xor dword [edx], ebx
mov ebx, dword [esp + 0x28]
add edx, 4
dec ebx
mov dword [esp + 0x28], ebx
jne 0x4014b2
jmp 0x401562
lea edx, [eax + 4]
mov dword [esp + 0x28], 3
mov ebx, dword [edx - 4]
xor dword [edx], ebx
mov ebx, dword [esp + 0x28]
add edx, 4
dec ebx
mov dword [esp + 0x28], ebx
jne 0x4014d5
mov edx, dword [eax + 0xc]
xor eax, eax
mov dword [esp + 0x28], edx
mov al, byte [esp + 0x2b]
xor ebx, ebx
movsx edx, byte [eax + str.cw]
xor eax, eax
mov al, byte [esp + 0x2a]
shl edx, 8
mov bl, byte [eax + str.cw]
xor eax, eax
mov al, byte [esp + 0x29]
xor edx, ebx
xor ebx, ebx
mov bl, byte [eax + str.cw]
mov eax, dword [esp + 0x28]
shl edx, 8
xor edx, ebx
and eax, 0xff
xor ebx, ebx
mov dword [esp + 0x28], 3
mov bl, byte [eax + str.cw]
mov eax, dword [esp + 0x30]
shl edx, 8
xor edx, ebx
mov ebx, dword [eax + 0x10]
xor ebx, edx
lea edx, [eax + 0x14]
mov dword [eax + 0x10], ebx
mov ebx, dword [edx - 4]
xor dword [edx], ebx
mov ebx, dword [esp + 0x28]
add edx, 4
dec ebx
mov dword [esp + 0x28], ebx
jne 0x40154f
test edi, edi
mov dword [esp + 0x28], 0
jle 0x4015c6
mov ebx, eax
mov dword [esp + 0x10], ebx
cmp ecx, dword [esp + 0x34]
jge 0x4015d0
mov eax, ecx
mov ebx, dword [ebx]
cdq
idiv esi
mov edi, eax
mov eax, ecx
cdq
idiv esi
mov eax, dword [ebp + 8]
mov eax, dword [eax + edi*4]
shl edx, 2
mov dword [eax + edx], ebx
mov eax, dword [ebp + 0x18]
mov ebx, dword [esp + 0x10]
sub eax, edi
mov edi, dword [ebp + 0xc]
add ebx, 4
mov dword [esp + 0x10], ebx
mov eax, dword [edi + eax*4]
mov edi, dword [ebx - 4]
mov dword [eax + edx], edi
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x14]
inc eax
inc ecx
mov dword [esp + 0x28], eax
cmp eax, edi
mov eax, dword [esp + 0x30]
jl 0x401574
cmp ecx, dword [esp + 0x34]
jl 0x40142f
push eax
call fcn.00422c9e
mov ecx, dword [ebp + 0x18]
mov eax, 1
add esp, 4
cmp ecx, eax
mov dword [esp + 0x30], eax
jle 0x40164d
xor edi, edi
test esi, esi
jle 0x40163d
mov ecx, dword [ebp + 0xc]
mov edx, dword [esp + 0x30]
xor ebx, ebx
mov eax, dword [ecx + edx*4]
xor edx, edx
lea ecx, [eax + edi*4]
mov eax, dword [eax + edi*4]
mov dword [esp + 0x28], eax
mov dl, byte [esp + 0x2b]
mov bl, byte [esp + 0x2a]
mov edx, dword [edx*4 + 0x42dd90]
xor edx, dword [ebx*4 + 0x42e190]
xor ebx, ebx
mov bl, ah
and eax, 0xff
xor edx, dword [ebx*4 + 0x42e590]
mov ebx, dword [eax*4 + 0x42e990]
xor edx, ebx
inc edi
cmp edi, esi
mov dword [ecx], edx
jl 0x4015ef
mov eax, dword [esp + 0x30]
mov ecx, dword [ebp + 0x18]
inc eax
cmp eax, ecx
mov dword [esp + 0x30], eax
jl 0x4015e9
pop edi
pop esi
mov byte [ebp + 4], 1
pop ebx
pop ebp
add esp, 0x14
ret 0x10