Function at 0x402270
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 8
cmp dword [esp + 0x10], 0
mov eax, dword [esp + 0x14]
mov cl, byte [eax]
mov dl, byte [eax + 1]
mov dword [esp + 4], 0
jle 0x4024bd
push ebx
push ebp
push esi
push edi
movzx ebp, cl
movzx ebx, dl
lea esp, [esp]
lea eax, [ebp + 1]
cdq
mov ecx, 0x1dd
idiv ecx
mov esi, dword [0x446b94]
mov edi, 0x1dd
movzx ebp, dl
movzx eax, byte [esi + ebp]
lea ecx, [esi + ebp]
add eax, ebx
mov byte [esp + 0x12], dl
cdq
idiv edi
movzx ebx, dl
lea eax, [ebx + esi]
mov byte [esp + 0x13], dl
call fcn.00401040
mov ecx, dword [0x446b94]
movzx edx, byte [ecx + ebp]
movzx eax, byte [ebx + ecx]
add eax, edx
cdq
mov ecx, edi
idiv ecx
push 0x436895
push 0x4495e8
mov byte [esp + 0x19], dl
call fcn.00401f30
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402140
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x402333
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x402333
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x402354
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x40234c
or eax, 4
push 0
push eax
call fcn.00401b90
push 0x436895
push 0x4495e8
call fcn.00401f30
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402140
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x402396
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x402396
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x4023b7
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x4023af
or eax, 4
push 0
push eax
call fcn.00401b90
push 0x436895
push 0x4495e8
call fcn.00401f30
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402140
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x4023f9
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x4023f9
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x40241a
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x402412
or eax, 4
push 0
push eax
call fcn.00401b90
push 0x436895
push 0x4495e8
call fcn.00401f30
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402140
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x40245c
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x40245c
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x40247d
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x402475
or eax, 4
push 0
push eax
call fcn.00401b90
movzx edx, byte [esp + 0x11]
mov eax, dword [0x446b94]
mov cl, byte [edx + eax]
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x1c]
xor byte [eax + esi], cl
inc eax
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x14], eax
jl 0x4022a0
mov eax, dword [esp + 0x24]
mov dl, byte [esp + 0x12]
mov cl, byte [esp + 0x13]
pop edi
pop esi
pop ebp
mov byte [eax], dl
mov byte [eax + 1], cl
pop ebx
add esp, 8
ret
mov byte [eax], cl
mov byte [eax + 1], dl
add esp, 8
ret