Function at 0x404397
Capabilities:
Encode data using xor
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push esi
mov esi, ecx
push edi
cmp byte [esi + 4], 0
jne 0x4043c4
push 0x40f570
lea ecx, [ebp - 0x34]
call dword [0x408184]
lea eax, [ebp - 0x34]
push 0x40d570
push eax
call fcn.0040836e
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x4043e1
push dword [ebp + 0xc]
mov ecx, esi
push dword [ebp + 8]
call fcn.00403dbc
jmp 0x404621
push 4
cdq
pop ecx
idiv ecx
mov edi, eax
sub eax, ecx
xor ecx, ecx
cmp edi, 6
setne cl
inc ecx
neg eax
sbb eax, eax
and eax, ecx
shl eax, 5
test edi, edi
mov ecx, dword [eax + 0x40bc28]
mov dword [ebp - 0x18], ecx
mov ecx, dword [eax + 0x40bc30]
mov eax, dword [eax + 0x40bc38]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
lea eax, [esi + 0x454]
jle 0x404465
lea ecx, [esi + 0x1e8]
mov dword [ebp - 0xc], edi
mov dword [ebp - 4], ecx
mov ecx, dword [ebp + 8]
movzx edx, byte [ecx]
shl edx, 0x18
inc ecx
mov dword [eax], edx
movzx edx, byte [ecx]
shl edx, 0x10
or dword [eax], edx
inc ecx
xor edx, edx
mov dh, byte [ecx]
or dword [eax], edx
inc ecx
mov edx, eax
movzx ebx, byte [ecx]
or dword [eax], ebx
mov ebx, dword [ebp - 4]
add dword [ebp - 4], 4
inc ecx
mov ebx, dword [ebx]
add eax, 4
xor dword [edx], ebx
dec dword [ebp - 0xc]
jne 0x404431
push 1
pop eax
cmp dword [esi + 0x410], eax
mov dword [ebp - 0xc], eax
jle 0x404555
lea eax, [esi + 0x208]
mov dword [ebp - 8], eax
test edi, edi
jle 0x404523
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x18]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x14]
sub eax, edx
mov dword [ebp + 8], edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
sub eax, edx
lea ecx, [esi + 0x434]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x10], edi
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp + 8]
add eax, ebx
cdq
idiv edi
mov eax, edx
xor edx, edx
mov dl, byte [esi + eax*4 + 0x455]
mov eax, dword [ebp - 0x24]
add eax, ebx
mov dword [ebp - 0x28], edx
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
mov edx, dword [ebp - 0x28]
and eax, 0xff
mov ebx, dword [edx*4 + 0x40a3fc]
xor ebx, dword [eax*4 + 0x40a7fc]
mov eax, dword [ebp + 8]
cdq
idiv edi
xor eax, eax
mov al, byte [esi + edx*4 + 0x456]
xor ebx, dword [eax*4 + int.00409ffc]
xor eax, eax
mov al, byte [ecx + 0x23]
xor ebx, dword [eax*4 + 0x409bfc]
mov eax, dword [ebp - 4]
add dword [ebp - 4], 4
xor ebx, dword [eax]
mov dword [ecx], ebx
add ecx, 4
inc dword [ebp + 8]
dec dword [ebp - 0x10]
jne 0x4044ad
mov eax, edi
shl eax, 2
push eax
lea eax, [esi + 0x434]
push eax
lea eax, [esi + 0x454]
push eax
call fcn.00408306
add dword [ebp - 8], 0x20
add esp, 0xc
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [esi + 0x410]
jl 0x404480
and dword [ebp - 4], 0
test edi, edi
jle 0x404621
mov ecx, dword [ebp + 0xc]
mov ebx, dword [ebp - 0x14]
lea eax, [esi + 0x454]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 0x18]
sub eax, ebx
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x1c]
sub eax, ebx
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 0x410]
mov edx, dword [ebp - 4]
lea eax, [edx + eax*8]
mov edx, dword [ebp + 0xc]
add dword [ebp + 0xc], 4
mov eax, dword [esi + eax*4 + 0x1e8]
mov dword [ebp + 8], eax
xor eax, eax
mov al, byte [edx + 3]
mov edx, dword [ebp + 8]
sar edx, 0x18
mov al, byte [eax + 0x408afc]
xor al, dl
mov byte [ecx], al
mov eax, dword [ebp - 0x28]
add eax, ebx
inc ecx
cdq
idiv edi
xor eax, eax
mov al, byte [esi + edx*4 + 0x456]
mov edx, dword [ebp + 8]
sar edx, 0x10
mov al, byte [eax + 0x408afc]
xor al, dl
mov byte [ecx], al
mov eax, ebx
cdq
idiv edi
xor eax, eax
inc ecx
mov al, byte [esi + edx*4 + 0x455]
mov edx, dword [ebp + 8]
sar edx, 8
mov al, byte [eax + 0x408afc]
xor al, dl
mov byte [ecx], al
mov eax, dword [ebp - 0x24]
add eax, ebx
inc ecx
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
and eax, 0xff
mov al, byte [eax + 0x408afc]
xor al, byte [ebp + 8]
mov byte [ecx], al
inc ecx
inc dword [ebp - 4]
inc ebx
cmp dword [ebp - 4], edi
jl 0x404580
pop edi
pop esi
pop ebx
leave
ret 8