Function at 0x401fd0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ecx
push ebx
mov ebx, dword [esp + 0xc]
test bl, 3
push ebp
push esi
push edi
je 0x401fe2
xor dl, dl
jmp 0x402006
xor edx, edx
mov eax, ebx
mov ecx, 0x64
div ecx
test edx, edx
je 0x401ff5
mov dl, 1
jmp 0x402006
xor edx, edx
mov eax, ebx
mov ecx, 0x190
div ecx
neg edx
sbb dl, dl
inc dl
movsx eax, dl
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x1c]
lea ecx, [eax + edx*4]
mov esi, dword [ecx*4 + 0x4181c4]
lea eax, [ebx - 0x7a7]
cdq
mov ecx, 0x8e
idiv ecx
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x1c]
add esi, ebp
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], ebx
mov eax, edx
cdq
mov ecx, eax
xor ecx, edx
sub ecx, edx
lea edx, [ecx*4]
mov eax, dword [edx + 0x418228]
shr eax, 4
and eax, 0xf
cmp edi, eax
jb 0x402067
jne 0x4020d8
movzx edi, byte [edx + 0x418229]
cmp ebp, edi
jae 0x4020d8
test ecx, ecx
je 0x402073
cmp ebx, 0x7a7
jne 0x40207e
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
pop ecx
ret
lea eax, [ebx - 1]
dec ecx
test al, 3
mov dword [esp + 0x18], eax
je 0x40208e
xor edi, edi
jmp 0x4020b6
xor edx, edx
mov edi, 0x64
div edi
test edx, edx
je 0x4020a2
mov edi, 1
jmp 0x4020b6
mov eax, dword [esp + 0x18]
xor edx, edx
mov edi, 0x190
div edi
mov edi, edx
neg edi
sbb edi, edi
inc edi
xor edx, edx
test edi, edi
setne dl
add edx, 0x16d
add esi, edx
lea edx, [ecx*4]
mov eax, dword [edx + 0x418228]
shr eax, 4
and eax, 0xf
mov ebp, dword [eax*4 + 0x4181c4]
movzx eax, byte [edx + 0x418229]
mov ecx, 1
sub ecx, ebp
movzx ebp, word [edx + 0x41822a]
sub ecx, eax
mov eax, ebp
and eax, 0x8000
add esi, ecx
neg eax
sbb eax, eax
neg eax
add eax, 0x1d
movzx ecx, ax
cmp esi, ecx
mov dword [esp + 0x1c], 0x8000
mov edi, 1
jbe 0x402145
lea esp, [esp]
mov ax, word [esp + 0x1c]
shr ax, 1
mov word [esp + 0x1c], ax
movzx eax, ax
and eax, ebp
sub esi, ecx
inc edi
neg eax
sbb eax, eax
neg eax
add eax, 0x1d
movzx ecx, ax
cmp esi, ecx
ja 0x402120
mov ecx, dword [esp + 0x24]
movzx eax, ax
cmp esi, eax
mov dword [esp + 0x1c], eax
sete al
mov byte [ecx + 0x11], al
mov byte [ecx + 0x10], 0
mov dword [ecx + 0x14], 0
mov edx, dword [edx + 0x418228]
and edx, 0xf
mov eax, edi
je 0x402185
lea ebp, [edx + 1]
cmp edi, ebp
mov dword [ecx + 0x14], edx
jne 0x40217e
mov byte [ecx + 0x10], 1
cmp edi, edx
jbe 0x402185
lea eax, [edi - 1]
lea eax, [eax + esi - 2]
xor edx, edx
mov ebp, 6
div ebp
mov eax, dword [esp + 0x18]
mov dword [ecx], eax
add eax, 0xfffff89a
mov dword [ecx + 8], esi
mov esi, 0xa
mov dword [ecx + 4], edi
mov dword [ecx + 0x2c], 0
mov dword [ecx + 0xc], edx
mov edx, dword [esp + 0x1c]
mov dword [ecx + 0x18], edx
xor edx, edx
div esi
mov eax, dword [esp + 0x18]
add eax, 0xfffff894
mov esi, 0xc
inc edx
mov dword [ecx + 0x1c], edx
xor edx, edx
div esi
mov esi, 0xa
inc edx
mov dword [ecx + 0x20], edx
xor edx, edx
test bl, 1
je 0x4021fb
lea edi, [ebx - 0x76d]
shr edi, 2
lea eax, [edi + 5]
div esi
lea eax, [edi + edi*8 + 3]
mov esi, edx
inc esi
dec ebx
jmp 0x402212
lea edi, [ebx - 0x76e]
shr edi, 2
mov eax, edi
div esi
lea eax, [edi + edi*8 + 8]
mov esi, edx
inc esi
add ebx, 0xfffffffe
and bl, 3
cmp bl, 2
jne 0x40221d
add eax, 0xa
xor edx, edx
mov edi, 0xc
div edi
mov ebx, dword [esp + 0x10]
lea eax, [esi + ebx - 2]
mov esi, 0xa
mov edi, edx
xor edx, edx
div esi
inc edi
lea eax, [edi + ebx - 2]
mov esi, 0xc
pop edi
inc edx
mov dword [ecx + 0x24], edx
xor edx, edx
div esi
pop esi
pop ebp
pop ebx
inc edx
mov dword [ecx + 0x28], edx
xor eax, eax
pop ecx
ret