Function at 0x687d70
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x6880a6
sub esp, 0x3c
movzx eax, byte [esp + 0x40]
lea edx, [eax - 1]
cmp dl, 7
ja 0x68808c
mov edx, dword [esp + 0x48]
test edx, edx
je 0x688050
mov ebx, dword [esp + 0x44]
movzx ebp, byte [ebx]
cmp al, 8
jae 0x687dc8
movzx ecx, al
mov esi, 1
shl esi, cl
cmp ecx, 0x20
sbb edi, edi
and esi, edi
add esi, 0xffffffff
and ebp, esi
movzx ecx, al
mov eax, 1
shl eax, cl
cmp ecx, 0x20
sbb esi, esi
and eax, esi
mov esi, eax
add eax, 0xffffffff
add ecx, 0xffffffe0
mov dword [esp + 0x30], ecx
mov edi, 1
shl edi, cl
neg ecx
mov edx, 1
shr edx, cl
cmp ecx, 0x20
mov ecx, ebx
sbb ebx, ebx
and edx, ebx
mov ebx, dword [esp + 0x30]
cmp ebx, 0x20
sbb ebx, ebx
and edi, ebx
or edi, edx
add esi, 0xffffffff
adc edi, 0xffffffff
test edi, edi
sete dl
cmp ebp, eax
setb al
and edx, eax
test edi, edi
seta al
or edx, eax
test dl, dl
jne 0x68800e
mov eax, dword [esp + 0x4c]
lea edx, [eax - 1]
mov ebx, edx
neg edx
sar edx, 0x1f
and edx, 1
add edx, ecx
mov esi, dword [esp + 0x48]
lea edi, [esi - 1]
mov dword [esp + 0x34], eax
xor eax, eax
mov dword [esp + 0x30], eax
xor eax, eax
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x34]
jmp 0x687e8a
mov ebp, dword [esp + 0x24]
mov edi, dword [esp + 0x20]
mov edi, ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x4c]
mov esi, dword [esp + 0x48]
mov ebx, dword [esp + 0x20]
mov edx, ecx
mov ecx, dword [esp + 0x44]
test edi, edi
jle 0x687fda
mov dword [esp + 0x2c], edi
movzx eax, byte [edx]
mov byte [esp + 0x13], al
and eax, 0x7f
mov dword [esp + 0x28], eax
mov esi, dword [esp + 0x18]
cmp esi, 1
sbb esi, esi
xor esi, 0xffffffff
mov edi, dword [esp + 0x14]
or esi, edi
mov ecx, esi
shl eax, cl
cmp ecx, 0x20
sbb edi, edi
and eax, edi
mov edi, eax
add eax, ebp
mov dword [esp + 0x24], eax
dec ebx
mov dword [esp + 0x20], ebx
neg ebx
sar ebx, 0x1f
and ebx, 1
add edx, ebx
mov ebx, dword [esp + 0x2c]
dec ebx
add ecx, 0xffffffe0
mov dword [esp + 0x1c], ecx
mov esi, dword [esp + 0x28]
shl esi, cl
neg ecx
mov eax, dword [esp + 0x28]
shr eax, cl
cmp ecx, 0x20
mov ecx, edx
sbb edx, edx
and eax, edx
mov edx, dword [esp + 0x1c]
cmp edx, 0x20
sbb edx, edx
and esi, edx
or esi, eax
add edi, ebp
mov eax, dword [esp + 0x30]
adc esi, eax
movzx eax, byte [esp + 0x13]
test al, 0x80
je 0x687faa
mov eax, dword [esp + 0x14]
add eax, 7
mov edx, dword [esp + 0x18]
adc edx, 0
test edx, edx
xchg ebp, ebx
sete bl
xchg ebp, ebx
cmp eax, 0x3f
xchg edi, ebx
setae bl
xchg edi, ebx
and edi, ebp
test edx, edx
xchg ebp, ebx
seta bl
xchg ebp, ebx
or edi, ebp
xchg edi, eax
test al, al
xchg edi, eax
je 0x687e62
lea eax, [0x922d70]
mov dword [esp], eax
lea eax, [0xc5c4b8]
mov dword [esp + 4], eax
call fcn.004076a0
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov edx, dword [esp + 0x44]
mov dword [esp + 0x58], edx
mov edx, dword [esp + 0x48]
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], ecx
add esp, 0x3c
ret
mov eax, dword [esp + 0x24]
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], esi
mov dword [esp + 0x58], ecx
mov dword [esp + 0x5c], ebx
mov eax, dword [esp + 0x20]
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], 0
mov dword [esp + 0x68], 0
add esp, 0x3c
ret
mov edx, dword [0xc5c4b0]
mov ebx, dword [0xc5c4b4]
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], ecx
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], edx
mov dword [esp + 0x68], ebx
add esp, 0x3c
ret
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], 0
mov eax, dword [esp + 0x4c]
dec eax
mov edx, eax
neg eax
sar eax, 0x1f
and eax, 1
add eax, ecx
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x48]
dec eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], 0
mov dword [esp + 0x68], 0
add esp, 0x3c
ret
mov eax, dword [0xc5c4b4]
mov ecx, dword [0xc5c4b0]
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov ebx, dword [esp + 0x44]
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], ecx
mov dword [esp + 0x68], eax
add esp, 0x3c
ret
lea eax, [0x80a3e0]
mov dword [esp], eax
lea eax, [0x91f4d8]
mov dword [esp + 4], eax
call fcn.00427650
ud2
call fcn.0044b100
jmp fcn.00687d70