Function at 0x1004c2b0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
push esi
mov esi, edx
mov dword [ebp - 8], ecx
mov dword [ebp - 0x14], esi
push edi
test esi, esi
jne 0x1004c36f
mov esi, 0xb
mov dword [ebp - 0x14], esi
mov edx, dword [ebp + 0xc]
mov ecx, 0x1f
bsr eax, edx
sub ecx, eax
mov eax, 0x1f
sub eax, ecx
lea ecx, [eax + 1]
mov eax, dword [ebp + 0x10]
bsr eax, eax
add eax, 2
cmp ecx, eax
cmovb eax, ecx
cmp esi, eax
jb 0x1004c4db
xor eax, eax
mov ebx, 0x3e
cmp dword [ebp + 0x14], eax
push 0
sete al
sub ebx, esi
push edx
push 0x40000000
push 0
lea eax, [eax*2 - 1]
mov dword [ebp - 0x18], ebx
movzx eax, ax
mov dword [ebp - 0x20], eax
call fcn.10072010
mov dword [ebp - 0x2c], eax
lea ecx, [ebx - 0x14]
xor eax, eax
mov dword [ebp - 0x28], edx
xor edx, edx
bts eax, ecx
cmp ecx, 0x20
mov edi, 1
cmovae edx, eax
xor eax, edx
cmp ecx, 0x40
mov ecx, esi
mov dword [ebp - 0x34], eax
cmovae edx, eax
shl edi, cl
mov dword [ebp - 0x30], edx
xor eax, eax
mov edx, dword [ebp + 0xc]
xor ebx, ebx
shr edx, cl
xor esi, esi
mov dword [ebp - 4], edi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x24], edx
jmp 0x1004c393
cmp esi, 5
jb 0x1004c4db
cmp esi, 0xc
jbe 0x1004c2d1
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x24]
movzx ecx, ax
movzx eax, ax
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x3c], ebx
mov ecx, dword [eax + esi*4]
cmp ecx, dword [ebp + 0xc]
je 0x1004c4d2
test ecx, ecx
jne 0x1004c3bc
xor edi, edi
jmp 0x1004c466
cmp ecx, edx
ja 0x1004c3cf
mov ecx, dword [ebp - 0x20]
dec edi
mov dword [ebp - 4], edi
movzx edi, cx
jmp 0x1004c466
mov eax, dword [ebp - 0x28]
mul ecx
mov ebx, eax
mov eax, dword [ebp - 0x2c]
mul ecx
mov ecx, dword [ebp - 0x18]
add ebx, edx
mov dword [ebp - 0x10], eax
mov edx, ebx
mov dword [ebp - 0xc], ebx
call fcn.100950f0
movzx ebx, ax
cmp bx, 8
jge 0x1004c439
mov ecx, dword [ebp - 0x18]
movsx edi, bx
mov eax, edi
cdq
call fcn.100950d0
sub dword [ebp - 0x10], eax
mov ecx, dword [edi*4 + 0x100a2d98]
sbb dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x30]
mul ecx
mov edi, eax
mov eax, dword [ebp - 0x34]
mul ecx
add edi, edx
cmp dword [ebp - 0xc], edi
jb 0x1004c432
ja 0x1004c42b
cmp dword [ebp - 0x10], eax
jbe 0x1004c432
mov eax, 1
jmp 0x1004c434
xor eax, eax
mov edi, dword [ebp - 4]
add ebx, eax
movsx eax, bx
sub edi, eax
movzx edx, bx
cmp dx, word [ebp - 0x38]
mov ecx, edx
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 4], edi
movzx edi, bx
mov ebx, esi
cmovle ebx, dword [ebp - 0x3c]
cmp dx, word [ebp - 0x1c]
movzx eax, ax
cmovle ecx, eax
movzx eax, cx
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 8]
mov ecx, esi
mov eax, edx
inc esi
mov word [eax + ecx*2], di
mov edi, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
cmp esi, dword [ebp + 0x10]
jbe 0x1004c390
movzx edi, word [edx + ebx*2]
lea esi, [edx + ebx*2]
mov edx, dword [ebp - 4]
mov eax, edx
movsx ecx, di
neg eax
sar ecx, 1
cmp eax, ecx
jl 0x1004c4c0
push dword [ebp - 0x20]
mov esi, dword [ebp - 0x14]
mov edx, esi
push dword [ebp + 0x10]
mov ecx, dword [ebp - 8]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.1004c050
add esp, 0x10
cmp eax, 0xffffff88
jbe 0x1004c4c9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [edi + edx]
mov word [esi], ax
mov esi, dword [ebp - 0x14]
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret