Function at 0x5d5203
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push esi
and dword [ebp - 0x18], 0
mov ecx, dword [eax + 0x18]
mov eax, dword [edx + 4]
mov esi, eax
and eax, 7
mov dword [ebp - 0x24], eax
mov eax, dword [ecx]
shr esi, 3
cmp dword [edx + 8], 0
mov dword [ebp - 0x20], eax
mov eax, dword [ecx + 4]
lea esi, [esi*8 + 1]
mov dword [ebp - 0x2c], 1
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x1c], eax
jbe 0x5d54ee
push ebx
push edi
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp - 0x18]
and byte [ebp - 1], 0
and byte [ebp - 2], 0
mov ecx, dword [eax + 0x24]
mov ebx, dword [eax + 0x10]
mov eax, ecx
mov dword [ebp - 0x14], 0xd
imul eax, esi
add eax, ebx
mov dword [ebp - 0x28], eax
lea eax, [esi - 1]
mov edi, eax
mov dword [ebp - 0x30], eax
imul edi, ecx
lea esi, [eax - 1]
add edi, ebx
imul esi, ecx
mov cl, byte [edi]
add esi, ebx
shr cl, 2
and cl, 0x38
movzx cx, cl
mov word [ebp - 0x10], cx
mov cl, byte [esi]
and cl, 0xc0
movzx bx, cl
shl ebx, 3
cmp byte [edx + 0xd], 0
je 0x5d52cf
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp + 8]
add eax, 0x795
push eax
mov eax, dword [ebp - 0x20]
add eax, 0x795
push eax
call fcn.005d40cf
mov edx, dword [ebp + 0xc]
movzx eax, al
xor dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x2c], 0
jne 0x5d52fc
mov edx, dword [ebp + 0x10]
mov ecx, dword [edx + 0x24]
mov edx, dword [edx + 0x10]
push ecx
imul eax, ecx
imul ecx, dword [ebp - 0x18]
add eax, edx
add ecx, edx
push eax
push ecx
call fcn.005c3923
mov edx, dword [ebp + 0xc]
add esp, 0xc
jmp 0x5d54dd
xor eax, eax
push 1
mov ah, byte [edi]
inc edi
mov dword [ebp - 0xc], eax
movzx ax, byte [edi]
or dword [ebp - 0xc], eax
xor eax, eax
mov ah, byte [esi]
inc edi
inc esi
mov dword [ebp - 8], eax
movzx ax, byte [esi]
or dword [ebp - 8], eax
pop eax
inc esi
cmp dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
jbe 0x5d5418
mov eax, dword [ebp - 8]
mov cx, word [ebp - 0x14]
shr ax, cl
xor ecx, ecx
and al, 1
mov ch, al
mov eax, dword [ebp - 0x14]
or ebx, ecx
lea ecx, [eax - 1]
and ebx, 0xeffb
movzx ax, byte [ebp - 1]
shl ebx, 1
and eax, 0xdff7
and ecx, 0xf
or ebx, eax
mov eax, dword [ebp - 0xc]
shr ax, cl
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x10]
and ecx, 0xfeff
and eax, 1
shl eax, 2
or eax, ecx
shl eax, 1
cmp byte [edx + 0xe], 0
mov dword [ebp - 0x10], eax
je 0x5d5399
mov eax, dword [ebp - 0x30]
mov ecx, dword [edx + 0x10]
dec eax
push eax
push dword [ebp - 0x18]
call fcn.005c64c5
test al, al
je 0x5d5399
and byte [ebp - 1], 0
jmp 0x5d53b9
movzx eax, word [ebp - 0x10]
movzx ecx, bx
or eax, ecx
mov ecx, dword [ebp - 0x1c]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x20]
add eax, ecx
mov ecx, dword [ebp + 8]
push eax
call fcn.005d40cf
mov byte [ebp - 1], al
mov al, byte [ebp - 2]
mov ecx, dword [ebp - 0x30]
shl al, 1
or al, byte [ebp - 1]
test cl, 7
mov byte [ebp - 2], al
jne 0x5d5408
mov edx, dword [ebp - 0x28]
inc dword [ebp - 0x28]
and byte [ebp - 2], 0
cmp dword [ebp - 0x14], 8
mov byte [edx], al
jae 0x5d53f2
xor eax, eax
mov ah, byte [edi]
inc edi
mov al, byte [ebp - 0xc]
mov dword [ebp - 0xc], eax
xor eax, eax
mov ah, byte [esi]
mov al, byte [ebp - 8]
jmp 0x5d5404
xor eax, eax
mov ah, byte [ebp - 0xb]
mov al, byte [edi]
inc edi
mov dword [ebp - 0xc], eax
xor eax, eax
mov ah, byte [ebp - 7]
mov al, byte [esi]
mov dword [ebp - 8], eax
inc esi
mov edx, dword [ebp + 0xc]
inc ecx
cmp ecx, dword [ebp - 0x34]
mov dword [ebp - 0x30], ecx
jb 0x5d532b
xor esi, esi
cmp dword [ebp - 0x24], esi
jbe 0x5d54c8
mov eax, dword [ebp - 8]
mov cx, word [ebp - 0x14]
shr ax, cl
xor ecx, ecx
and al, 1
mov ch, al
mov eax, dword [ebp - 0x14]
or ebx, ecx
lea ecx, [eax - 1]
and ebx, 0xefff
movzx ax, byte [ebp - 1]
shl ebx, 1
and eax, 0xdffe
and ecx, 0xf
or ebx, eax
mov eax, dword [ebp - 0xc]
shr ax, cl
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x10]
and ecx, 0xfeff
and eax, 1
shl eax, 2
or eax, ecx
shl eax, 1
cmp byte [edx + 0xe], 0
mov dword [ebp - 0x10], eax
je 0x5d5490
mov ecx, dword [edx + 0x10]
lea eax, [esi - 1]
push eax
push dword [ebp - 0x18]
call fcn.005c64c5
test al, al
je 0x5d5490
and byte [ebp - 1], 0
jmp 0x5d54b0
movzx eax, word [ebp - 0x10]
movzx ecx, bx
or eax, ecx
mov ecx, dword [ebp - 0x1c]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x20]
add eax, ecx
mov ecx, dword [ebp + 8]
push eax
call fcn.005d40cf
mov byte [ebp - 1], al
mov al, byte [ebp - 2]
mov edx, dword [ebp + 0xc]
shl al, 1
or al, byte [ebp - 1]
inc esi
cmp esi, dword [ebp - 0x24]
mov byte [ebp - 2], al
jb 0x5d5423
cmp dword [ebp - 0x24], 0
je 0x5d54dd
mov al, byte [ebp - 2]
mov cl, 8
sub cl, byte [ebp - 0x24]
shl al, cl
mov ecx, dword [ebp - 0x28]
mov byte [ecx], al
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
cmp eax, dword [edx + 8]
jb 0x5d524d
pop edi
pop ebx
xor eax, eax
pop esi
leave
ret