Function at 0x5a5540
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x714
push ebx
push ebp
mov ebp, dword [esp + 0x724]
mov dword [esp + 0x18], ecx
push esi
mov esi, dword [esp + 0x724]
lea ebx, [ebp*4]
push edi
mov ecx, ebx
lea edi, [esp + 0x424]
mov eax, ecx
mov dword [esp + 0x1c], ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, ebx
mov esi, edx
mov edx, ecx
lea edi, [esp + 0x524]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, ebx
lea edi, [esp + 0x24]
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov esi, 1
and ecx, 3
mov dword [esp + 0x10], esi
rep stosb byte es:[edi], al
mov ecx, ebx
xor eax, eax
lea edi, [esp + 0x124]
mov dword [esp + 0x24], 0
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
xor edi, edi
mov dword [esp + 0x124], esi
mov dword [esp + 0x18], edi
mov eax, esi
mov ecx, 3
cdq
idiv ecx
mov ebx, edx
shl ebx, 8
mov eax, dword [esp + ebx + 0x424]
lea ecx, [esp + ebx + 0x424]
test eax, eax
jne 0x5a5626
mov eax, dword [esp + 0x1c]
mov edx, ebp
cmp dword [eax + ecx - 4], 0
lea eax, [eax + ecx - 4]
jne 0x5a561d
dec edx
je 0x5a561d
sub eax, 4
cmp dword [eax], 0
je 0x5a5612
cmp edx, 1
jle 0x5a56e6
mov eax, edi
mov esi, 3
cdq
idiv esi
lea eax, [edi + 2]
mov edi, 3
push ebp
push ecx
mov esi, edx
cdq
idiv edi
shl esi, 8
lea ecx, [esp + esi + 0x42c]
push ecx
mov edi, edx
lea edx, [esp + 0x330]
shl edi, 8
lea ecx, [esp + edi + 0x430]
call fcn.005a5110
lea edx, [esp + 0x324]
push ebp
push edx
lea edx, [esp + ebx + 0x2c]
mov ebx, dword [esp + 0x28]
mov ecx, ebx
call fcn.005a49c0
lea eax, [ebp + ebp]
lea ecx, [esp + esi + 0x24]
mov esi, eax
dec eax
test esi, esi
mov byte [esp + 0x14], 0
lea edx, [esp + edi + 0x24]
je 0x5a56cb
mov esi, ebx
lea edi, [eax + 1]
sub esi, ecx
xor eax, eax
add edx, 2
mov ax, word [esi + ecx]
add ecx, 2
mov ebx, eax
xor eax, eax
mov ax, word [ecx - 2]
sub eax, ebx
mov ebx, dword [esp + 0x14]
and ebx, 0xff
sub eax, ebx
mov word [edx - 2], ax
shr eax, 0x10
and al, 1
dec edi
mov byte [esp + 0x14], al
jne 0x5a5699
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
inc ecx
inc eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], eax
mov esi, ecx
mov edi, eax
jmp 0x5a55e0
lea eax, [esi - 1]
mov ecx, 3
cdq
idiv ecx
mov eax, edx
shl edx, 6
add edx, ebp
mov dword [esp + 0x14], eax
mov ecx, dword [esp + edx*4 + 0x20]
test ecx, ecx
jge 0x5a575f
mov ebx, dword [esp + 0x728]
mov ecx, eax
shl ecx, 8
test ebp, ebp
lea edi, [esp + ecx + 0x24]
mov byte [esp + 0x10], 0
mov edx, edi
je 0x5a575f
mov esi, dword [edi]
mov eax, dword [ebx]
mov ecx, dword [esp + 0x10]
add eax, esi
and ecx, 0xff
add ecx, eax
cmp eax, esi
jb 0x5a5748
mov al, byte [esp + 0x10]
test al, al
je 0x5a5741
test ecx, ecx
je 0x5a5748
mov byte [esp + 0x10], 0
jmp 0x5a574d
mov byte [esp + 0x10], 1
mov dword [edx], ecx
add ebx, 4
add edi, 4
add edx, 4
dec ebp
jne 0x5a571f
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
shl eax, 8
mov edx, ecx
lea esi, [esp + eax + 0x24]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x714
ret 8