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

Disassembly:
sub esp, 0x30
push ebp
mov ebp, ecx
cmp byte [ebp + 4], 0
je 0x4161fc
mov eax, dword [ebp + 0x3cc]
cmp eax, 0x10
jne 0x415f6f
push dword [esp + 0x3c]
push dword [esp + 0x3c]
call fcn.00415b30
pop ebp
add esp, 0x30
ret 8
cdq
and edx, 3
push edi
lea edi, [edx + eax]
xor eax, eax
sar edi, 2
mov dword [esp + 0x20], edi
cmp edi, 4
je 0x415f8c
cmp edi, 6
setne al
inc eax
shl eax, 5
push ebx
push esi
mov ecx, dword [eax + 0x652654]
mov ebx, dword [eax + 0x65265c]
mov eax, dword [eax + 0x652664]
mov dword [esp + 0x18], eax
lea eax, [ebp + 0x454]
mov dword [esp + 0x14], ecx
mov esi, eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], eax
test edi, edi
jle 0x41600f
mov eax, dword [esp + 0x44]
lea ebx, [ebp + 0x1e8]
lea esp, [esp]
movzx ecx, byte [eax]
lea eax, [eax + 4]
shl ecx, 0x18
lea ebx, [ebx + 4]
mov dword [esi], ecx
mov edx, esi
movzx ecx, byte [eax - 3]
shl ecx, 0x10
or dword [esi], ecx
movzx ecx, byte [eax - 2]
shl ecx, 8
or dword [esi], ecx
movzx ecx, byte [eax - 1]
or dword [esi], ecx
add esi, 4
mov ecx, dword [ebx - 4]
xor dword [edx], ecx
dec edi
jne 0x415fd0
mov edi, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
cmp dword [ebp + 0x3d0], 1
mov dword [esp + 0x28], 1
jle 0x41611c
lea edx, [ebp + 0x208]
lea eax, [ebp + 0x434]
mov dword [esp + 0x2c], edx
test edi, edi
jle 0x4160d6
mov dword [esp + 0x20], eax
sub ebx, ecx
mov eax, dword [esp + 0x18]
mov esi, ecx
sub eax, ecx
mov dword [esp + 0x44], edx
mov dword [esp + 0x30], eax
mov dword [esp + 0x24], edi
lea eax, [ebx + esi]
cdq
idiv edi
mov eax, dword [esp + 0x30]
add eax, esi
mov ecx, dword [ebp + edx*4 + 0x454]
cdq
idiv edi
sar ecx, 8
and ecx, 0xff
movzx eax, byte [ebp + edx*4 + 0x454]
mov ecx, dword [ecx*4 + 0x653ad0]
xor ecx, dword [eax*4 + 0x6536d0]
mov eax, esi
cdq
inc esi
idiv edi
movsx eax, word [ebp + edx*4 + 0x456]
mov edx, dword [esp + 0x20]
and eax, 0xff
xor ecx, dword [eax*4 + 0x653ed0]
movzx eax, byte [edx + 0x23]
xor ecx, dword [eax*4 + 0x6542d0]
mov eax, dword [esp + 0x44]
xor ecx, dword [eax]
add eax, 4
mov dword [edx], ecx
add edx, 4
dec dword [esp + 0x24]
mov dword [esp + 0x44], eax
mov dword [esp + 0x20], edx
jne 0x416056
lea eax, [ebp + 0x434]
lea ecx, [edi*4]
push ecx
push eax
lea eax, [ebp + 0x454]
push eax
call fcn.005dc7f0
mov eax, dword [esp + 0x34]
add esp, 0xc
mov edx, dword [esp + 0x2c]
inc eax
mov ecx, dword [esp + 0x14]
add edx, 0x20
cmp eax, dword [ebp + 0x3d0]
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x28], eax
lea eax, [ebp + 0x434]
mov dword [esp + 0x2c], edx
jl 0x416034
xor ebx, ebx
mov dword [esp + 0x44], ebx
test edi, edi
jle 0x4161f2
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
sub edx, eax
mov esi, dword [esp + 0x48]
sub dword [esp + 0x18], eax
mov dword [esp + 0x14], edx
mov eax, dword [ebp + 0x3d0]
lea esi, [esi + 4]
lea eax, [ebx + eax*8]
mov ebx, dword [ebp + eax*4 + 0x1e8]
mov ecx, ebx
mov eax, dword [esp + 0x1c]
sar ecx, 0x18
add dword [esp + 0x1c], 4
movzx eax, byte [eax + 3]
xor cl, byte [eax + 0x6556d0]
mov eax, dword [esp + 0x10]
add eax, edx
mov byte [esi - 4], cl
cdq
idiv edi
mov eax, ebx
sar eax, 0x10
movsx ecx, word [ebp + edx*4 + 0x456]
and ecx, 0xff
xor al, byte [ecx + 0x6556d0]
mov byte [esi - 3], al
mov eax, dword [esp + 0x10]
cdq
idiv edi
mov eax, ebx
sar eax, 8
mov ecx, dword [ebp + edx*4 + 0x454]
sar ecx, 8
and ecx, 0xff
xor al, byte [ecx + 0x6556d0]
mov ecx, dword [esp + 0x10]
mov byte [esi - 2], al
mov eax, dword [esp + 0x18]
add eax, ecx
inc ecx
cdq
idiv edi
mov dword [esp + 0x10], ecx
movzx eax, byte [ebp + edx*4 + 0x454]
mov edx, dword [esp + 0x14]
mov al, byte [eax + 0x6556d0]
xor al, bl
mov ebx, dword [esp + 0x44]
inc ebx
mov byte [esi - 1], al
mov dword [esp + 0x44], ebx
cmp ebx, edi
jl 0x416140
pop esi
pop ebx
pop edi
pop ebp
add esp, 0x30
ret 8
push 0x699644
lea ecx, [esp + 0x2c]
call fcn.005d5ad4
push 0x692b58
lea eax, [esp + 0x2c]
push eax
call fcn.005d9e70
int3