Function at 0x502354
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x24]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x34]
mov edx, dword [ebp - 4]
sub eax, dword [edx + 0x6c]
mov edx, dword [ebp - 4]
sub eax, dword [edx + 0x64]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x50239e
mov eax, dword [ebp - 4]
cmp dword [eax + 0x64], 0
jne 0x50239e
mov eax, dword [ebp - 4]
cmp dword [eax + 0x6c], 0
jne 0x50239e
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
jmp 0x5024af
cmp dword [ebp - 0x14], 0xffffffff
jne 0x5023ac
dec dword [ebp - 0x14]
jmp 0x5024af
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 0x18]
sub edx, 0x106
add edx, dword [ebp - 0x18]
cmp eax, edx
jb 0x5024af
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x30]
mov edx, dword [ebp - 0x18]
lea edx, [eax + edx]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x30]
mov ecx, dword [ebp - 0x18]
call fcn.004ff758
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x68]
cmp eax, dword [ebp - 0x18]
jae 0x5023f5
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x68], edx
jmp 0x5023fe
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0x18]
sub dword [eax + 0x68], edx
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0x18]
sub dword [eax + 0x64], edx
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0x18]
sub dword [eax + 0x54], edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x44]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3c]
mov edx, dword [ebp - 8]
lea eax, [eax + edx*2]
mov dword [ebp - 0x10], eax
sub dword [ebp - 0x10], 2
mov eax, dword [ebp - 0x10]
movzx eax, word [eax]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x18]
jb 0x50244d
mov ax, word [ebp - 0xc]
sub ax, word [ebp - 0x18]
mov edx, dword [ebp - 0x10]
mov word [edx], ax
jmp 0x502455
mov eax, dword [ebp - 0x10]
mov word [eax], 0
dec dword [ebp - 8]
cmp dword [ebp - 8], 0
jne 0x502428
mov eax, dword [ebp - 0x18]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x38]
mov edx, dword [ebp - 8]
lea eax, [eax + edx*2]
mov dword [ebp - 0x10], eax
sub dword [ebp - 0x10], 2
mov eax, dword [ebp - 0x10]
movzx eax, word [eax]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x18]
jb 0x502498
mov ax, word [ebp - 0xc]
sub ax, word [ebp - 0x18]
mov edx, dword [ebp - 0x10]
mov word [edx], ax
jmp 0x5024a0
mov eax, dword [ebp - 0x10]
mov word [eax], 0
dec dword [ebp - 8]
cmp dword [ebp - 8], 0
jne 0x502473
mov eax, dword [ebp - 0x18]
add dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [eax + 4], 0
je 0x502552
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 4]
add eax, dword [edx + 0x6c]
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x30]
add edx, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x14]
call fcn.00501f5c
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 8]
add dword [eax + 0x6c], edx
mov eax, dword [ebp - 4]
cmp dword [eax + 0x6c], 3
jb 0x502537
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x30]
movzx eax, byte [edx + eax]
mov edx, dword [ebp - 4]
mov dword [edx + 0x40], eax
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x50]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x40]
shl eax, cl
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x64]
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x30]
movzx edx, byte [ecx + edx + 1]
xor eax, edx
mov edx, dword [ebp - 4]
and eax, dword [edx + 0x4c]
mov edx, dword [ebp - 4]
mov dword [edx + 0x40], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x6c], 0x106
jae 0x502552
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [eax + 4], 0
jne 0x502366
mov esp, ebp
pop ebp
ret