Function at 0x401640
Capabilities:
Encode data using add xor sub operations
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
sub esp, 0x1c
movzx eax, byte [ecx + 1]
mov dword [esp + 0x18], edx
movzx edx, byte [ecx]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + 2]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + 3]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + 5]
push ebx
movzx ebx, byte [ecx + 8]
push ebp
push esi
mov esi, dword [esp + 0x2c]
shl ebx, 8
push edi
xor edx, dword [esi]
mov dword [esp + 0x1c], edx
movzx edx, byte [ecx + 4]
shl edx, 8
xor edx, eax
mov edi, dword [esp + 0x1c]
movzx eax, byte [ecx + 6]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + 7]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + 9]
xor edx, dword [esi + 4]
xor ebx, eax
movzx eax, byte [ecx + 0xa]
mov dword [esp + 0x30], edx
movzx edx, byte [ecx + 0xc]
shl ebx, 8
xor ebx, eax
shl edx, 8
movzx eax, byte [ecx + 0xb]
shl ebx, 8
xor ebx, eax
movzx eax, byte [ecx + 0xd]
xor edx, eax
xor ebx, dword [esi + 8]
movzx eax, byte [ecx + 0xe]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + 0xf]
shl edx, 8
xor edx, eax
xor edx, dword [esi + 0xc]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, ebx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x4a0710]
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, edi
shr eax, 0x18
xor ecx, dword [eax*4 + 0x4a0b10]
mov eax, dword [esp + 0x30]
movzx eax, al
xor ecx, dword [eax*4 + 0x49ff10]
mov eax, edx
xor ecx, dword [esi + 0x10]
shr eax, 8
mov dword [esp + 0x10], ecx
movzx ecx, al
mov eax, edi
shr eax, 0x10
movzx eax, al
mov ebp, dword [ecx*4 + 0x4a0310]
xor ebp, dword [eax*4 + 0x4a0710]
mov eax, dword [esp + 0x30]
shr eax, 0x18
xor ebp, dword [eax*4 + 0x4a0b10]
movzx eax, bl
xor ebp, dword [eax*4 + 0x49ff10]
mov eax, dword [esp + 0x30]
shr eax, 0x10
movzx ecx, al
mov eax, edi
shr eax, 8
movzx eax, al
xor ebp, dword [esi + 0x14]
mov ecx, dword [ecx*4 + 0x4a0710]
mov dword [esp + 0x14], ebp
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, ebx
shr eax, 0x18
shr ebx, 0x10
xor ecx, dword [eax*4 + 0x4a0b10]
movzx eax, dl
shr edx, 0x18
xor ecx, dword [eax*4 + 0x49ff10]
xor ecx, dword [esi + 0x18]
mov eax, dword [esp + 0x30]
mov dword [esp + 0x18], ecx
shr eax, 8
movzx eax, al
movzx ecx, bl
mov ecx, dword [ecx*4 + 0x4a0710]
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, edi
xor ecx, dword [edx*4 + 0x4a0b10]
lea edi, [esi + 0x20]
movzx eax, al
xor ecx, dword [eax*4 + 0x49ff10]
mov eax, dword [esi + 0xf0]
xor ecx, dword [esi + 0x1c]
sar eax, 1
sub eax, 1
mov dword [esp + 0x30], ecx
mov dword [esp + 0x24], eax
je 0x4019f5
nop dword [eax]
mov ebx, dword [esp + 0x18]
mov eax, ecx
shr eax, 0x10
movzx ecx, al
mov eax, ebx
shr eax, 8
movzx eax, al
mov esi, dword [esp + 0x10]
mov ecx, dword [ecx*4 + 0x4a0710]
mov edx, dword [esp + 0x14]
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, esi
shr eax, 0x18
xor ecx, dword [eax*4 + 0x4a0b10]
movzx eax, dl
xor ecx, dword [eax*4 + 0x49ff10]
xor ecx, dword [edi]
mov eax, dword [esp + 0x30]
shr eax, 8
mov dword [esp + 0x20], ecx
movzx ecx, al
mov eax, esi
shr eax, 0x10
movzx eax, al
mov ecx, dword [ecx*4 + 0x4a0310]
xor ecx, dword [eax*4 + 0x4a0710]
mov eax, edx
shr eax, 0x18
xor ecx, dword [eax*4 + 0x4a0b10]
movzx eax, bl
xor ecx, dword [eax*4 + 0x49ff10]
mov eax, edx
xor ecx, dword [edi + 4]
shr eax, 0x10
mov dword [esp + 0x1c], ecx
movzx ecx, al
mov eax, esi
shr eax, 8
movzx eax, al
shr edx, 8
mov ebx, dword [ecx*4 + 0x4a0710]
mov ecx, dword [esp + 0x18]
xor ebx, dword [eax*4 + 0x4a0310]
mov eax, ecx
shr eax, 0x18
shr ecx, 0x10
movzx ecx, cl
xor ebx, dword [eax*4 + 0x4a0b10]
mov eax, dword [esp + 0x30]
movzx eax, al
xor ebx, dword [eax*4 + 0x49ff10]
xor ebx, dword [edi + 8]
movzx eax, dl
mov edx, dword [ecx*4 + 0x4a0710]
xor edx, dword [eax*4 + 0x4a0310]
mov eax, dword [esp + 0x30]
shr eax, 0x18
xor edx, dword [eax*4 + 0x4a0b10]
mov eax, esi
movzx eax, al
mov esi, dword [esp + 0x20]
xor edx, dword [eax*4 + 0x49ff10]
xor edx, dword [edi + 0xc]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, ebx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x4a0710]
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, esi
shr eax, 0x18
xor ecx, dword [eax*4 + 0x4a0b10]
mov eax, dword [esp + 0x1c]
movzx eax, al
xor ecx, dword [eax*4 + 0x49ff10]
mov eax, edx
xor ecx, dword [edi + 0x10]
mov dword [esp + 0x10], ecx
shr eax, 8
movzx ecx, al
mov eax, esi
shr eax, 0x10
movzx eax, al
mov ecx, dword [ecx*4 + 0x4a0310]
xor ecx, dword [eax*4 + 0x4a0710]
mov eax, dword [esp + 0x1c]
mov ebp, ecx
shr eax, 0x18
mov dword [esp + 0x14], ecx
xor ebp, dword [eax*4 + 0x4a0b10]
movzx eax, bl
xor ebp, dword [eax*4 + 0x49ff10]
mov eax, dword [esp + 0x1c]
shr eax, 0x10
movzx ecx, al
mov eax, esi
shr eax, 8
movzx eax, al
xor ebp, dword [edi + 0x14]
mov ecx, dword [ecx*4 + 0x4a0710]
mov dword [esp + 0x14], ebp
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, ebx
shr eax, 0x18
shr ebx, 0x10
xor ecx, dword [eax*4 + 0x4a0b10]
movzx eax, dl
shr edx, 0x18
xor ecx, dword [eax*4 + 0x49ff10]
xor ecx, dword [edi + 0x18]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], ecx
shr eax, 8
movzx ecx, bl
movzx eax, al
mov ecx, dword [ecx*4 + 0x4a0710]
xor ecx, dword [eax*4 + 0x4a0310]
mov eax, esi
xor ecx, dword [edx*4 + 0x4a0b10]
movzx eax, al
xor ecx, dword [eax*4 + 0x49ff10]
xor ecx, dword [edi + 0x1c]
add edi, 0x20
sub dword [esp + 0x24], 1
mov dword [esp + 0x30], ecx
jne 0x4017f0
mov ebx, dword [esp + 0x18]
mov eax, ecx
shr eax, 0x10
movzx eax, al
mov edx, dword [esp + 0x14]
mov ecx, dword [eax*4 + 0x49fb08]
mov eax, ebx
shr eax, 8
and ecx, 0xff0000
movzx eax, al
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff00
xor ecx, eax
mov eax, dword [esp + 0x10]
shr eax, 0x18
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff000000
xor ecx, eax
movzx eax, dl
movzx eax, byte [eax*4 + 0x49fb08]
xor ecx, eax
mov eax, dword [esp + 0x10]
xor ecx, dword [edi]
shr eax, 0x10
movzx eax, al
mov dword [esp + 0x24], ecx
mov ecx, dword [eax*4 + 0x49fb08]
mov eax, dword [esp + 0x30]
and ecx, 0xff0000
shr eax, 8
movzx eax, al
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff00
xor ecx, eax
mov eax, edx
shr eax, 0x18
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff000000
xor ecx, eax
movzx eax, bl
movzx eax, byte [eax*4 + 0x49fb08]
xor ecx, eax
mov eax, edx
xor ecx, dword [edi + 4]
shr eax, 0x10
movzx eax, al
mov dword [esp + 0x20], ecx
shr edx, 8
mov ecx, dword [eax*4 + 0x49fb08]
mov eax, dword [esp + 0x10]
and ecx, 0xff0000
shr eax, 8
movzx eax, al
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff00
xor ecx, eax
mov eax, ebx
shr eax, 0x18
shr ebx, 0x10
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff000000
xor ecx, eax
mov eax, dword [esp + 0x30]
movzx eax, al
movzx eax, byte [eax*4 + 0x49fb08]
xor ecx, eax
movzx eax, bl
xor ecx, dword [edi + 8]
mov dword [esp + 0x1c], ecx
mov ebx, dword [eax*4 + 0x49fb08]
movzx eax, dl
and ebx, 0xff0000
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff00
xor ebx, eax
mov eax, dword [esp + 0x30]
shr eax, 0x18
mov eax, dword [eax*4 + 0x49fb08]
and eax, 0xff000000
xor ebx, eax
mov eax, dword [esp + 0x10]
movzx eax, al
movzx eax, byte [eax*4 + 0x49fb08]
xor ebx, eax
xor ebx, dword [edi + 0xc]
call fcn.00419e60
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov eax, ecx
shr eax, 0x18
pop edi
mov byte [edx], al
mov eax, ecx
shr eax, 0x10
mov byte [edx + 1], al
mov eax, ecx
shr eax, 8
mov byte [edx + 2], al
mov byte [edx + 3], cl
mov ecx, dword [esp + 0x1c]
mov eax, ecx
shr eax, 0x18
mov byte [edx + 4], al
mov eax, ecx
shr eax, 0x10
mov byte [edx + 5], al
mov eax, ecx
shr eax, 8
mov byte [edx + 6], al
mov byte [edx + 7], cl
mov ecx, dword [esp + 0x18]
mov eax, ecx
shr eax, 0x18
mov byte [edx + 8], al
mov eax, ecx
shr eax, 0x10
mov byte [edx + 9], al
mov eax, ecx
shr eax, 8
mov byte [edx + 0xa], al
mov eax, ebx
shr eax, 0x18
mov byte [edx + 0xc], al
mov eax, ebx
shr eax, 0x10
mov byte [edx + 0xd], al
mov eax, ebx
pop esi
shr eax, 8
pop ebp
mov byte [edx + 0xf], bl
mov byte [edx + 0xb], cl
mov byte [edx + 0xe], al
pop ebx
add esp, 0x1c
ret