Function at 0x547120
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x1c
mov eax, dword [esp + 0x28]
mov edx, 1
mov ecx, dword [esp + 0x30]
push ebx
push ebp
lea ebp, [eax*2 + 2]
lea ecx, [ecx + eax*2]
add ecx, 2
mov dword [esp + 0x14], ecx
lea ecx, [eax + 1]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x34]
mov eax, ecx
shl edx, cl
xor ecx, ecx
bts ecx, eax
mov dword [esp + 0x10], edx
push esi
xor esi, esi
lea ebx, [edx - 1]
xor edx, edx
cmp eax, 0x20
mov dword [esp + 0x10], ebx
push edi
cmovae edx, ecx
mov edi, ebx
xor ecx, edx
cmp eax, 0x40
cmovae edx, ecx
add ebp, ecx
adc esi, edx
add ebp, 8
adc esi, 0
test esi, esi
jb 0x54719b
ja 0x54718e
cmp ebp, dword [esp + 0x44]
jbe 0x54719b
pop edi
pop esi
pop ebp
mov eax, 0xffffffd2
pop ebx
add esp, 0x1c
ret
cmp dword [esp + 0x38], 0xff
ja 0x54718e
mov eax, dword [esp + 0x3c]
cmp eax, 0xc
jbe 0x5471bb
pop edi
pop esi
pop ebp
mov eax, 0xffffffd4
pop ebx
add esp, 0x1c
ret
mov esi, dword [esp + 0x10]
lea ecx, [eax - 1]
mov ebp, dword [esp + 0x34]
mov edx, 1
mov word [esp + 0x38], ax
mov eax, edx
shl ax, cl
mov word [esp + 0x3a], dx
xor edx, edx
movzx eax, ax
mov dword [esp + 0x20], eax
test esi, esi
je 0x547240
mov esi, dword [esp + 0x30]
mov eax, ebp
mov ecx, dword [esp + 0x40]
add esi, 6
mov ebx, dword [esp + 0x10]
sub ecx, ebp
mov ebp, ecx
lea esi, [esi + edi*4]
nop
movzx ecx, word [eax]
cmp cx, 0xffff
jne 0x547216
mov byte [esi], dl
dec edi
sub esi, 4
mov ecx, 1
jmp 0x547228
cmp cx, word [esp + 0x20]
jl 0x547228
xor ebx, ebx
mov word [esp + 0x3a], bx
mov ebx, dword [esp + 0x10]
mov word [eax + ebp], cx
inc edx
add eax, 2
cmp edx, ebx
jb 0x547200
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x34]
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x38]
mov dword [ecx], eax
mov eax, dword [esp + 0x18]
mov ecx, eax
shr ecx, 3
shr eax, 1
cmp edi, ebx
jne 0x547380
add eax, 3
xor esi, esi
add eax, ecx
mov dword [esp + 0x38], esi
mov dword [esp + 0x20], eax
xorps xmm0, xmm0
xor eax, eax
movlpd qword [esp + 0x24], xmm0
cmp dword [esp + 0x10], eax
jbe 0x5472dd
mov edx, dword [esp + 0x28]
mov ebx, dword [esp + 0x24]
mov edi, dword [esp + 0x1c]
movsx ecx, word [ebp + eax*2]
add edi, esi
mov dword [esp + 0x44], ecx
mov dword [edi], ebx
mov dword [edi + 4], edx
cmp ecx, 8
jle 0x5472c0
add ecx, 0xfffffff7
mov dword [edi + 8], ebx
shr ecx, 2
lea esi, [edi + 8]
and ecx, 0x3ffffffe
mov dword [edi + 0xc], edx
add edi, 0x10
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x38]
add esi, ecx
inc eax
add ebx, 0x1010101
mov dword [esp + 0x38], esi
adc edx, 0x1010101
cmp eax, dword [esp + 0x10]
jb 0x547285
mov ebx, dword [esp + 0x14]
xor edx, edx
cmp dword [esp + 0x18], edx
jbe 0x54732c
mov esi, dword [esp + 0x1c]
mov edi, ebx
mov ebp, dword [esp + 0x20]
inc esi
shr edi, 1
inc edi
mov dword [esp + 0x38], edi
nop word [eax + eax]
mov edi, dword [esp + 0x30]
lea esi, [esi + 2]
movzx eax, byte [esi - 3]
mov ecx, edx
and ecx, ebx
mov byte [edi + ecx*4 + 6], al
lea ecx, [edx + ebp]
movzx eax, byte [esi - 2]
lea edx, [edx + ebp*2]
and ecx, ebx
and edx, ebx
sub dword [esp + 0x38], 1
mov byte [edi + ecx*4 + 6], al
jne 0x547300
mov ebx, dword [esp + 0x18]
test ebx, ebx
je 0x547376
mov esi, dword [esp + 0x30]
mov edi, ebx
add esi, 7
nop dword [eax]
movzx eax, byte [esi - 1]
lea esi, [esi + 4]
mov ecx, dword [esp + 0x40]
lea ecx, [ecx + eax*2]
movzx eax, word [ecx]
mov edx, eax
inc eax
mov word [ecx], ax
mov cl, byte [esp + 0x3c]
bsr eax, edx
sub cl, al
mov dword [esp + 0x30], eax
shl dx, cl
sub dx, bx
mov byte [esi - 4], cl
mov word [esi - 7], dx
sub edi, 1
jne 0x547340
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
lea edx, [eax + 3]
xor eax, eax
add edx, ecx
xor ecx, ecx
mov dword [esp + 0x38], ecx
test esi, esi
je 0x54732c
xor ebx, ebx
xor esi, esi
cmp bx, word [ebp]
jge 0x5473c9
nop dword [eax + eax]
mov ebx, dword [esp + 0x30]
mov byte [ebx + eax*4 + 6], cl
add eax, edx
mov ebx, dword [esp + 0x14]
and eax, ebx
cmp eax, edi
jbe 0x5473bc
add eax, edx
and eax, ebx
cmp eax, edi
ja 0x5473b4
movsx ecx, word [ebp]
inc esi
cmp esi, ecx
mov ecx, dword [esp + 0x38]
jl 0x5473a0
inc ecx
add ebp, 2
mov dword [esp + 0x38], ecx
cmp ecx, dword [esp + 0x10]
jb 0x547391
test eax, eax
je 0x54732c
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x1c
ret