Function at 0x4029d0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xc
mov eax, dword [esp + 0x38]
mov edx, 0xffffffb8
test eax, eax
je 0x402c27
mov ecx, dword [esp + 0x34]
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x20]
movzx ebx, byte [ecx]
test bl, bl
js 0x402a2e
cmp ebx, eax
jae 0x402c27
inc ecx
dec esi
sub esp, 4
push dword [esp + 0x44]
push dword [esp + 0x44]
push 6
push ebx
push ecx
push esi
push edi
call fcn.004013b0
add esp, 0x20
mov edx, eax
cmp eax, 0xffffff88
jbe 0x402b3d
jmp 0x402c27
lea ebp, [ebx - 0x7e]
shr ebp, 1
cmp ebp, eax
jae 0x402c27
lea eax, [ebx - 0x7f]
mov edx, 0xffffffec
cmp eax, esi
jae 0x402c27
test eax, eax
je 0x402c0a
add ebx, 0xffffff80
xor edx, edx
cmp ebx, 0x1e
jb 0x402b0e
lea esi, [ecx + 1]
mov dword [esp], ebx
shr dword [esp], 1
mov dword [esp + 8], ebp
mov ebp, dword [esp]
add ebp, ecx
add ebp, 2
cmp ebp, edi
mov ebp, dword [esp + 8]
jbe 0x402a8e
and ebx, 0xfffffffe
add ebx, edi
add ebx, 2
cmp esi, ebx
jb 0x402b0e
mov edx, dword [esp]
inc edx
mov dword [esp], edx
and edx, 0xfffffff0
mov dword [esp + 4], edx
add edx, edx
xor ebx, ebx
movdqa xmm0, xmmword [0x421050]
movdqa xmm1, xmmword [0x421060]
mov ebp, ebx
and ebp, 0x7ffffff0
movq xmm2, qword [esi + ebp]
movq xmm3, qword [esi + ebp + 8]
movdqa xmm4, xmm2
psrlw xmm4, 4
pand xmm4, xmm0
movdqa xmm5, xmm3
psrlw xmm5, 4
pand xmm5, xmm0
pand xmm2, xmm1
punpcklbw xmm4, xmm2
pand xmm3, xmm1
punpcklbw xmm5, xmm3
movdqu xmmword [edi + ebx*2], xmm4
movdqu xmmword [edi + ebx*2 + 0x10], xmm5
add ebx, 0x10
cmp dword [esp + 4], ebx
jne 0x402ab0
mov esi, dword [esp + 4]
cmp dword [esp], esi
mov ebp, dword [esp + 8]
je 0x402b3b
mov esi, edx
shr esi, 1
add ecx, esi
inc ecx
nop word cs:[eax + eax]
movzx ebx, byte [ecx]
shr bl, 4
mov byte [edi + edx], bl
movzx ebx, byte [ecx]
and bl, 0xf
mov byte [edi + edx + 1], bl
add edx, 2
inc ecx
cmp edx, eax
jb 0x402b20
mov ebx, ebp
pxor xmm0, xmm0
mov ecx, dword [esp + 0x28]
movdqu xmmword [ecx + 0x20], xmm0
movdqu xmmword [ecx + 0x10], xmm0
movdqu xmmword [ecx], xmm0
mov dword [ecx + 0x30], 0
mov edx, 0xffffffec
test eax, eax
je 0x402c27
mov dword [esp + 4], ebx
xor ebp, ebp
xor esi, esi
nop
movzx ecx, byte [edi + esi]
cmp ecx, 0xb
ja 0x402c27
mov ebx, edi
mov edi, dword [esp + 0x28]
inc dword [edi + ecx*4]
movzx ecx, byte [ebx + esi]
mov edi, 1
shl edi, cl
sar edi, 1
add ebp, edi
mov edi, ebx
inc esi
cmp eax, esi
jne 0x402b70
lea ecx, [ebp - 0x1000]
cmp ecx, 0xfffff001
jb 0x402c27
bsr ecx, ebp
xor ecx, 0xffffffe0
add ecx, 0x21
mov esi, 1
shl esi, cl
mov edi, esi
sub edi, ebp
bsr edi, edi
sub esi, ebp
mov ebp, dword [esp + 0x30]
mov dword [ebp], ecx
mov ecx, 0
cmovne ecx, edi
mov edi, ecx
mov ebp, 1
shl ebp, cl
cmp ebp, esi
jne 0x402c27
lea ecx, [edi + 1]
mov byte [ebx + eax], cl
mov ecx, dword [esp + 0x28]
inc dword [ecx + edi*4 + 4]
mov ecx, dword [ecx + 4]
cmp ecx, 2
jb 0x402c27
and ecx, 1
mov ecx, dword [esp + 4]
jne 0x402c27
inc eax
mov edx, dword [esp + 0x2c]
mov dword [edx], eax
inc ecx
mov edx, ecx
jmp 0x402c27
pxor xmm0, xmm0
mov eax, dword [esp + 0x28]
movdqu xmmword [eax + 0x20], xmm0
movdqu xmmword [eax + 0x10], xmm0
movdqu xmmword [eax], xmm0
mov dword [eax + 0x30], 0
mov eax, edx
add esp, 0xc
pop esi
pop edi
pop ebx
pop ebp
ret