Function at 0x50b714
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe00
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x1e0], ebx
mov dword [ebp - 0x1dc], ebx
mov dword [ebp - 0x1d8], ebx
mov dword [ebp - 0x1d4], ebx
mov dword [ebp - 0x1d0], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ecx
mov byte [ebp - 5], dl
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x50bf7f
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, 0x7e4
call fcn.00402764
mov dword [ebp - 0x2c], eax
mov eax, dword [0x6f26a8]
mov dword [ebp - 0x30], eax
mov eax, dword [0x6f2670]
mov dword [ebp - 0x34], eax
mov al, byte [ebp - 5]
sub al, 0x31
je 0x50b788
dec al
je 0x50b792
dec al
je 0x50b798
jmp 0x50b79c
mov al, byte [0x6f2678]
mov byte [ebp - 0x35], al
jmp 0x50b79c
mov byte [ebp - 0x35], 0
jmp 0x50b79c
mov byte [ebp - 0x35], 1
xor eax, eax
mov dword [0x6f2674], eax
xor eax, eax
mov dword [0x6f266c], eax
mov eax, dword [0x6f26b0]
call fcn.004331b0
mov edx, 0x50bf98
call fcn.00429258
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0xac]
xor ecx, ecx
mov edx, 0x50
call fcn.0040334c
xor eax, eax
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x10]
mov edx, dword [ebp + 8]
mov edx, dword [edx + 8]
mov edx, dword [edx - 4]
mov edx, dword [edx + 0x20]
call fcn.00404d30
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
push eax
mov eax, dword [ebp - 0x10]
call fcn.00509304
pop ecx
mov byte [ebp - 0x12], al
mov al, byte [ebp - 0x12]
mov byte [ebp - 0x11], al
lea eax, [ebp - 0x10]
mov ecx, 2
mov edx, 1
call fcn.004051e8
jmp 0x50bc00
cmp byte [ebp - 0x12], 0x18
jne 0x50b82c
cmp byte [ebp - 0x11], 0x18
jne 0x50bc3c
mov word [ebp - 0x14], 1
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov edx, 0x7e4
call fcn.0040334c
mov edx, dword [ebp - 0x10]
mov eax, 0x50bfa4
call fcn.0040528c
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x50b8ca
lea eax, [ebp - 0x1d0]
push eax
mov ecx, dword [ebp - 0x1c]
dec ecx
mov edx, 1
mov eax, dword [ebp - 0x10]
call fcn.004051a8
mov edx, dword [ebp - 0x1d0]
lea eax, [ebp - 0x1cc]
mov ecx, 0xff
call fcn.00404f2c
lea edx, [ebp - 0x1cc]
movzx eax, word [ebp - 0x14]
imul eax, eax, 0x65
mov ecx, dword [ebp - 0x2c]
lea eax, [ecx + eax - 0x65]
mov cl, 0x64
call fcn.00403204
lea eax, [ebp - 0x10]
mov ecx, dword [ebp - 0x1c]
mov edx, 1
call fcn.004051e8
mov edx, dword [ebp - 0x10]
mov eax, 0x50bfa4
call fcn.0040528c
mov dword [ebp - 0x1c], eax
inc word [ebp - 0x14]
cmp dword [ebp - 0x1c], 0
jne 0x50b857
inc dword [0x6f266c]
lea eax, [ebp - 0x1d4]
push eax
mov ecx, 0x64
mov edx, 1
mov eax, dword [ebp - 0x10]
call fcn.004051a8
mov edx, dword [ebp - 0x1d4]
lea eax, [ebp - 0x1cc]
mov ecx, 0xff
call fcn.00404f2c
lea edx, [ebp - 0x1cc]
movzx eax, word [ebp - 0x14]
imul eax, eax, 0x65
mov ecx, dword [ebp - 0x2c]
lea eax, [ecx + eax - 0x65]
mov cl, 0x64
call fcn.00403204
mov byte [ebp - 0x36], 0
mov al, byte [ebp - 0x12]
mov byte [ebp - 0x37], al
cmp byte [ebp - 0x37], 0x22
jne 0x50b940
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x30]
call fcn.0050a73c
pop ecx
mov byte [ebp - 0x37], al
cmp byte [ebp - 0x37], 0x18
je 0x50b950
cmp byte [ebp - 0x37], 0x26
je 0x50b950
xor eax, eax
jmp 0x50b952
mov al, 1
mov byte [ebp - 0x36], al
cmp byte [ebp - 0x36], 0
je 0x50b987
mov eax, dword [0x6f26b0]
call fcn.004331b0
mov eax, dword [eax + 0xc]
call fcn.004284d8
or al, byte [0x50bfa8]
push eax
mov eax, dword [0x6f26b0]
call fcn.004331b0
mov eax, dword [eax + 0xc]
pop edx
call fcn.004284e4
cmp byte [ebp - 0x36], 0
je 0x50ba4b
cmp word [ebp - 0x14], 1
jne 0x50b9d7
mov eax, dword [0x6f26b0]
call fcn.004331b0
push eax
lea eax, [ebp - 0x1d8]
mov edx, dword [ebp - 0x2c]
call fcn.00404ef4
mov edx, dword [ebp - 0x1d8]
pop eax
call fcn.00429258
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x4c]
jle 0x50bab9
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x4c], eax
jmp 0x50bab9
mov ax, word [ebp - 0x14]
test ax, ax
jbe 0x50bab9
mov word [ebp - 0x52], ax
mov word [ebp - 0x16], 1
lea eax, [ebp - 0x1dc]
movzx edx, word [ebp - 0x16]
imul edx, edx, 0x65
mov ecx, dword [ebp - 0x2c]
lea edx, [ecx + edx - 0x65]
call fcn.00404ef4
mov eax, dword [ebp - 0x1dc]
push eax
mov eax, dword [0x6f26b0]
call fcn.004331b0
pop edx
call fcn.00429258
mov dword [ebp - 0x28], eax
movzx eax, word [ebp - 0x16]
mov eax, dword [ebp + eax*4 - 0xb0]
cmp eax, dword [ebp - 0x28]
jge 0x50ba3f
movzx eax, word [ebp - 0x16]
mov edx, dword [ebp - 0x28]
mov dword [ebp + eax*4 - 0xb0], edx
inc word [ebp - 0x16]
dec word [ebp - 0x52]
jne 0x50b9ee
jmp 0x50bab9
mov ax, word [ebp - 0x14]
test ax, ax
jbe 0x50bab9
mov word [ebp - 0x52], ax
mov word [ebp - 0x16], 1
lea eax, [ebp - 0x1e0]
movzx edx, word [ebp - 0x16]
imul edx, edx, 0x65
mov ecx, dword [ebp - 0x2c]
lea edx, [ecx + edx - 0x65]
call fcn.00404ef4
mov eax, dword [ebp - 0x1e0]
push eax
mov eax, dword [0x6f26b0]
call fcn.004331b0
pop edx
call fcn.00429258
mov dword [ebp - 0x28], eax
movzx eax, word [ebp - 0x16]
mov eax, dword [ebp + eax*4 - 0xb0]
cmp eax, dword [ebp - 0x28]
jge 0x50baaf
movzx eax, word [ebp - 0x16]
mov edx, dword [ebp - 0x28]
mov dword [ebp + eax*4 - 0xb0], edx
inc word [ebp - 0x16]
dec word [ebp - 0x52]
jne 0x50ba5e
cmp byte [ebp - 0x36], 0
je 0x50baef
mov eax, dword [0x6f26b0]
call fcn.004331b0
mov eax, dword [eax + 0xc]
call fcn.004284d8
mov dl, byte [0x50bfa8]
not edx
and dl, al
push edx
mov eax, dword [0x6f26b0]
call fcn.004331b0
mov eax, dword [eax + 0xc]
pop edx
call fcn.004284e4
inc dword [ebp - 4]
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0xc]
call fcn.0041dc80
dec eax
cmp eax, dword [ebp - 4]
jne 0x50bb45
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 4]
call fcn.0041dc88
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
cmp byte [eax + 0xc], 7
jne 0x50bb45
mov eax, dword [0x6f2664]
call fcn.0041dc80
dec eax
cmp eax, dword [ebp - 0x34]
jle 0x50bb45
inc dword [ebp - 0x34]
mov edx, dword [ebp - 0x34]
mov eax, dword [0x6f2664]
call fcn.0041dc88
mov dword [ebp - 0x30], eax
xor eax, eax
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0xc]
call fcn.0041dc80
cmp eax, dword [ebp - 4]
jle 0x50bb97
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 4]
call fcn.0041dc88
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
cmp byte [eax + 0xc], 8
jne 0x50bb97
mov eax, dword [0x6f2664]
call fcn.0041dc80
dec eax
cmp eax, dword [ebp - 0x34]
jle 0x50bb97
inc dword [ebp - 0x34]
mov edx, dword [ebp - 0x34]
mov eax, dword [0x6f2664]
call fcn.0041dc88
mov dword [ebp - 0x30], eax
xor eax, eax
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0xc]
call fcn.0041dc80
cmp eax, dword [ebp - 4]
jle 0x50bbfc
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 4]
call fcn.0041dc88
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
cmp byte [eax + 0xc], 4
jne 0x50bbf6
lea eax, [ebp - 0x10]
mov edx, dword [ebp - 0x20]
mov edx, dword [edx + 0x20]
call fcn.00404d30
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
push eax
mov eax, dword [ebp - 0x10]
call fcn.00509304
pop ecx
mov byte [ebp - 0x12], al
lea eax, [ebp - 0x10]
mov ecx, 2
mov edx, 1
call fcn.004051e8
jmp 0x50bc00
mov byte [ebp - 0x12], 0x2c
jmp 0x50bc00
mov byte [ebp - 0x12], 0x2c
cmp byte [ebp - 0x12], 0x18
je 0x50b81c
cmp byte [ebp - 0x12], 0x26
je 0x50b81c
cmp byte [ebp - 0x12], 0x27
je 0x50b81c
cmp byte [ebp - 0x12], 0x19
je 0x50b81c
cmp byte [ebp - 0x12], 0x22
je 0x50b81c
cmp byte [ebp - 0x12], 0x25
je 0x50b81c
mov word [ebp - 0x16], 1
movzx eax, word [ebp - 0x16]
cmp dword [ebp + eax*4 - 0xb0], 0
jg 0x50bc65
movzx eax, word [ebp - 0x16]
cmp dword [ebp + eax*4 - 0xb0], 0
jne 0x50bc6b
cmp word [ebp - 0x16], 1
jne 0x50bc6b
inc dword [0x6f2674]
inc word [ebp - 0x16]
cmp word [ebp - 0x16], 0x15
jne 0x50bc42
xor eax, eax
mov dword [ebp - 0x3c], eax
mov ax, word [0x6f2674]
test ax, ax
jbe 0x50bcae
mov word [ebp - 0x52], ax
mov word [ebp - 0x16], 1
movzx eax, word [ebp - 0x16]
mov eax, dword [ebp + eax*4 - 0xb0]
add eax, dword [ebp - 0x3c]
add eax, dword [ebp - 0x24]
mov dword [ebp - 0x3c], eax
inc word [ebp - 0x16]
dec word [ebp - 0x52]
jne 0x50bc90
mov eax, dword [0x6f26b0]
call fcn.004331b0
mov edx, 0x50bfb4
call fcn.00429258
add dword [ebp - 0x4c], eax
xor eax, eax
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x4c]
cmp eax, dword [ebp - 0x3c]
jle 0x50bcec
cmp dword [0x6f2674], 0
jle 0x50bcec
mov eax, dword [ebp - 0x4c]
sub eax, dword [ebp - 0x3c]
cdq
idiv dword [0x6f2674]
inc eax
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x24]
mov dword [0x6f2760], eax
mov ax, word [0x6f2674]
inc eax
sub ax, 2
jb 0x50bd3d
inc eax
mov word [ebp - 0x52], ax
mov word [ebp - 0x16], 2
movzx eax, word [ebp - 0x16]
mov eax, dword [eax*4 + 0x6f2758]
movzx edx, word [ebp - 0x16]
add eax, dword [ebp + edx*4 - 0xb4]
add eax, dword [ebp - 0x24]
add eax, dword [ebp - 0x40]
movzx edx, word [ebp - 0x16]
mov dword [edx*4 + 0x6f275c], eax
inc word [ebp - 0x16]
dec word [ebp - 0x52]
jne 0x50bd0c
cmp byte [ebp - 0x35], 0
je 0x50bf51
mov eax, dword [0x6f2674]
mov eax, dword [eax*4 + 0x6f2760]
cmp eax, dword [0x6f267c]
jge 0x50bf51
cmp dword [ebp - 0xc], 0xffff
jne 0x50be38
mov eax, dword [0x6f2674]
mov dword [ebp - 0x44], eax
xor eax, eax
mov dword [ebp - 0x48], eax
lea esi, [ebp - 0xcc]
lea edi, [ebp - 0x200]
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x48]
cmp eax, 0xff
ja 0x50bd9d
bts dword [ebp - 0x200], eax
lea esi, [ebp - 0x200]
lea edi, [ebp - 0xcc]
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
inc dword [ebp - 0x48]
cmp dword [ebp - 0x48], 0x100
jne 0x50bd79
cmp dword [ebp - 0xc], 0xffff
jne 0x50bf51
mov eax, dword [ebp + 8]
push eax
mov edx, 1
mov eax, dword [ebp - 0x44]
call fcn.0050b6e8
pop ecx
push eax
mov eax, dword [0x6f2674]
push dword [eax*4 + 0x6f2760]
mov eax, dword [0x6f267c]
pop edx
sub eax, edx
pop edx
mov ecx, edx
cdq
idiv ecx
dec eax
mov dword [ebp - 0x40], eax
mov ax, word [0x6f2674]
inc eax
sub ax, 2
jb 0x50bf51
inc eax
mov word [ebp - 0x52], ax
mov word [ebp - 0x16], 2
movzx eax, word [ebp - 0x16]
dec eax
imul dword [ebp - 0x40]
movzx edx, word [ebp - 0x16]
add dword [edx*4 + 0x6f275c], eax
inc word [ebp - 0x16]
dec word [ebp - 0x52]
jne 0x50be16
jmp 0x50bf51
xor eax, eax
mov dword [ebp - 0x44], eax
mov esi, 0x50bfbc
lea edi, [ebp - 0xcc]
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x6f2674]
inc eax
test eax, eax
jle 0x50bebe
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x48], 1
mov ecx, dword [ebp - 0x48]
dec ecx
mov eax, 0x8000
shr eax, cl
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x50]
and eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x50]
jne 0x50beb6
lea esi, [ebp - 0xcc]
lea edi, [ebp - 0x200]
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x48]
cmp eax, 0xff
ja 0x50bea0
bts dword [ebp - 0x200], eax
lea esi, [ebp - 0x200]
lea edi, [ebp - 0xcc]
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
inc dword [ebp - 0x44]
inc dword [ebp - 0x48]
dec dword [ebp - 0x58]
jne 0x50be63
mov eax, dword [ebp + 8]
push eax
mov edx, 1
mov eax, dword [ebp - 0x44]
call fcn.0050b6e8
pop ecx
push eax
mov eax, dword [0x6f2674]
push dword [eax*4 + 0x6f2760]
mov eax, dword [0x6f267c]
pop edx
sub eax, edx
pop edx
mov ecx, edx
cdq
idiv ecx
dec eax
mov dword [ebp - 0x40], eax
mov ax, word [0x6f2674]
inc eax
sub ax, 2
jb 0x50bf51
inc eax
mov word [ebp - 0x52], ax
mov word [ebp - 0x16], 2
movzx eax, word [ebp - 0x16]
dec eax
cmp eax, 0xff
ja 0x50bf1a
bt dword [ebp - 0xcc], eax
jae 0x50bf47
movzx eax, word [ebp - 0x16]
mov edx, dword [0x6f2674]
inc edx
sub edx, eax
jl 0x50bf47
inc edx
mov dword [ebp - 0x58], edx
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x48]
mov edx, dword [ebp - 0x40]
add dword [eax*4 + 0x6f275c], edx
inc dword [ebp - 0x48]
dec dword [ebp - 0x58]
jne 0x50bf32
inc word [ebp - 0x16]
dec word [ebp - 0x52]
jne 0x50bf07
mov eax, dword [ebp - 0x2c]
call fcn.00402784
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x50bf86
lea eax, [ebp - 0x1e0]
mov edx, 5
call fcn.00404cbc
lea eax, [ebp - 0x10]
call fcn.00404c98
ret