Function at 0x40e330
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
mov edx, dword [esp + 8]
sub esp, 0x1c
push ebx
mov ebx, dword [esp + 0x24]
cmp byte [ebx + 4], 0
jne 0x40e35f
push 0x4b7750
lea ecx, [esp + 0x18]
call fcn.0043f71d
push 0x4b0f08
lea eax, [esp + 0x18]
push eax
call fcn.00442c9b
movzx ecx, byte [eax]
inc eax
push ebp
push esi
movzx esi, byte [eax]
inc eax
shl esi, 0x10
inc eax
shl ecx, 0x18
or ecx, esi
movzx esi, byte [eax - 1]
shl esi, 8
or ecx, esi
movzx esi, byte [eax]
inc eax
inc eax
push edi
movzx edi, byte [eax]
or ecx, esi
movzx esi, byte [eax - 1]
shl edi, 0x10
inc eax
shl esi, 0x18
or esi, edi
movzx edi, byte [eax]
inc eax
shl edi, 8
or esi, edi
movzx edi, byte [eax]
xor ecx, dword [ebx + 8]
inc eax
movzx ebp, byte [eax + 1]
or esi, edi
movzx edi, byte [eax]
xor esi, dword [ebx + 0xc]
inc eax
shl ebp, 0x10
inc eax
shl edi, 0x18
or edi, ebp
movzx ebp, byte [eax]
shl ebp, 8
or edi, ebp
movzx ebp, byte [eax + 1]
inc eax
or edi, ebp
xor edi, dword [ebx + 0x10]
movzx ebx, byte [eax + 1]
inc eax
movzx ebp, byte [eax + 1]
inc eax
shl ebp, 0x10
shl ebx, 0x18
or ebx, ebp
movzx ebp, byte [eax + 1]
inc eax
movzx eax, byte [eax + 1]
shl ebp, 8
or ebp, eax
or ebp, ebx
mov ebx, dword [esp + 0x30]
mov eax, dword [ebx + 0x3d0]
xor ebp, dword [ebx + 0x14]
cmp eax, 1
mov dword [esp + 0x1c], eax
jle 0x40e565
add ebx, 0x30
dec eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], eax
mov eax, edi
sar eax, 0x10
and eax, 0xff
mov edx, ebp
sar edx, 8
and edx, 0xff
mov dword [esp + 0x18], eax
mov eax, dword [edx*4 + 0x4a4b18]
mov edx, dword [esp + 0x18]
xor eax, dword [edx*4 + 0x4a4718]
mov edx, esi
sar edx, 0x18
and edx, 0xff
xor eax, dword [edx*4 + 0x4a4318]
mov edx, ecx
and edx, 0xff
xor eax, dword [edx*4 + 0x4a4f18]
mov edx, ebp
xor eax, dword [ebx - 4]
sar edx, 0x10
and edx, 0xff
mov edx, dword [edx*4 + 0x4a4718]
mov ebx, edi
sar ebx, 0x18
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4318]
mov ebx, ecx
sar ebx, 8
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4b18]
mov ebx, esi
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4f18]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx]
mov ebx, esi
mov dword [esp + 0x18], edx
sar ebx, 8
mov edx, ebp
sar edx, 0x18
and ebx, 0xff
and edx, 0xff
mov edx, dword [edx*4 + 0x4a4318]
xor edx, dword [ebx*4 + 0x4a4b18]
mov ebx, ecx
sar ebx, 0x10
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4718]
mov ebx, edi
sar edi, 8
and edi, 0xff
mov edi, dword [edi*4 + 0x4a4b18]
sar esi, 0x10
and esi, 0xff
xor edi, dword [esi*4 + 0x4a4718]
sar ecx, 0x18
and ecx, 0xff
xor edi, dword [ecx*4 + 0x4a4318]
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4f18]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx + 4]
and ebp, 0xff
xor edi, dword [ebp*4 + 0x4a4f18]
add ebx, 0x20
xor edi, dword [ebx - 0x28]
sub dword [esp + 0x14], 1
mov ecx, edi
mov edi, dword [esp + 0x18]
mov esi, eax
mov ebp, edx
mov dword [esp + 0x10], ebx
jne 0x40e413
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x1c]
shl eax, 5
lea eax, [eax + ebx + 8]
mov dword [esp + 0x34], eax
mov eax, dword [eax]
mov dword [esp + 0x30], eax
sar eax, 0x18
mov ebx, ecx
sar ebx, 0x18
and ebx, 0xff
xor al, byte [ebx + str.cw]
mov ebx, dword [esp + 0x30]
mov byte [edx], al
sar ebx, 0x10
mov eax, esi
sar eax, 0x10
and eax, 0xff
xor bl, byte [eax + str.cw]
mov eax, edi
sar eax, 8
mov byte [edx + 1], bl
mov ebx, dword [esp + 0x30]
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + str.cw]
mov eax, ebp
and eax, 0xff
mov byte [edx + 2], bl
movzx eax, byte [eax + str.cw]
xor al, byte [esp + 0x30]
mov ebx, esi
mov byte [edx + 3], al
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 4]
mov dword [esp + 0x30], eax
sar eax, 0x18
sar ebx, 0x18
and ebx, 0xff
xor al, byte [ebx + str.cw]
mov ebx, dword [esp + 0x30]
mov byte [edx + 4], al
sar ebx, 0x10
mov eax, edi
sar eax, 0x10
and eax, 0xff
xor bl, byte [eax + str.cw]
mov eax, ebp
mov byte [edx + 5], bl
mov ebx, dword [esp + 0x30]
sar eax, 8
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + str.cw]
mov eax, ecx
and eax, 0xff
mov byte [edx + 6], bl
movzx eax, byte [eax + str.cw]
xor al, byte [esp + 0x30]
mov ebx, edi
mov byte [edx + 7], al
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 8]
mov dword [esp + 0x30], eax
sar ebx, 0x18
sar eax, 0x18
and ebx, 0xff
xor al, byte [ebx + str.cw]
mov ebx, dword [esp + 0x30]
mov byte [edx + 8], al
mov eax, ebp
sar eax, 0x10
and eax, 0xff
sar ebx, 0x10
xor bl, byte [eax + str.cw]
mov eax, ecx
mov byte [edx + 9], bl
mov ebx, dword [esp + 0x30]
sar eax, 8
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + str.cw]
mov byte [edx + 0xa], bl
mov eax, esi
and eax, 0xff
movzx eax, byte [eax + str.cw]
xor al, byte [esp + 0x30]
sar ebp, 0x18
mov byte [edx + 0xb], al
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
and ebp, 0xff
mov ebx, eax
sar ebx, 0x18
xor bl, byte [ebp + str.cw]
sar ecx, 0x10
mov byte [edx + 0xc], bl
and ecx, 0xff
mov ebx, eax
sar ebx, 0x10
xor bl, byte [ecx + str.cw]
sar esi, 8
and esi, 0xff
mov ecx, eax
sar ecx, 8
mov byte [edx + 0xd], bl
xor cl, byte [esi + str.cw]
and edi, 0xff
mov byte [edx + 0xe], cl
mov cl, byte [edi + str.cw]
pop edi
pop esi
xor cl, al
pop ebp
mov byte [edx + 0xf], cl
pop ebx
add esp, 0x1c
ret 8