Function at 0x404ef0
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 0x404f1c
push 0x421a64
lea ecx, [ebp - 0x34]
call fcn.0040e28c
lea eax, [ebp - 0x34]
push 0x41fbd0
push eax
call fcn.0040e336
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x404f39
push dword [ebp + 0xc]
mov ecx, esi
push dword [ebp + 8]
call fcn.00404917
jmp 0x405179
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 + 0x41bc04]
mov dword [ebp - 0x18], ecx
mov ecx, dword [eax + 0x41bc0c]
mov eax, dword [eax + 0x41bc14]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
lea eax, [esi + 0x454]
jle 0x404fbd
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 0x404f89
push 1
pop eax
cmp dword [esi + 0x3d0], eax
mov dword [ebp - 0xc], eax
jle 0x4050ad
lea eax, [esi + 0x208]
mov dword [ebp - 8], eax
test edi, edi
jle 0x40507b
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 + 0x41a3d8]
xor ebx, dword [eax*4 + 0x41a7d8]
mov eax, dword [ebp + 8]
cdq
idiv edi
xor eax, eax
mov al, byte [esi + edx*4 + 0x456]
xor ebx, dword [eax*4 + str.cw]
xor eax, eax
mov al, byte [ecx + 0x23]
xor ebx, dword [eax*4 + 0x419bd8]
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 0x405005
mov eax, edi
shl eax, 2
push eax
lea eax, [esi + 0x434]
push eax
lea eax, [esi + 0x454]
push eax
call fcn.0040d4c0
add dword [ebp - 8], 0x20
add esp, 0xc
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [esi + 0x3d0]
jl 0x404fd8
and dword [ebp - 4], 0
test edi, edi
jle 0x405179
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 + 0x3d0]
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 + 0x418ad8]
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 + 0x418ad8]
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 + 0x418ad8]
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 + 0x418ad8]
xor al, byte [ebp + 8]
mov byte [ecx], al
inc ecx
inc dword [ebp - 4]
inc ebx
cmp dword [ebp - 4], edi
jl 0x4050d8
pop edi
pop esi
pop ebx
leave
ret 8