Function at 0x51348c
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffb8
push ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
cmp dword [ebp - 8], 0
je 0x5134ce
mov eax, dword [ebp - 8]
cmp byte [eax], 0
jne 0x5134ce
mov eax, dword [ebp - 8]
cmp dword [eax + 1], 0x80
je 0x5134da
mov eax, dword [ebp - 8]
cmp dword [eax + 1], 0xc0
je 0x5134da
mov eax, dword [ebp - 8]
cmp dword [eax + 1], 0x100
je 0x5134da
mov dword [ebp - 0x10], 0xfffffffe
jmp 0x5137b3
cmp dword [ebp - 4], 0
je 0x51351c
mov eax, dword [ebp - 4]
cmp byte [eax], 1
je 0x5134f8
mov eax, dword [ebp - 4]
cmp byte [eax], 2
je 0x5134f8
mov eax, dword [ebp - 4]
cmp byte [eax], 3
jne 0x51351c
mov eax, dword [ebp - 4]
cmp dword [eax + 0x11], 0x80
je 0x513528
mov eax, dword [ebp - 4]
cmp dword [eax + 0x11], 0xc0
je 0x513528
mov eax, dword [ebp - 4]
cmp dword [eax + 0x11], 0x100
je 0x513528
mov dword [ebp - 0x10], 0xfffffffb
jmp 0x5137b3
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 - 0x20], eax
mov eax, dword [ebp - 4]
mov al, byte [eax]
dec al
je 0x513550
dec al
je 0x513639
jmp 0x51379e
mov eax, dword [ebp - 0x20]
dec eax
test eax, eax
jl 0x5137a7
inc eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x513574
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x5135bb
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x18], 0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
shl eax, 2
add eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0xc]
mov al, byte [edx + eax]
and al, 0xff
mov edx, dword [ebp - 0x1c]
lea edx, [ebp + edx*8 - 0x48]
mov ecx, dword [ebp - 0x18]
mov byte [edx + ecx], al
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], 4
jne 0x51358c
inc dword [ebp - 0x18]
dec dword [ebp - 0x28]
jne 0x513587
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.00512c1c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x5135e3
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x513628
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x18], 0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
shl eax, 2
add eax, dword [ebp - 0x1c]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
lea ecx, [ebp + ecx*8 - 0x48]
mov ebx, dword [ebp - 0x18]
mov cl, byte [ecx + ebx]
mov byte [edx + eax], cl
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], 4
jne 0x5135fb
inc dword [ebp - 0x18]
dec dword [ebp - 0x28]
jne 0x5135f6
inc dword [ebp - 0x14]
dec dword [ebp - 0x24]
jne 0x513567
jmp 0x5137a7
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x513646
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x51368e
inc eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x18], 0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
shl eax, 2
add eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 4]
mov al, byte [edx + eax + 1]
and al, 0xff
mov edx, dword [ebp - 0x1c]
lea edx, [ebp + edx*8 - 0x48]
mov ecx, dword [ebp - 0x18]
mov byte [edx + ecx], al
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], 4
jne 0x51365e
inc dword [ebp - 0x18]
dec dword [ebp - 0x24]
jne 0x513659
mov eax, dword [ebp - 0x20]
dec eax
test eax, eax
jl 0x5137a7
inc eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x5136b2
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x51370e
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x18], 0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x5136d7
add eax, 7
sar eax, 3
imul dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
shl edx, 2
add eax, edx
add eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0xc]
mov al, byte [edx + eax]
and al, 0xff
mov edx, dword [ebp - 0x1c]
lea edx, [ebp + edx*8 - 0x48]
mov ecx, dword [ebp - 0x18]
xor byte [edx + ecx], al
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], 4
jne 0x5136ca
inc dword [ebp - 0x18]
dec dword [ebp - 0x28]
jne 0x5136c5
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.00512c1c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x513736
add eax, 0x1f
sar eax, 5
dec eax
test eax, eax
jl 0x513790
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x18], 0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
test eax, eax
jns 0x51375b
add eax, 7
sar eax, 3
imul dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
shl edx, 2
add eax, edx
add eax, dword [ebp - 0x1c]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
lea ecx, [ebp + ecx*8 - 0x48]
mov ebx, dword [ebp - 0x18]
mov cl, byte [ecx + ebx]
mov byte [edx + eax], cl
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], 4
jne 0x51374e
inc dword [ebp - 0x18]
dec dword [ebp - 0x28]
jne 0x513749
inc dword [ebp - 0x14]
dec dword [ebp - 0x24]
jne 0x5136a5
jmp 0x5137a7
mov dword [ebp - 0x10], 0xfffffffb
jmp 0x5137b3
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
imul dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
pop ebx
mov esp, ebp
pop ebp
ret 8