Function at 0x51fd58
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 0x51fd8c
cmp dword [ebp - 8], 0
je 0x51fd8c
mov eax, dword [ebp - 8]
cmp byte [eax], 0
je 0x51fd8c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
mov edx, dword [ebp - 8]
cmp eax, dword [edx + 0x46]
je 0x51fd96
mov eax, 0xfffffffb
jmp 0x5200d3
cmp dword [ebp - 8], 0
je 0x51fdbf
mov edx, dword [ebp - 8]
cmp byte [edx], 1
jne 0x51fdbf
mov eax, dword [ebp - 8]
mov eax, dword [eax + 1]
cmp eax, 0x80
je 0x51fdc9
cmp eax, 0xc0
je 0x51fdc9
cmp eax, 0x100
je 0x51fdc9
mov eax, 0xfffffffe
jmp 0x5200d3
cmp dword [ebp - 4], 0
je 0x51fdfe
mov eax, dword [ebp - 4]
mov al, byte [eax]
cmp al, 1
je 0x51fde0
cmp al, 2
je 0x51fde0
cmp al, 3
jne 0x51fdfe
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x11]
cmp edx, 0x80
je 0x51fe08
cmp edx, 0xc0
je 0x51fe08
cmp edx, 0x100
je 0x51fe08
mov eax, 0xfffffffb
jmp 0x5200d3
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 0x51fe30
dec al
je 0x51fef4
jmp 0x5200c3
mov eax, dword [ebp - 0x10]
dec eax
test eax, eax
jl 0x5200ca
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0x11]
test esi, esi
jns 0x51fe4d
add esi, 0x1f
sar esi, 5
dec esi
test esi, esi
jl 0x51fe85
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 0x51fe63
inc edx
inc dword [ebp - 0x18]
dec esi
jne 0x51fe5e
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.0051f790
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0x11]
test esi, esi
jns 0x51fead
add esi, 0x1f
sar esi, 5
dec esi
test esi, esi
jl 0x51fee6
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 0x51fec3
inc edx
inc dword [ebp - 0x1c]
dec esi
jne 0x51febe
dec dword [ebp - 0x14]
jne 0x51fe40
jmp 0x5200ca
mov ebx, dword [ebp - 0x10]
dec ebx
cmp ebx, 1
jl 0x52000c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x51ff0e
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x51ff62
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 0x51ff36
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 0x51ff29
inc edx
inc dword [ebp - 0x20]
dec dword [ebp - 0x14]
jne 0x51ff22
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.0051f790
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x51ff8a
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x520003
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 0x51ffb5
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 0x51ffda
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 0x51ffa5
inc edx
inc dword [ebp - 0x24]
dec dword [ebp - 0x14]
jne 0x51ff9e
dec ebx
test ebx, ebx
jne 0x51ff01
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x520019
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x520050
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 0x52002e
inc edx
inc esi
dec dword [ebp - 0x14]
jne 0x52002a
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.0051f790
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x520078
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x5200ca
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 0x520091
inc edx
inc dword [ebp - 0x28]
dec dword [ebp - 0x14]
jne 0x52008c
jmp 0x5200ca
mov eax, 0xfffffffb
jmp 0x5200d3
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