Function at 0x523913
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x30
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
push ebx
push ebp
lea eax, [eax + edx*2]
add eax, 2
mov dword [esp + 0x1c], eax
lea eax, [edx + 1]
mov dword [esp + 0x10], eax
xor eax, eax
push esi
push edi
xor edi, edi
xor esi, esi
lea ebp, [eax + 1]
shl ebp, cl
mov dword [esp + 0x10], ebp
lea edx, [edi + ecx]
xor ecx, ecx
lea eax, [ebp - 1]
mov ebp, dword [esp + 0x4c]
mov dword [esp + 0x14], eax
mov ebx, eax
xor eax, eax
bts eax, edx
cmp edx, 0x20
cmovae ecx, eax
xor eax, ecx
cmp edx, 0x40
lea edx, [ebp*2 + 2]
mov ebp, dword [esp + 0x10]
cmovae ecx, eax
add edx, eax
adc esi, ecx
add edx, 8
adc esi, edi
cmp esi, edi
ja 0x523c27
jb 0x523993
cmp edx, dword [esp + 0x58]
ja 0x523c27
cmp dword [esp + 0x4c], 0xff
ja 0x523c27
mov eax, dword [esp + 0x50]
cmp eax, 0xc
jbe 0x5239b1
push 0xffffffffffffffd4
jmp 0x523c29
mov esi, dword [esp + 0x4c]
lea ecx, [eax - 1]
xor edx, edx
mov word [esp + 0x58], ax
inc edx
mov eax, edx
mov word [esp + 0x5a], dx
shl ax, cl
mov edx, edi
movzx eax, ax
mov dword [esp + 0x20], eax
add esi, 1
je 0x523a35
mov ebp, dword [esp + 0x44]
mov edi, dword [esp + 0x48]
add ebp, 6
mov eax, dword [esp + 0x54]
sub edi, eax
lea ebp, [ebp + ebx*4]
movzx ecx, word [eax + edi]
mov esi, ecx
mov dword [esp + 0x1c], esi
or esi, 0xffffffff
cmp cx, si
jne 0x523a0b
mov byte [ebp], dl
xor ecx, ecx
dec ebx
sub ebp, 4
inc ecx
jmp 0x523a20
cmp cx, word [esp + 0x20]
jl 0x523a19
xor ecx, ecx
mov word [esp + 0x5a], cx
mov ecx, dword [esp + 0x1c]
movzx ecx, cx
mov esi, dword [esp + 0x18]
inc edx
mov word [eax], cx
add eax, 2
cmp edx, esi
jb 0x5239ed
mov ebp, dword [esp + 0x10]
xor edi, edi
push 4
lea eax, [esp + 0x5c]
push eax
push dword [esp + 0x4c]
call fcn.005282a0
mov ecx, ebp
mov eax, ebp
shr ecx, 3
add esp, 0xc
add ecx, 3
shr eax, 1
add eax, ecx
lea ecx, [ebp - 1]
mov dword [esp + 0x58], eax
cmp ebx, ecx
jne 0x523b88
mov ecx, dword [esp + 0x4c]
mov eax, edi
mov dword [esp + 0x1c], eax
xorps xmm0, xmm0
movlpd qword [esp + 0x28], xmm0
mov esi, edi
mov dword [esp + 0x20], edi
add ecx, 1
je 0x523b20
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x28]
mov ecx, dword [esp + 0x48]
add eax, dword [esp + 0x24]
push 8
mov dword [esp + 0x34], ebp
movsx ecx, word [ecx + esi*2]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x34]
push ecx
push eax
mov dword [esp + 0x40], ebx
mov dword [esp + 0x34], eax
call fcn.005282a0
mov ecx, dword [esp + 0x24]
add esp, 0xc
push 8
pop edi
cmp ecx, edi
jle 0x523af5
mov esi, ecx
push 8
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], ebp
push eax
mov eax, dword [esp + 0x30]
add eax, edi
mov dword [esp + 0x44], ebx
push eax
call fcn.005282a0
add edi, 8
add esp, 0xc
cmp edi, esi
jl 0x523ac8
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
add eax, ecx
mov ecx, 0x1010101
inc esi
mov dword [esp + 0x1c], eax
add ebp, ecx
mov dword [esp + 0x20], esi
adc ebx, ecx
mov ecx, dword [esp + 0x4c]
inc ecx
cmp esi, ecx
jb 0x523a8f
mov ebp, dword [esp + 0x10]
xor edi, edi
mov dword [esp + 0x4c], edi
mov esi, edi
mov dword [esp + 0x20], esi
mov edx, edi
test ebp, ebp
je 0x523c23
mov eax, dword [esp + 0x24]
mov ebp, edx
mov edx, dword [esp + 0x14]
add eax, esi
mov ebx, edi
mov dword [esp + 0x28], eax
mov esi, eax
mov edi, dword [esp + 0x44]
mov ecx, ebp
mov al, byte [ebx + esi]
and ecx, edx
inc ebx
mov byte [edi + ecx*4 + 6], al
mov edi, dword [esp + 0x58]
add ebp, edi
cmp ebx, 2
jb 0x523b48
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x20]
add esi, 2
push 0
lea edx, [edx + edi*2]
mov dword [esp + 0x24], esi
and edx, dword [esp + 0x18]
mov dword [esp + 0x50], edx
pop edi
cmp esi, dword [esp + 0x10]
jb 0x523b34
jmp 0x523be1
mov ecx, edi
mov edx, edi
test esi, esi
je 0x523bdd
mov ebp, dword [esp + 0x48]
xor eax, eax
mov esi, edi
cmp ax, word [ebp]
mov eax, dword [esp + 0x58]
jge 0x523bc3
mov edi, dword [esp + 0x44]
mov byte [edi + ecx*4 + 6], dl
add ecx, eax
and ecx, dword [esp + 0x14]
cmp ecx, ebx
ja 0x523baa
movsx eax, word [ebp]
inc esi
cmp esi, eax
mov eax, dword [esp + 0x58]
jl 0x523ba6
xor edi, edi
mov esi, dword [esp + 0x4c]
inc edx
inc esi
add ebp, 2
cmp edx, esi
jb 0x523b94
mov ebp, dword [esp + 0x10]
test ecx, ecx
je 0x523bdd
or eax, 0xffffffff
jmp 0x523c2a
test ebp, ebp
je 0x523c23
mov ebx, dword [esp + 0x44]
add ebx, 7
movzx edx, byte [ebx - 1]
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x54]
movzx esi, word [eax + edx*2]
mov ecx, esi
lea eax, [esi + 1]
mov word [ebp + edx*2], ax
mov ebp, dword [esp + 0x10]
bsr eax, ecx
mov cl, byte [esp + 0x50]
sub cl, al
shl si, cl
sub si, bp
mov byte [ebx], cl
inc edi
mov word [ebx - 3], si
lea ebx, [ebx + 4]
cmp edi, ebp
jb 0x523be8
xor eax, eax
jmp 0x523c2a
push 0xffffffffffffffd2
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret