Function at 0x1004bed0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 8], edx
mov edx, dword [ebp + 0xc]
mov esi, 1
mov ecx, edx
mov dword [ebp - 0x18], edi
shl esi, cl
mov ecx, 1
lea eax, [edi + 4]
mov dword [ebp - 4], esi
mov dword [ebp - 0x28], eax
mov eax, esi
shr eax, 1
test edx, edx
lea ebx, [esi - 1]
cmove eax, ecx
mov dword [ebp - 0x10], ebx
mov ecx, esi
shr ecx, 1
add ecx, 3
lea eax, [edi + eax*4]
mov edi, ebx
mov dword [ebp - 0x2c], eax
mov eax, esi
shr eax, 3
xor esi, esi
add eax, ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
inc eax
mov dword [ebp - 0x1c], eax
lea eax, [ecx + eax*2]
xor ecx, ecx
mov dword [ebp - 0xc], eax
mov eax, edx
bts ecx, eax
xor edx, edx
cmp eax, 0x20
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
mov eax, dword [ebp + 8]
cmovae edx, ecx
add eax, 2
add eax, ecx
adc esi, edx
shrd eax, esi, 1
shr esi, 1
add eax, 2
adc esi, 0
shld esi, eax, 2
shl eax, 2
test esi, esi
jb 0x1004bf80
ja 0x1004bf74
cmp eax, dword [ebp + 0x14]
jbe 0x1004bf80
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
mov esi, dword [ebp + 8]
mov word [ecx], ax
inc esi
mov eax, dword [ebp + 0x10]
mov word [ecx + 2], dx
xor ecx, ecx
mov word [eax], cx
lea edx, [ecx + 1]
cmp esi, edx
jb 0x1004bfe3
mov ebx, dword [ebp - 8]
mov ecx, eax
sub ebx, eax
nop word [eax + eax]
movzx esi, word [ebx + ecx]
lea ecx, [ecx + 2]
movzx eax, word [ecx - 2]
cmp si, 0xffff
jne 0x1004bfd2
mov esi, dword [ebp - 0xc]
inc eax
mov word [ecx], ax
lea eax, [edx - 1]
mov byte [edi + esi + 2], al
dec edi
jmp 0x1004bfd7
add eax, esi
mov word [ecx], ax
mov esi, dword [ebp + 8]
inc edx
inc esi
cmp edx, esi
jbe 0x1004bfb0
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0xc]
movzx eax, cx
mov dword [ebp - 0x24], eax
inc eax
mov word [edx], ax
xor eax, eax
cmp edi, ebx
jne 0x1004c0c4
lea edi, [edx + 2]
xor esi, esi
mov edx, dword [ebp + 8]
add edi, ecx
mov dword [ebp + 0x14], edi
xorps xmm0, xmm0
mov dword [ebp - 0x18], esi
movlpd qword [ebp - 0x20], xmm0
add edx, 1
je 0x1004c07b
mov edx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x20]
mov ecx, dword [ebp - 8]
movsx ecx, word [ecx + eax*2]
mov dword [ebp - 0x1c], ecx
mov dword [esi + edi], ebx
mov dword [esi + edi + 4], edx
cmp ecx, 8
jle 0x1004c058
add edi, esi
add ecx, 0xfffffff7
shr ecx, 2
and ecx, 0x3ffffffe
mov dword [edi + 8], ebx
lea esi, [edi + 8]
mov dword [edi + 0xc], edx
add edi, 0x10
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp + 0x14]
add esi, ecx
mov ecx, dword [ebp + 8]
inc eax
add ebx, 0x1010101
mov dword [ebp - 0x18], esi
adc edx, 0x1010101
inc ecx
cmp eax, ecx
jb 0x1004c020
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
xor esi, esi
xor edi, edi
test ecx, ecx
je 0x1004c110
mov eax, dword [ebp + 0x14]
mov ecx, esi
mov edx, dword [ebp - 0xc]
and ecx, ebx
movzx eax, byte [edi + eax]
mov byte [ecx + edx + 2], al
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp + 0x14]
lea ecx, [esi + edx]
movzx eax, byte [edi + eax + 1]
lea esi, [esi + edx*2]
and ecx, ebx
add edi, 2
mov ebx, dword [ebp - 0xc]
mov byte [ecx + ebx + 2], al
mov ebx, dword [ebp - 0x10]
and esi, ebx
cmp edi, dword [ebp - 4]
jb 0x1004c087
xor esi, esi
jmp 0x1004c116
xor ecx, ecx
mov dword [ebp + 0x14], ecx
test esi, esi
je 0x1004c10d
nop dword [eax]
mov edx, dword [ebp - 8]
movsx edx, word [edx + ecx*2]
test edx, edx
jle 0x1004c105
mov esi, dword [ebp - 0xc]
nop
mov ecx, dword [ebp + 0x14]
mov byte [eax + esi + 2], cl
mov ecx, dword [ebp - 0x14]
add eax, ecx
and eax, ebx
cmp eax, edi
jbe 0x1004c0fa
add eax, ecx
and eax, ebx
cmp eax, edi
ja 0x1004c0f2
sub edx, 1
jne 0x1004c0e0
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebp - 0x1c]
inc ecx
mov dword [ebp + 0x14], ecx
cmp ecx, esi
jb 0x1004c0d0
mov ecx, dword [ebp - 4]
xor esi, esi
test ecx, ecx
je 0x1004c143
mov edi, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x28]
nop dword [eax]
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp + 0x10]
movzx eax, byte [esi + eax + 2]
lea edx, [ecx + eax*2]
movzx eax, word [edx]
lea ecx, [edi + esi]
inc esi
mov word [ebx + eax*2], cx
inc word [edx]
mov ecx, dword [ebp - 4]
cmp esi, ecx
jb 0x1004c120
mov esi, dword [ebp - 0x2c]
xor edi, edi
mov edx, dword [ebp - 8]
xor ebx, ebx
add esi, 8
movsx edx, word [edx + ebx*2]
cmp edx, 0xffffffff
je 0x1004c19c
test edx, edx
je 0x1004c18f
cmp edx, 1
je 0x1004c19c
mov ecx, dword [ebp + 0xc]
lea eax, [edx - 1]
bsr eax, eax
sub ecx, eax
shl edx, cl
shl ecx, 0x10
sub ecx, edx
mov edx, dword [ebp - 8]
mov dword [esi], ecx
mov ecx, edi
movsx eax, word [edx + ebx*2]
sub ecx, eax
mov dword [esi - 4], ecx
movsx eax, word [edx + ebx*2]
mov ecx, dword [ebp - 4]
add edi, eax
jmp 0x1004c1b0
mov eax, dword [ebp + 0xc]
inc eax
shl eax, 0x10
sub eax, ecx
mov dword [esi], eax
jmp 0x1004c1ad
mov eax, dword [ebp + 0xc]
shl eax, 0x10
sub eax, ecx
mov dword [esi], eax
lea eax, [edi - 1]
mov dword [esi - 4], eax
inc edi
mov edx, dword [ebp - 8]
inc ebx
add esi, 8
cmp ebx, dword [ebp + 8]
jbe 0x1004c150
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret