Function at 0x406270
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x4065a8
sub esp, 0x3c
mov eax, dword [esp + 0x40]
mov edx, dword [eax + 0x18]
lea ebx, [eax + 0x18]
mov dword [esp + 0x38], ebx
test edx, edx
je 0x406588
mov ebp, dword [edx + 8]
lea esi, [edx + 8]
test ebp, ebp
je 0x406588
mov dword [esp + 0x34], esi
mov dword [esp + 0x30], ebp
mov edi, dword [esp + 0x44]
mov ecx, ebx
movzx ebx, word [edi + 0x34]
mov esi, ebp
lea ebp, [ebx + esi - 4]
test byte [edi], al
mov edi, dword [ebp]
add ebx, esi
test edi, edi
je 0x406559
mov edx, dword [0x700660]
test edx, edx
jne 0x40653c
mov dword [ebp], 0
mov edx, dword [eax + 0x18]
test byte [edx], al
mov ebx, dword [0x700660]
lea ebp, [edx + 8]
test ebx, ebx
jne 0x40651f
mov dword [edx + 8], 0
mov edx, dword [esp + 0x30]
movzx ebx, byte [eax + 5]
cmp bl, 0x10
jae 0x4064c8
movzx ebx, word [eax + 6]
inc ebx
mov word [eax + 6], bx
mov dword [esp + 0x24], edx
mov ebx, dword [esp + 0x44]
mov ebp, dword [ebx + 0x28]
movzx ebp, byte [ebp + 0xf]
xchg ebp, eax
test al, 0x80
xchg ebp, eax
je 0x40637c
mov ebp, dword [eax + 0x18]
test ebp, ebp
je 0x406482
mov ecx, dword [eax + 0x18]
mov ecx, dword [ecx]
test ecx, ecx
je 0x40643c
mov eax, dword [eax + 0x18]
mov ecx, dword [eax]
test byte [eax], al
mov eax, dword [ecx + 8]
mov ebp, dword [ecx]
mov esi, dword [ecx + 4]
lea edi, [esi + 1]
cmp edi, eax
jg 0x4063c6
lea eax, [esi + 1]
mov dword [ecx + 4], eax
mov eax, dword [0x700660]
lea ecx, [ebp + esi*4]
test eax, eax
jne 0x4063b0
mov dword [ebp + esi*4], edx
movzx eax, word [ebx + 0x34]
mov ecx, dword [esp + 0x48]
lea eax, [ecx + eax - 4]
test byte [eax], al
mov ecx, dword [0x700660]
test ecx, ecx
jne 0x40639e
mov dword [eax], edx
mov dword [esp + 0x4c], edx
add esp, 0x3c
ret
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040ef10
mov edx, dword [esp + 0x24]
jmp 0x406396
mov dword [esp], ecx
mov dword [esp + 4], edx
call fcn.0040ef10
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x44]
jmp 0x40637c
mov dword [esp + 0x2c], ecx
lea ecx, [0x5b0d60]
mov dword [esp], ecx
mov dword [esp + 4], ebp
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], edi
call fcn.00438c30
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x2c]
mov dword [ebx + 8], edx
mov edx, dword [0x700660]
test edx, edx
jne 0x40641a
mov dword [ebx], eax
mov edx, dword [esp + 0x24]
mov esi, ecx
mov ebp, eax
mov ecx, ebx
mov ebx, dword [esp + 0x44]
jmp 0x406364
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], ecx
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.0040ef10
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
jmp 0x406407
lea eax, [0x597ca0]
mov dword [esp], eax
call fcn.0040e6c0
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 0x18]
test byte [ecx], al
mov edx, dword [0x700660]
mov ebx, dword [esp + 4]
test edx, edx
jne 0x406470
mov dword [ecx], ebx
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x44]
jmp 0x40634e
mov dword [esp], ecx
mov dword [esp + 4], ebx
call fcn.0040ef10
mov eax, dword [esp + 0x40]
jmp 0x406463
lea eax, [0x5b4ac0]
mov dword [esp], eax
call fcn.0040e6c0
mov eax, dword [0x700660]
mov ecx, dword [esp + 4]
test eax, eax
jne 0x4064b2
mov eax, dword [esp + 0x40]
mov dword [eax + 0x18], ecx
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x44]
jmp 0x406341
mov eax, dword [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.0040ef10
mov eax, dword [esp + 0x40]
jmp 0x4064a5
mov ebp, dword fs:[0x14]
mov ebp, dword [ebp]
mov ebp, dword [ebp + 0x18]
mov esi, dword [ebp + 0x8c]
mov edi, esi
sar esi, 0x1f
and esi, 0xa8888eef
shl edi, 1
xor edi, esi
mov dword [ebp + 0x8c], edi
add ebx, 0xfffffff1
mov ebp, ecx
mov ecx, ebx
mov esi, 1
shl esi, cl
cmp cl, 0x20
sbb ebx, ebx
and esi, ebx
lea ebx, [esi - 1]
test ebx, edi
jne 0x406518
movzx ecx, word [eax + 6]
inc ecx
mov word [eax + 6], cx
mov ecx, ebp
jmp 0x406320
mov dword [esp], ebp
mov dword [esp + 4], 0
call fcn.0040ef10
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x406306
mov dword [esp], ebp
mov dword [esp + 4], 0
call fcn.0040ef10
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x4062e9
mov ebp, dword [0x700660]
test ebp, ebp
jne 0x40656b
mov dword [edx + 8], ebx
jmp 0x406306
mov eax, dword [esp + 0x34]
mov dword [esp], eax
mov dword [esp + 4], ebx
call fcn.0040ef10
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x406306
mov eax, dword [esp + 0x44]
mov ecx, dword [eax + 0x28]
mov dword [esp], ecx
call fcn.0040e6c0
mov edx, dword [esp + 4]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x40630a
call fcn.0044a520
jmp fcn.00406270