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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push edi
mov edi, ecx
mov dword [ebp - 0x1c], edi
cmp byte [edi + 4], 0
jne 0x40216f
push 0x41b098
lea ecx, [ebp - 0x28]
call fcn.00409506
lea eax, [ebp - 0x28]
push 0x4198d0
push eax
call fcn.004095b0
mov eax, dword [ebp + 8]
push ebx
push esi
xor ebx, ebx
movzx edx, byte [eax]
movzx ecx, byte [eax + 1]
shl edx, 0x18
inc eax
shl ecx, 0x10
or edx, ecx
inc eax
xor ecx, ecx
mov ch, byte [eax]
or edx, ecx
inc eax
movzx ecx, byte [eax]
movzx esi, byte [eax + 1]
or edx, ecx
inc eax
xor edx, dword [edi + 8]
movzx ecx, byte [eax + 1]
shl esi, 0x18
inc eax
mov dword [ebp - 0x10], edx
shl ecx, 0x10
or esi, ecx
inc eax
xor ecx, ecx
mov ch, byte [eax]
or esi, ecx
inc eax
movzx ecx, byte [eax]
or esi, ecx
inc eax
xor esi, dword [edi + 0xc]
movzx ecx, byte [eax]
shl ecx, 0x18
inc eax
mov dword [ebp - 0xc], esi
movzx esi, byte [eax]
mov bh, byte [eax + 1]
shl esi, 0x10
or ecx, esi
inc eax
or ecx, ebx
inc eax
movzx esi, byte [eax]
or ecx, esi
inc eax
xor ecx, dword [edi + 0x10]
movzx esi, byte [eax]
movzx ebx, byte [eax + 1]
shl esi, 0x18
inc eax
mov dword [ebp - 0x14], ecx
shl ebx, 0x10
or esi, ebx
inc eax
xor ebx, ebx
mov bh, byte [eax]
mov bl, byte [eax + 1]
mov eax, dword [edi + 0x3d0]
or ebx, esi
mov dword [ebp - 0x18], eax
xor ebx, dword [edi + 0x14]
cmp eax, 1
mov esi, 0xff
mov dword [ebp - 8], ebx
jle 0x402319
add edi, 0x30
dec eax
mov dword [ebp + 8], edi
mov dword [ebp - 4], eax
xor eax, eax
xor ebx, ebx
mov al, byte [ebp - 7]
mov bl, byte [ebp - 0x12]
mov edi, dword [eax*4 + 0x413370]
xor eax, eax
xor edi, dword [ebx*4 + 0x412f70]
mov al, byte [ebp - 9]
xor ebx, ebx
xor edi, dword [eax*4 + 0x412b70]
mov eax, edx
and eax, esi
mov bl, byte [ebp - 0x11]
xor edi, dword [eax*4 + 0x413770]
mov eax, dword [ebp + 8]
xor edi, dword [eax - 4]
xor eax, eax
mov al, byte [ebp - 6]
mov eax, dword [eax*4 + 0x412f70]
xor eax, dword [ebx*4 + 0x412b70]
xor ebx, ebx
mov bl, dh
mov edx, dword [ebp - 0xc]
and edx, esi
xor eax, dword [ebx*4 + 0x413370]
mov ebx, dword [ebp + 8]
add ebx, 0x20
xor eax, dword [edx*4 + 0x413770]
mov edx, dword [ebp + 8]
mov dword [ebp + 8], ebx
xor eax, dword [edx]
xor edx, edx
mov dl, byte [ebp - 0xb]
mov dword [ebp - 0x14], eax
xor eax, eax
mov al, byte [ebp - 5]
mov eax, dword [eax*4 + 0x412b70]
xor eax, dword [edx*4 + 0x413370]
xor edx, edx
mov dl, byte [ebp - 0xe]
xor eax, dword [edx*4 + 0x412f70]
mov edx, ecx
and edx, esi
xor eax, dword [edx*4 + 0x413770]
xor edx, edx
mov dl, ch
xor ecx, ecx
mov cl, byte [ebp - 0xa]
xor eax, dword [ebx - 0x1c]
mov edx, dword [edx*4 + 0x413370]
mov dword [ebp - 0xc], edi
xor edx, dword [ecx*4 + 0x412f70]
xor ecx, ecx
mov cl, byte [ebp - 0xd]
xor edx, dword [ecx*4 + 0x412b70]
mov ecx, dword [ebp - 8]
and ecx, esi
mov dword [ebp - 8], eax
xor edx, dword [ecx*4 + 0x413770]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x14], ecx
xor edx, dword [ebx - 0x28]
dec dword [ebp - 4]
mov dword [ebp - 0x10], edx
jne 0x402222
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
shl eax, 5
mov edx, dword [eax + edi + 8]
lea edi, [eax + edi + 8]
xor eax, eax
mov ebx, edx
mov al, byte [ebp - 0xd]
mov dword [ebp - 4], edx
sar ebx, 0x18
mov al, byte [eax + str.cw]
xor al, bl
mov bl, al
mov eax, dword [ebp + 0xc]
mov byte [eax], bl
xor ebx, ebx
mov bl, byte [ebp - 0xa]
sar edx, 0x10
mov bl, byte [ebx + str.cw]
xor bl, dl
xor edx, edx
mov byte [eax + 1], bl
mov ebx, dword [ebp - 4]
mov dl, ch
sar ebx, 8
mov dl, byte [edx + str.cw]
xor dl, bl
xor ebx, ebx
mov byte [eax + 2], dl
mov edx, dword [ebp - 8]
and edx, esi
mov bl, byte [ebp - 9]
mov dl, byte [edx + str.cw]
xor dl, byte [ebp - 4]
mov byte [eax + 3], dl
mov edx, dword [edi + 4]
mov bl, byte [ebx + str.cw]
mov dword [ebp - 4], edx
sar edx, 0x18
xor bl, dl
xor edx, edx
mov dl, byte [ebp - 0x12]
mov byte [eax + 4], bl
mov ebx, dword [ebp - 4]
mov dl, byte [edx + str.cw]
sar ebx, 0x10
xor dl, bl
mov ebx, dword [ebp - 4]
mov byte [eax + 5], dl
xor edx, edx
mov dl, byte [ebp - 7]
sar ebx, 8
mov dl, byte [edx + str.cw]
xor dl, bl
xor ebx, ebx
mov byte [eax + 6], dl
mov edx, dword [ebp - 0x10]
and edx, esi
mov bl, byte [ebp - 0x11]
mov dl, byte [edx + str.cw]
xor dl, byte [ebp - 4]
mov byte [eax + 7], dl
mov edx, dword [edi + 8]
mov bl, byte [ebx + str.cw]
mov dword [ebp - 4], edx
sar edx, 0x18
xor bl, dl
xor edx, edx
mov dl, byte [ebp - 6]
mov byte [eax + 8], bl
mov ebx, dword [ebp - 4]
mov dl, byte [edx + str.cw]
sar ebx, 0x10
xor dl, bl
mov ebx, dword [ebp - 4]
mov byte [eax + 9], dl
xor edx, edx
mov dl, byte [ebp - 0xf]
sar ebx, 8
mov dl, byte [edx + str.cw]
xor dl, bl
mov byte [eax + 0xa], dl
mov edx, dword [ebp - 0xc]
and ecx, esi
and edx, esi
pop esi
mov dl, byte [edx + str.cw]
xor dl, byte [ebp - 4]
mov byte [eax + 0xb], dl
mov edi, dword [edi + 0xc]
xor edx, edx
mov ebx, edi
mov dl, byte [ebp - 5]
mov dword [ebp - 4], edi
sar ebx, 0x18
mov dl, byte [edx + str.cw]
xor dl, bl
mov ebx, edi
mov byte [eax + 0xc], dl
xor edx, edx
mov dl, byte [ebp - 0xe]
sar ebx, 0x10
mov dl, byte [edx + str.cw]
xor dl, bl
mov ebx, edi
mov byte [eax + 0xd], dl
xor edx, edx
mov dl, byte [ebp - 0xb]
sar ebx, 8
mov dl, byte [edx + str.cw]
xor dl, bl
pop ebx
mov byte [eax + 0xe], dl
mov cl, byte [ecx + str.cw]
xor cl, byte [ebp - 4]
pop edi
mov byte [eax + 0xf], cl
leave
ret 8