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

Disassembly:
sub esp, 0x14
push ebp
mov ebp, ecx
mov dword [esp + 0x10], ebp
cmp byte [ebp + 4], 0
je 0x40ec5a
push ebx
push esi
mov esi, dword [esp + 0x24]
push edi
mov edi, dword [ebp + 0x3d0]
mov dword [esp + 0x20], edi
movzx ebx, byte [esi]
movzx edx, byte [esi + 1]
movzx ecx, byte [esi + 2]
movzx eax, byte [esi + 3]
shl ebx, 8
or ebx, edx
movzx edx, byte [esi + 5]
shl ebx, 8
or ebx, ecx
movzx ecx, byte [esi + 6]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi + 7]
xor ebx, dword [ebp + 0x1e8]
mov dword [esp + 0x28], ebx
movzx ebx, byte [esi + 4]
shl ebx, 8
or ebx, edx
movzx edx, byte [esi + 9]
shl ebx, 8
or ebx, ecx
movzx ecx, byte [esi + 0xa]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi + 0xb]
xor ebx, dword [ebp + 0x1ec]
mov dword [esp + 0x10], ebx
movzx ebx, byte [esi + 8]
shl ebx, 8
or ebx, edx
shl ebx, 8
or ebx, ecx
movzx ecx, byte [esi + 0xd]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi + 0xc]
xor ebx, dword [ebp + 0x1f0]
shl eax, 8
or eax, ecx
mov dword [esp + 0x14], ebx
movzx ecx, byte [esi + 0xe]
shl eax, 8
or eax, ecx
movzx ecx, byte [esi + 0xf]
shl eax, 8
or eax, ecx
xor eax, dword [ebp + 0x1f4]
cmp edi, 1
jle 0x40eada
lea ecx, [ebp + 0x210]
mov dword [esp + 0x14], ecx
lea ecx, [edi - 1]
mov dword [esp + 0x18], ecx
nop
mov ecx, eax
mov ebp, dword [esp + 0x14]
sar ecx, 8
movzx edx, cl
mov ecx, dword [esp + 0x10]
sar ecx, 0x18
movzx ecx, cl
mov edi, dword [edx*4 + 0x45f438]
xor edi, dword [ecx*4 + 0x45ec38]
mov ecx, dword [esp + 0x28]
sar ecx, 0x10
movzx ecx, cl
xor edi, dword [ecx*4 + 0x45f038]
movzx ecx, bl
xor edi, dword [ecx*4 + 0x45f838]
mov ecx, dword [esp + 0x14]
xor edi, dword [ecx - 4]
mov ecx, ebx
sar ecx, 0x18
movzx edx, cl
mov ecx, dword [esp + 0x10]
sar ecx, 0x10
movzx ecx, cl
mov esi, dword [edx*4 + 0x45ec38]
xor esi, dword [ecx*4 + 0x45f038]
mov ecx, dword [esp + 0x28]
sar ecx, 8
movzx ecx, cl
xor esi, dword [ecx*4 + 0x45f438]
movzx ecx, al
xor esi, dword [ecx*4 + 0x45f838]
mov ecx, eax
sar ecx, 0x18
movzx edx, cl
mov ecx, ebx
sar ecx, 0x10
movzx ecx, cl
sar eax, 0x10
mov edx, dword [edx*4 + 0x45ec38]
xor esi, dword [ebp]
xor edx, dword [ecx*4 + 0x45f038]
mov ecx, dword [esp + 0x10]
sar ecx, 8
movzx ecx, cl
sar ebx, 8
xor edx, dword [ecx*4 + 0x45f438]
mov ecx, dword [esp + 0x28]
movzx ecx, cl
xor edx, dword [ecx*4 + 0x45f838]
xor edx, dword [ebp + 4]
movzx ecx, al
movzx eax, bl
mov ebx, esi
mov ecx, dword [ecx*4 + 0x45f038]
xor ecx, dword [eax*4 + 0x45f438]
mov eax, dword [esp + 0x28]
sar eax, 0x18
movzx eax, al
xor ecx, dword [eax*4 + 0x45ec38]
mov eax, dword [esp + 0x10]
movzx eax, al
mov dword [esp + 0x10], edi
xor ecx, dword [eax*4 + 0x45f838]
mov eax, edx
xor ecx, dword [ebp - 8]
add ebp, 0x20
sub dword [esp + 0x18], 1
mov dword [esp + 0x28], ecx
mov dword [esp + 0x14], ebp
jne 0x40e9b0
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
mov dword [esp + 0x14], ebx
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
sar ecx, 0x18
movzx ecx, cl
shl edi, 5
mov ebx, dword [edi + ebp + 0x1e8]
mov edx, ebx
sar edx, 0x18
xor dl, byte [ecx + 0x45db38]
mov ecx, eax
sar ecx, 0x10
movzx ecx, cl
mov byte [esi], dl
mov edx, ebx
sar edx, 0x10
xor dl, byte [ecx + 0x45db38]
mov ecx, dword [esp + 0x14]
sar ecx, 8
movzx ecx, cl
mov byte [esi + 1], dl
mov edx, ebx
sar edx, 8
xor dl, byte [ecx + 0x45db38]
mov byte [esi + 2], dl
mov edx, dword [esp + 0x10]
movzx ecx, dl
movzx ecx, byte [ecx + 0x45db38]
xor cl, bl
mov byte [esi + 3], cl
mov ecx, edx
mov ebx, dword [edi + ebp + 0x1ec]
mov edx, ebx
sar ecx, 0x18
movzx ecx, cl
sar edx, 0x18
xor dl, byte [ecx + 0x45db38]
mov ecx, dword [esp + 0x28]
sar ecx, 0x10
movzx ecx, cl
mov byte [esi + 4], dl
mov edx, ebx
sar edx, 0x10
xor dl, byte [ecx + 0x45db38]
mov ecx, eax
sar ecx, 8
movzx ecx, cl
mov byte [esi + 5], dl
mov edx, ebx
sar edx, 8
xor dl, byte [ecx + 0x45db38]
mov byte [esi + 6], dl
mov edx, dword [esp + 0x14]
movzx ecx, dl
movzx ecx, byte [ecx + 0x45db38]
xor cl, bl
mov byte [esi + 7], cl
mov ecx, edx
mov ebx, dword [edi + ebp + 0x1f0]
mov edx, ebx
sar ecx, 0x18
movzx ecx, cl
sar edx, 0x18
xor dl, byte [ecx + 0x45db38]
mov ecx, dword [esp + 0x10]
sar ecx, 0x10
movzx ecx, cl
mov byte [esi + 8], dl
mov edx, ebx
sar edx, 0x10
xor dl, byte [ecx + 0x45db38]
mov ecx, dword [esp + 0x28]
sar ecx, 8
movzx ecx, cl
mov byte [esi + 9], dl
mov edx, ebx
sar edx, 8
xor dl, byte [ecx + 0x45db38]
movzx ecx, al
mov byte [esi + 0xa], dl
movzx ecx, byte [ecx + 0x45db38]
xor cl, bl
sar eax, 0x18
mov byte [esi + 0xb], cl
mov edx, dword [edi + ebp + 0x1f4]
mov ecx, edx
movzx eax, al
sar ecx, 0x18
pop edi
xor cl, byte [eax + 0x45db38]
mov eax, dword [esp + 0x10]
sar eax, 0x10
movzx eax, al
mov byte [esi + 0xc], cl
mov ecx, edx
sar ecx, 0x10
xor cl, byte [eax + 0x45db38]
mov eax, dword [esp + 0xc]
sar eax, 8
movzx eax, al
mov byte [esi + 0xd], cl
mov ecx, edx
sar ecx, 8
xor cl, byte [eax + 0x45db38]
mov eax, dword [esp + 0x24]
movzx eax, al
mov byte [esi + 0xe], cl
mov al, byte [eax + 0x45db38]
xor al, dl
mov byte [esi + 0xf], al
pop esi
pop ebx
pop ebp
add esp, 0x14
ret 8