Function at 0x402120
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x20
push ebx
push ebp
push esi
push edi
mov edi, dword [0x420cb0]
test edi, edi
je 0x40240f
push 0x8000
push 0xff
push edi
call fcn.00404c70
mov dx, word [0x42003c]
mov esi, 1
mov eax, dword [esp + 0x44]
mov ebx, esi
mov cl, dl
mov dword [0x420cb4], eax
mov eax, dword [esp + 0x48]
shl bx, cl
mov dword [0x420cb8], eax
mov dword [0x420cbc], 0
mov dword [esp + 0x1c], ebx
lea ecx, [ebx + 1]
mov word [0x420cc4], bx
lea eax, [ecx + 1]
mov dword [esp + 0x38], ecx
movzx eax, ax
lea ebp, [ecx + 1]
mov dword [esp + 0x20], eax
lea eax, [edx + 1]
mov word [0x420cc8], cx
mov cl, al
mov dword [esp + 0x24], eax
mov word [0x420cc0], ax
shl si, cl
movzx eax, si
mov dword [esp + 0x28], eax
xor eax, eax
mov word [0x420c9c], ax
mov dword [0x420cac], eax
movzx eax, bx
push eax
mov word [0x420ccc], bp
mov word [0x420ca0], si
call fcn.00402420
add esp, 0x10
test eax, eax
jne 0x40240f
mov eax, dword [esp + 0x34]
mov ecx, 1
mov esi, dword [esp + 0x3c]
movzx ebx, byte [eax]
mov word [0x420cd0], bx
cmp esi, ecx
jbe 0x402378
mov edx, 0xfff
nop word [eax + eax]
movzx eax, byte [ecx + eax]
inc ecx
mov word [0x420cd4], ax
movzx esi, bx
shl esi, 8
or esi, eax
mov dword [esp + 0x28], ecx
mov eax, esi
mov dword [0x420ca8], esi
shr eax, 0xc
xor eax, esi
and eax, 0x1fff
mov ecx, eax
mov dword [esp + 0x20], ecx
lea eax, [edi + ecx*4]
mov dword [esp + 0x24], eax
mov eax, dword [eax]
shr eax, 0xc
cmp eax, 0xfffff
je 0x40226e
cmp esi, eax
je 0x4022f2
inc ecx
and ecx, 0x1fff
mov eax, dword [edi + ecx*4]
shr eax, 0xc
cmp eax, 0xfffff
jne 0x402252
mov eax, 0xffff
mov word [0x420ca4], ax
movzx eax, bx
push eax
call fcn.00402420
add esp, 4
test eax, eax
jne 0x40240f
mov bx, word [0x420cd4]
mov eax, 0xfff
mov word [0x420cd0], bx
cmp bp, ax
jbe 0x40230f
mov eax, dword [esp + 0x10]
movzx eax, ax
push eax
call fcn.00402420
add esp, 4
test eax, eax
jne 0x40240f
mov eax, dword [esp + 0x18]
mov bp, word [esp + 0x14]
push 0x8000
mov word [0x420cc0], ax
mov eax, dword [esp + 0x20]
push 0xff
push edi
mov word [0x420ccc], bp
mov word [0x420ca0], ax
call fcn.00404c70
add esp, 0xc
jmp 0x40235f
movzx eax, cx
mov ax, word [edi + eax*4]
and ax, dx
movzx ebx, ax
mov word [0x420ca4], bx
mov word [0x420cd0], bx
jmp 0x402364
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
movzx edx, bp
movzx eax, ax
mov ecx, dword [ecx]
and ecx, 0xfffff000
lea ebp, [edx + 1]
mov word [0x420ccc], bp
cmp ecx, 0xfffff000
je 0x40234e
inc eax
and eax, 0x1fff
mov ecx, dword [edi + eax*4]
and ecx, 0xfffff000
cmp ecx, 0xfffff000
jne 0x402337
movzx eax, ax
and edx, 0xfff
shl esi, 0xc
or edx, esi
mov dword [edi + eax*4], edx
mov edx, 0xfff
mov esi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x34]
cmp ecx, esi
jb 0x402210
movzx eax, bx
push eax
call fcn.00402420
add esp, 4
test eax, eax
jne 0x40240f
mov eax, dword [esp + 0x10]
movzx eax, ax
push eax
call fcn.00402420
add esp, 4
test eax, eax
jne 0x40240f
mov eax, dword [esp + 0x2c]
movzx eax, ax
push eax
call fcn.00402420
add esp, 4
test eax, eax
jne 0x40240f
mov ecx, dword [0x420cbc]
mov ebx, 0xfff8
mov ax, word [0x420c9c]
mov edx, dword [0x420cac]
mov edi, dword [esp + 0x38]
nop
test ax, ax
je 0x4023e3
cmp ecx, esi
jae 0x40240f
mov byte [ecx + edi], dl
inc ecx
mov dword [0x420cbc], ecx
shr edx, 8
mov dword [0x420cac], edx
cmp ax, 8
jbe 0x4023fd
add ax, bx
mov word [0x420c9c], ax
jmp 0x4023d0
mov eax, dword [esp + 0x40]
pop edi
pop esi
pop ebp
mov dword [eax], ecx
xor eax, eax
pop ebx
add esp, 0x20
ret 0x10
pop edi
pop esi
pop ebp
mov eax, 0x33
pop ebx
add esp, 0x20
ret 0x10