Function at 0x402a40
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
mov dword [ebp - 0xc], edi
mov edx, dword [esi]
mov al, byte [edx + 3]
and al, 0xe0
cmp al, 0xc0
jne 0x402db1
mov eax, dword [esi + 4]
sub eax, edx
cmp eax, 9
jb 0x402db1
movzx ecx, byte [edx + 8]
add ecx, 9
cmp ecx, eax
jae 0x402db1
push ebx
lea ebx, [edi + 0x98]
add edx, ecx
sub eax, ecx
mov dword [ebp - 0x1c], ebx
mov ecx, dword [ebx + 4]
cmp dword [ebx], ecx
je 0x402ab1
mov esi, dword [ebx]
cmp byte [esi], 0
mov esi, dword [ebp + 8]
jne 0x402ab1
push dword [ebp + 8]
add eax, edx
push eax
push edx
push ecx
mov ecx, ebx
call fcn.00408d20
mov eax, dword [ebx]
mov byte [eax], 0xff
jmp 0x402b30
push dword [ebp + 8]
add eax, edx
push eax
push edx
push ecx
mov ecx, ebx
call fcn.00408d20
mov ecx, dword [ebx + 4]
xor edx, edx
mov eax, dword [ebx]
mov esi, ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], eax
sub esi, eax
je 0x402b03
mov ecx, 1
mov edi, eax
nop word [eax + eax]
cmp byte [edi + ecx - 1], 0xff
jne 0x402af4
cmp ecx, esi
jae 0x402afa
mov al, byte [edi + ecx]
and al, 0xf0
cmp al, 0xf0
je 0x402afa
inc edx
inc ecx
cmp edx, esi
jb 0x402ae0
mov edi, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 8]
add edx, eax
cmp eax, edx
je 0x402b22
sub ecx, edx
push ecx
push edx
push eax
mov dword [ebp - 8], ecx
call fcn.004114d0
mov ecx, dword [ebp - 8]
add esp, 0xc
add ecx, dword [ebp - 4]
mov dword [ebx + 4], ecx
sub ecx, dword [ebx]
cmp ecx, 2
jb 0x402db0
mov esi, dword [ebp + 8]
mov edx, dword [esi]
mov al, byte [edx + 7]
and al, 0xc0
cmp al, 0x80
jb 0x402b8e
mov eax, dword [esi + 4]
sub eax, edx
cmp eax, 0xe
jb 0x402b8e
movzx esi, byte [edx + 0xb]
xor ecx, ecx
movzx eax, byte [edx + 0xa]
and esi, 0xfe
shl eax, 8
or esi, eax
movzx eax, byte [edx + 0xc]
shl esi, 7
or esi, eax
movzx eax, byte [edx + 0xd]
shr eax, 1
shl esi, 7
or esi, eax
mov al, byte [edx + 9]
and al, 0xe
movzx eax, al
cdq
shld edx, eax, 0x1d
shl eax, 0x1d
or esi, eax
or ecx, edx
mov dword [edi + 0x80], esi
mov dword [edi + 0x84], ecx
mov edx, dword [ebx + 4]
mov ecx, edx
mov eax, dword [ebx]
sub ecx, eax
je 0x402da9
mov esi, eax
nop
cmp byte [esi], 0xff
jne 0x402da1
mov ecx, edx
sub ecx, esi
mov dword [ebp - 0x18], ecx
cmp ecx, 7
jb 0x402da9
mov dl, byte [esi + 1]
mov cl, dl
and cl, 0xf0
cmp cl, 0xf0
jne 0x402da1
and dl, 1
mov dword [ebp - 4], 0xc
mov byte [ebp + 0xb], dl
mov edi, 0x1e
movzx edx, byte [esi + 2]
mov ecx, edx
mov eax, edx
shr eax, 6
and eax, 1
shr ecx, 7
add ecx, ecx
or ecx, eax
mov eax, edx
mov dword [ebp - 0x14], ecx
mov ecx, edx
shr eax, 4
and eax, 1
shr ecx, 5
shl eax, 2
and ecx, 1
shl ecx, 3
or ecx, eax
mov eax, edx
shr eax, 3
and eax, 1
add eax, eax
or ecx, eax
mov eax, edx
shr eax, 2
and edx, 1
and eax, 1
shl edx, 2
or ecx, eax
mov dword [ebp - 0x10], ecx
movzx ecx, byte [esi + 3]
mov eax, ecx
shr ecx, 6
shr eax, 7
and ecx, 1
add eax, eax
or edx, eax
or edx, ecx
xor ebx, ebx
mov dword [ebp - 8], edx
mov edx, edi
mov ecx, 7
mov al, dl
inc edi
and al, 7
shr edx, 3
sub cl, al
movzx eax, byte [edx + esi]
shr eax, cl
mov ecx, dword [ebp - 4]
and eax, 1
shl eax, cl
or ebx, eax
sub ecx, 1
mov dword [ebp - 4], ecx
jns 0x402c45
movzx eax, byte [ebp + 0xb]
mov edi, dword [ebp - 0xc]
xor eax, 1
lea eax, [eax*2 + 7]
mov dword [ebp - 4], eax
cmp ebx, eax
jb 0x402d95
mov eax, dword [edi + 0x98]
mov edx, dword [edi + 0x9c]
cmp dword [ebp - 0x18], ebx
jb 0x402da9
mov ecx, dword [edi + 0xc8]
mov edx, dword [ebp - 0x10]
mov dword [ebp + 8], eax
cmp ecx, dword [edi + 0xcc]
jne 0x402ce5
mov dword [ebp + 8], eax
cmp edx, 0xd
jae 0x402ce5
mov ecx, dword [ebp - 0x14]
mov dword [edi + 0x164], ecx
mov ecx, dword [edx*4 + 0x430e4c]
mov dword [edi + 0x168], ecx
mov ecx, dword [ebp - 8]
mov dword [edi + 0x16c], edx
mov dword [edi + 0x170], ecx
mov dword [ebp + 8], eax
jmp 0x402ce8
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 0x14]
cmp dword [edi + 0x164], esi
jne 0x402d4d
cmp dword [edi + 0x16c], edx
jne 0x402d4d
cmp dword [edi + 0x170], ecx
jne 0x402d4d
push dword [ebp + 8]
mov ecx, dword [ebp + 8]
add eax, ebx
add ecx, dword [ebp - 4]
push eax
push ecx
push dword [edi + 0xc0]
lea ecx, [edi + 0xbc]
call fcn.00408d20
mov edx, ebx
lea ecx, [edi + 0x174]
sub edx, dword [ebp - 4]
movzx eax, dx
mov dword [ebp + 8], eax
mov eax, dword [ecx + 4]
cmp eax, dword [ecx + 8]
je 0x402d43
mov word [eax], dx
add dword [ecx + 4], 2
jmp 0x402d4d
lea edx, [ebp + 8]
push edx
push eax
call fcn.00408210
mov eax, dword [edi + 0x98]
mov dword [ebp + 8], eax
lea ecx, [eax + ebx]
cmp eax, ecx
je 0x402d7b
mov esi, dword [edi + 0x9c]
sub esi, ecx
push esi
push ecx
push eax
call fcn.004114d0
mov eax, dword [ebp + 8]
add esp, 0xc
add eax, esi
mov dword [edi + 0x9c], eax
mov edx, dword [edi + 0x9c]
mov ecx, edx
mov eax, dword [edi + 0x98]
mov esi, eax
sub ecx, eax
jne 0x402ba0
jmp 0x402da9
mov esi, dword [ebp - 0x1c]
mov edx, dword [esi]
mov eax, edx
mov dword [esi + 4], edx
jmp 0x402da9
mov edx, esi
mov dword [edi + 0x9c], esi
cmp eax, edx
je 0x402db0
mov byte [eax], 0
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4