Function at 0x5d0754
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [ebp + 8]
push esi
push edi
mov edi, dword [ebp + 0xc]
mov eax, dword [eax + 0x18]
xor edx, edx
mov ecx, dword [edi + 4]
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x3c], ecx
mov esi, ecx
and ecx, 7
mov dword [ebp - 0x30], 1
shr esi, 3
cmp dword [edi + 8], edx
mov dword [ebp - 0x40], ecx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
lea esi, [esi*8 + 1]
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x10], edx
jbe 0x5d0ae8
push ebx
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp - 0x10]
and dword [ebp - 0x1c], 0
and byte [ebp + 0xf], 0
mov ecx, dword [eax + 0x24]
mov edx, dword [eax + 0x10]
mov eax, ecx
and byte [ebp - 1], 0
imul eax, ebx
add eax, edx
dec ebx
mov esi, ebx
mov dword [ebp - 0x20], eax
imul esi, ecx
mov cl, byte [esi + edx]
add esi, edx
shr cl, 2
and cl, 0x30
cmp byte [edi + 0xd], 0
movzx cx, cl
mov word [ebp - 0x18], cx
mov dword [ebp - 0x24], 0xd
je 0x5d080f
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp + 8]
add eax, 0x195
push eax
mov eax, dword [ebp - 0x2c]
add eax, 0x195
push eax
call fcn.005cec4a
movzx eax, al
xor dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x20]
cmp dword [ebp - 0x30], 0
jne 0x5d0839
mov ecx, dword [ebp + 0x10]
mov eax, dword [ecx + 0x24]
mov ecx, dword [ecx + 0x10]
push eax
imul ebx, eax
imul eax, dword [ebp - 0x10]
add ebx, ecx
add eax, ecx
push ebx
push eax
call fcn.005be4a1
add esp, 0xc
jmp 0x5d0ad8
xor ecx, ecx
push 1
mov ch, byte [esi]
inc esi
mov dword [ebp - 0x14], ecx
movzx cx, byte [esi]
or dword [ebp - 0x14], ecx
pop ecx
inc esi
cmp dword [ebp - 0x38], ecx
mov dword [ebp - 8], ecx
jbe 0x5d0a31
movzx ax, byte [ebp + 0xf]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
mov ebx, 0xffef
and ecx, 0xfff7
and eax, ebx
shl ecx, 1
or eax, ecx
mov cx, dx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
shr ax, cl
and eax, 1
shl eax, 3
or dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
and eax, 0xfdff
shl eax, 1
mov dword [ebp - 0x18], eax
or eax, dword [ebp - 0x1c]
dec edx
and edx, 0xf
and eax, ebx
cmp byte [edi + 0x18], 0
mov dword [ebp - 0x24], edx
mov dword [ebp - 0xc], eax
jne 0x5d08de
mov ecx, dword [ebp - 8]
and ecx, 7
jne 0x5d08b6
push 8
pop ecx
movsx edx, byte [edi + 0x14]
neg ecx
cmp edx, ecx
mov dword [ebp + 0xc], edx
jle 0x5d08de
or cl, 0xff
sub cl, dl
mov dl, byte [ebp - 1]
shr dl, cl
and dl, 1
movzx cx, dl
shl ecx, 4
or eax, ecx
mov dword [ebp - 0xc], eax
jmp 0x5d090c
movsx eax, byte [edi + 0x14]
mov ecx, dword [ebp - 8]
lea eax, [eax + ecx - 1]
mov ecx, dword [ebp + 0x10]
push eax
movsx eax, byte [edi + 0x18]
add eax, dword [ebp - 0x10]
push eax
call fcn.005c1043
push eax
lea eax, [ebp - 0xc]
push 4
push eax
call fcn.005cf688
mov eax, dword [ebp - 0xc]
add esp, 0xc
cmp byte [edi + 0xe], 0
je 0x5d0932
mov eax, dword [ebp - 8]
mov ecx, dword [edi + 0x10]
dec eax
push eax
push dword [ebp - 0x10]
call fcn.005c1043
test al, al
je 0x5d092c
and byte [ebp + 0xf], 0
jmp 0x5d094c
movzx eax, word [ebp - 0xc]
jmp 0x5d0935
movzx eax, ax
mov ecx, dword [ebp - 0x28]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x2c]
add eax, ecx
mov ecx, dword [ebp + 8]
push eax
call fcn.005cec4a
mov byte [ebp + 0xf], al
mov al, byte [ebp - 1]
shl al, 1
or al, byte [ebp + 0xf]
test byte [ebp - 8], 7
mov byte [ebp - 1], al
jne 0x5d0983
mov ecx, dword [ebp - 0x20]
inc dword [ebp - 0x20]
and byte [ebp - 1], 0
cmp dword [ebp - 0x24], 8
mov byte [ecx], al
jae 0x5d0978
xor eax, eax
mov ah, byte [esi]
mov al, byte [ebp - 0x14]
jmp 0x5d097f
xor eax, eax
mov ah, byte [ebp - 0x13]
mov al, byte [esi]
mov dword [ebp - 0x14], eax
inc esi
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x38]
jb 0x5d0858
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 8]
cmp ecx, dword [ebp - 0x3c]
ja 0x5d0ac6
dec ecx
mov dword [ebp - 0x34], ecx
movzx ax, byte [ebp + 0xf]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
and ecx, 0xfff7
and eax, ebx
shl ecx, 1
or eax, ecx
mov cx, dx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
shr ax, cl
mov cl, byte [edi + 0x18]
and eax, 1
shl eax, 3
or dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
and eax, 0xfdff
shl eax, 1
mov dword [ebp - 0x18], eax
or eax, dword [ebp - 0x1c]
dec edx
and edx, 0xf
and eax, 0xfffb
test cl, cl
mov dword [ebp - 0x24], edx
mov dword [ebp - 0xc], eax
jne 0x5d0a3b
mov esi, dword [ebp - 8]
and esi, 7
jne 0x5d0a02
push 8
pop esi
movsx edx, byte [edi + 0x14]
neg esi
mov dword [ebp + 0xc], edx
mov edx, esi
cmp dword [ebp + 0xc], edx
mov dword [ebp - 0x44], esi
jle 0x5d0a3b
mov dl, byte [ebp - 1]
or cl, 0xff
sub cl, byte [ebp + 0xc]
shr dl, cl
and dl, 1
movzx cx, dl
shl ecx, 2
or eax, ecx
mov dword [ebp - 0xc], eax
jmp 0x5d0a68
mov ebx, 0xffef
jmp 0x5d0995
movsx eax, byte [edi + 0x14]
mov edx, dword [ebp - 8]
lea eax, [eax + edx - 1]
push eax
movsx eax, cl
add eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x10]
push eax
call fcn.005c1043
push eax
lea eax, [ebp - 0xc]
push 2
push eax
call fcn.005cf688
mov eax, dword [ebp - 0xc]
add esp, 0xc
cmp byte [edi + 0xe], 0
je 0x5d0a8c
push dword [ebp - 0x34]
mov ecx, dword [edi + 0x10]
push dword [ebp - 0x10]
call fcn.005c1043
test al, al
je 0x5d0a86
and byte [ebp + 0xf], 0
jmp 0x5d0aa6
movzx eax, word [ebp - 0xc]
jmp 0x5d0a8f
movzx eax, ax
mov ecx, dword [ebp - 0x28]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x2c]
add eax, ecx
mov ecx, dword [ebp + 8]
push eax
call fcn.005cec4a
mov byte [ebp + 0xf], al
mov al, byte [ebp - 1]
shl al, 1
or al, byte [ebp + 0xf]
inc dword [ebp - 8]
inc dword [ebp - 0x34]
mov byte [ebp - 1], al
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x3c]
jbe 0x5d09a5
mov eax, dword [ebp - 0x20]
cmp dword [ebp - 0x40], 0
je 0x5d0ad8
mov dl, byte [ebp - 1]
mov cl, 8
sub cl, byte [ebp - 0x40]
shl dl, cl
mov byte [eax], dl
inc dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
cmp eax, dword [edi + 8]
jb 0x5d07a4
pop ebx
pop edi
xor eax, eax
pop esi
leave
ret