Function at 0x642d80
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x642fe3
sub esp, 0x28
mov eax, dword [esp + 0x30]
test eax, eax
je 0x642dd2
mov ecx, dword [esp + 0x2c]
movzx edx, byte [ecx]
cmp dl, 0x7b
jne 0x642dbc
dec eax
mov ebx, eax
neg eax
sar eax, 0x1f
and eax, 1
add eax, ecx
jmp 0x642dc2
mov eax, ecx
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], eax
mov byte [esp + 0x13], dl
xor ecx, ecx
jmp 0x642e16
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov byte [esp + 0x48], 0
add esp, 0x28
ret
mov ebp, dword [esp + 0x1c]
add ecx, ebp
mov eax, dword [esp + 0x24]
movzx edx, byte [esp + 0x13]
mov ebx, dword [esp + 0x20]
cmp ebx, ecx
jle 0x642ef6
mov dword [esp + 0x1c], ecx
sub ebx, ecx
mov ebp, ebx
neg ebx
sar ebx, 0x1f
and ebx, ecx
add ebx, eax
mov dword [esp], ebx
mov dword [esp + 4], ebp
call fcn.00489e30
mov eax, dword [esp + 8]
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x14], ecx
cmp eax, 0xff
ja 0x642e67
movzx edx, al
lea ebx, [0x9ed720]
movzx edx, byte [ebx + edx]
test dl, 0x60
setne dl
jmp 0x642e8c
mov ecx, dword [0xa1707c]
mov dword [esp], ecx
mov dword [esp + 4], eax
call fcn.00495190
movzx edx, byte [esp + 8]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
lea ebx, [0x9ed720]
test dl, dl
je 0x642e94
xor edx, edx
jmp 0x642ed4
cmp eax, 0xff
jg 0x642eac
cmp eax, 0x30
jl 0x642ea8
cmp eax, 0x39
setle dl
jmp 0x642ed1
xor edx, edx
jmp 0x642ed1
mov ecx, dword [0xa16fbc]
mov dword [esp], ecx
mov dword [esp + 4], eax
call fcn.00495190
movzx edx, byte [esp + 8]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
lea ebx, [0x9ed720]
xor edx, 1
test dl, dl
je 0x642e03
cmp eax, 0x5f
je 0x642e03
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
movzx edx, byte [esp + 0x13]
mov ebx, dword [esp + 0x20]
test ecx, ecx
je 0x642f45
cmp dl, 0x7b
jne 0x642f39
cmp ebx, ecx
jle 0x642f10
lea edx, [eax + ecx]
cmp byte [edx], 0x7d
jne 0x642f10
lea edx, [ecx + 1]
jmp 0x642f3b
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov byte [esp + 0x48], 0
add esp, 0x28
ret
mov edx, ecx
mov dword [esp + 0x1c], edx
xor ebp, ebp
xor esi, esi
jmp 0x642f89
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov byte [esp + 0x48], 0
add esp, 0x28
ret
inc ebp
mov edx, edi
lea edi, [esi + esi*4]
mov esi, edi
movzx edi, dl
lea esi, [edi + esi*2 - 0x30]
mov edx, dword [esp + 0x1c]
cmp ebp, ecx
jge 0x642faa
movzx edi, byte [eax + ebp]
lea edx, [edi - 0x30]
cmp dl, 9
ja 0x642fa1
cmp esi, 0x5f5e100
jl 0x642f76
mov edx, dword [esp + 0x1c]
mov esi, 0xffffffff
cmp byte [eax], 0x30
jne 0x642fb9
cmp ecx, 1
jle 0x642fb9
mov esi, 0xffffffff
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], esi
sub ebx, edx
mov ecx, ebx
neg ebx
sar ebx, 0x1f
and edx, ebx
add eax, edx
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
mov byte [esp + 0x48], 1
add esp, 0x28
ret
call fcn.0045e260
jmp fcn.00642d80