Function at 0x478de0
Capabilities:
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
sub esp, 0x24
push esi
mov esi, ecx
cmp dword [esi + 4], 0
je 0x4790ad
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x478e13
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
push eax
push ecx
mov ecx, esi
call fcn.00478630
pop esi
add esp, 0x24
ret 8
cdq
and edx, 3
add eax, edx
push edi
mov edi, eax
sar edi, 2
xor eax, eax
cmp edi, 4
je 0x478e2d
cmp edi, 6
setne al
inc eax
shl eax, 5
mov edx, dword [eax + 0x52a1c0]
push ebx
push ebp
mov ebp, dword [eax + 0x52a1c8]
mov eax, dword [eax + 0x52a1d0]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
mov dword [esp + 0x18], ebp
lea eax, [esi + 0x454]
test edi, edi
jle 0x478eb2
lea ecx, [esi + 8]
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x14], edi
lea esp, [esp]
movzx ebx, byte [ecx]
shl ebx, 0x18
mov dword [eax], ebx
movzx ebx, byte [ecx + 1]
inc ecx
shl ebx, 0x10
or dword [eax], ebx
movzx ebx, byte [ecx + 1]
inc ecx
shl ebx, 8
or dword [eax], ebx
movzx ebp, byte [ecx + 1]
or dword [eax], ebp
mov ebp, dword [esp + 0x10]
mov ebp, dword [ebp]
add dword [esp + 0x10], 4
inc ecx
mov ebx, eax
xor dword [ebx], ebp
inc ecx
add eax, 4
sub dword [esp + 0x14], 1
jne 0x478e70
mov ebp, dword [esp + 0x18]
mov eax, 1
cmp dword [esi + 0x3d0], eax
mov dword [esp + 0x1c], eax
jle 0x478fc9
lea eax, [esi + 0x28]
lea ebx, [esi + 0x434]
mov dword [esp + 0x38], eax
test edi, edi
jle 0x478f8d
mov eax, dword [esp + 0x38]
mov dword [esp + 0x14], eax
mov eax, ebp
mov ebp, dword [esp + 0x24]
sub eax, edx
sub ebp, edx
mov ecx, edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x10], edi
jmp 0x478f08
mov eax, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add eax, ecx
cdq
idiv edi
add ebx, 4
mov eax, dword [esi + edx*4 + 0x454]
sar eax, 8
and eax, 0xff
mov dword [esp + 0x30], eax
lea eax, [ecx + ebp]
cdq
idiv edi
mov eax, dword [esp + 0x30]
mov ebp, dword [eax*4 + 0x527998]
mov eax, ecx
inc ecx
mov edx, dword [esi + edx*4 + 0x454]
and edx, 0xff
xor ebp, dword [edx*4 + 0x527d98]
cdq
idiv edi
movsx eax, word [esi + edx*4 + 0x456]
movzx edx, byte [ebx + 0x1f]
and eax, 0xff
xor ebp, dword [eax*4 + 0x527598]
mov eax, dword [esp + 0x14]
xor ebp, dword [edx*4 + 0x527198]
add eax, 4
xor ebp, dword [eax - 4]
sub dword [esp + 0x10], 1
mov dword [ebx - 4], ebp
mov dword [esp + 0x14], eax
jne 0x478f00
mov ebp, dword [esp + 0x18]
lea eax, [edi*4]
push eax
lea ebx, [esi + 0x434]
lea eax, [esi + 0x454]
push ebx
push eax
call fcn.004d57a0
mov eax, dword [esp + 0x28]
add dword [esp + 0x44], 0x20
mov edx, dword [esp + 0x2c]
inc eax
add esp, 0xc
cmp eax, dword [esi + 0x3d0]
mov dword [esp + 0x1c], eax
jl 0x478ed4
mov dword [esp + 0x38], 0
test edi, edi
jle 0x4790aa
mov ecx, dword [esp + 0x3c]
lea eax, [esi + 0x454]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x24]
sub edx, ebp
sub eax, ebp
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
jmp 0x479000
mov eax, dword [esi + 0x3d0]
mov edx, dword [esp + 0x38]
lea eax, [edx + eax*8]
mov ebx, dword [esi + eax*4 + 8]
mov edx, dword [esp + 0x3c]
movzx eax, byte [edx + 3]
mov edx, ebx
sar edx, 0x18
xor dl, byte [eax + 0x526f98]
mov eax, dword [esp + 0x30]
mov byte [ecx], dl
add eax, ebp
cdq
idiv edi
mov eax, ebx
sar eax, 0x10
inc ecx
inc ecx
add dword [esp + 0x3c], 4
inc ecx
inc ecx
movsx edx, word [esi + edx*4 + 0x456]
and edx, 0xff
xor al, byte [edx + 0x526f98]
mov byte [ecx - 3], al
mov eax, ebp
cdq
idiv edi
mov eax, ebx
sar eax, 8
mov edx, dword [esi + edx*4 + 0x454]
sar edx, 8
and edx, 0xff
xor al, byte [edx + 0x526f98]
mov edx, dword [esp + 0x2c]
mov byte [ecx - 2], al
lea eax, [edx + ebp]
cdq
idiv edi
inc ebp
mov eax, dword [esi + edx*4 + 0x454]
and eax, 0xff
mov dl, byte [eax + 0x526f98]
mov eax, dword [esp + 0x38]
xor dl, bl
inc eax
cmp eax, edi
mov byte [ecx - 1], dl
mov dword [esp + 0x38], eax
jl 0x479000
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x24
ret 8