Function at 0x51fd80
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffb8
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x51fdb4
cmp dword [ebp - 8], 0
je 0x51fdb4
mov eax, dword [ebp - 8]
cmp byte [eax], 0
je 0x51fdb4
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
mov edx, dword [ebp - 8]
cmp eax, dword [edx + 0x46]
je 0x51fdbe
mov eax, 0xfffffffb
jmp 0x5200fb
cmp dword [ebp - 8], 0
je 0x51fde7
mov edx, dword [ebp - 8]
cmp byte [edx], 1
jne 0x51fde7
mov eax, dword [ebp - 8]
mov eax, dword [eax + 1]
cmp eax, 0x80
je 0x51fdf1
cmp eax, 0xc0
je 0x51fdf1
cmp eax, 0x100
je 0x51fdf1
mov eax, 0xfffffffe
jmp 0x5200fb
cmp dword [ebp - 4], 0
je 0x51fe26
mov eax, dword [ebp - 4]
mov al, byte [eax]
cmp al, 1
je 0x51fe08
cmp al, 2
je 0x51fe08
cmp al, 3
jne 0x51fe26
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x11]
cmp edx, 0x80
je 0x51fe30
cmp edx, 0xc0
je 0x51fe30
cmp edx, 0x100
je 0x51fe30
mov eax, 0xfffffffb
jmp 0x5200fb
mov eax, dword [ebp - 4]
push dword [eax + 0x11]
mov eax, dword [ebp + 0xc]
pop edx
mov ecx, edx
cdq
idiv ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 4]
mov al, byte [eax]
dec al
je 0x51fe58
dec al
je 0x51ff1c
jmp 0x5200eb
mov eax, dword [ebp - 0x10]
dec eax
test eax, eax
jl 0x5200f2
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0x11]
test esi, esi
jns 0x51fe75
add esi, 0x1f
sar esi, 5
dec esi
test esi, esi
jl 0x51fead
inc esi
xor edx, edx
lea eax, [ebp - 0x48]
mov dword [ebp - 0x18], eax
xor eax, eax
mov ecx, dword [ebp - 0x18]
mov ebx, edx
shl ebx, 2
add ebx, eax
mov edi, dword [ebp - 0xc]
mov bl, byte [edi + ebx]
and bl, 0xff
mov byte [ecx], bl
inc eax
add ecx, 8
cmp eax, 4
jne 0x51fe8b
inc edx
inc dword [ebp - 0x18]
dec esi
jne 0x51fe86
mov eax, dword [ebp - 8]
add eax, 0x4a
push eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x11]
mov eax, dword [ebp - 8]
mov edx, dword [eax + 1]
lea eax, [ebp - 0x48]
call fcn.0051f7b8
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0x11]
test esi, esi
jns 0x51fed5
add esi, 0x1f
sar esi, 5
dec esi
test esi, esi
jl 0x51ff0e
inc esi
xor edx, edx
lea eax, [ebp - 0x48]
mov dword [ebp - 0x1c], eax
xor eax, eax
mov ecx, dword [ebp - 0x1c]
mov ebx, edx
shl ebx, 2
add ebx, eax
mov edi, dword [ebp + 8]
lea ebx, [edi + ebx]
push ebx
mov bl, byte [ecx]
pop edi
mov byte [edi], bl
inc eax
add ecx, 8
cmp eax, 4
jne 0x51feeb
inc edx
inc dword [ebp - 0x1c]
dec esi
jne 0x51fee6
dec dword [ebp - 0x14]
jne 0x51fe68
jmp 0x5200f2
mov ebx, dword [ebp - 0x10]
dec ebx
cmp ebx, 1
jl 0x520034
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x51ff36
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x51ff8a
inc eax
mov dword [ebp - 0x14], eax
xor edx, edx
lea eax, [ebp - 0x48]
mov dword [ebp - 0x20], eax
xor eax, eax
mov ecx, dword [ebp - 0x20]
mov esi, ecx
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x11]
test ecx, ecx
jns 0x51ff5e
add ecx, 7
sar ecx, 3
imul ecx, ebx
mov edi, edx
shl edi, 2
add ecx, edi
add ecx, eax
mov edi, dword [ebp - 0xc]
mov cl, byte [edi + ecx]
and cl, 0xff
mov byte [esi], cl
inc eax
add esi, 8
cmp eax, 4
jne 0x51ff51
inc edx
inc dword [ebp - 0x20]
dec dword [ebp - 0x14]
jne 0x51ff4a
mov eax, dword [ebp - 8]
add eax, 0x4a
push eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x11]
mov eax, dword [ebp - 8]
mov edx, dword [eax + 1]
lea eax, [ebp - 0x48]
call fcn.0051f7b8
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x51ffb2
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x52002b
inc eax
mov dword [ebp - 0x14], eax
xor edx, edx
lea eax, [ebp - 0x48]
mov dword [ebp - 0x24], eax
xor eax, eax
mov ecx, dword [ebp - 0x24]
mov esi, ecx
mov ecx, ebx
dec ecx
mov edi, dword [ebp - 4]
mov edi, dword [edi + 0x11]
test edi, edi
jns 0x51ffdd
add edi, 7
sar edi, 3
imul ecx, edi
mov edi, edx
shl edi, 2
add ecx, edi
add ecx, eax
mov edi, dword [ebp - 0xc]
mov cl, byte [edi + ecx]
xor cl, byte [esi]
push ecx
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x11]
test ecx, ecx
jns 0x520002
add ecx, 7
sar ecx, 3
imul ecx, ebx
mov edi, edx
shl edi, 2
add ecx, edi
add ecx, eax
mov edi, dword [ebp + 8]
add edi, ecx
pop ecx
mov byte [edi], cl
inc eax
add esi, 8
cmp eax, 4
jne 0x51ffcd
inc edx
inc dword [ebp - 0x24]
dec dword [ebp - 0x14]
jne 0x51ffc6
dec ebx
test ebx, ebx
jne 0x51ff29
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x520041
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x520078
inc eax
mov dword [ebp - 0x14], eax
xor edx, edx
lea esi, [ebp - 0x48]
xor eax, eax
mov ecx, esi
mov ebx, edx
shl ebx, 2
add ebx, eax
mov edi, dword [ebp - 0xc]
mov bl, byte [edi + ebx]
and bl, 0xff
mov byte [ecx], bl
inc eax
add ecx, 8
cmp eax, 4
jne 0x520056
inc edx
inc esi
dec dword [ebp - 0x14]
jne 0x520052
mov eax, dword [ebp - 8]
add eax, 0x4a
push eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x11]
mov eax, dword [ebp - 8]
mov edx, dword [eax + 1]
lea eax, [ebp - 0x48]
call fcn.0051f7b8
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x5200a0
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x5200f2
inc eax
mov dword [ebp - 0x14], eax
xor edx, edx
lea eax, [ebp - 0x48]
mov dword [ebp - 0x28], eax
xor eax, eax
mov ecx, dword [ebp - 0x28]
mov esi, edx
shl esi, 2
mov ebx, esi
add ebx, eax
mov edi, dword [ebp - 4]
mov bl, byte [edi + ebx + 1]
xor bl, byte [ecx]
push ebx
add esi, eax
mov ebx, dword [ebp + 8]
lea esi, [ebx + esi]
pop ebx
mov byte [esi], bl
inc eax
add ecx, 8
cmp eax, 4
jne 0x5200b9
inc edx
inc dword [ebp - 0x28]
dec dword [ebp - 0x14]
jne 0x5200b4
jmp 0x5200f2
mov eax, 0xfffffffb
jmp 0x5200fb
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
imul dword [ebp - 0x10]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8