Function at 0x5225a0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], edx
mov edx, dword [ecx + 0x1c]
mov dword [esp + 0x18], edx
test edx, edx
je 0x522810
mov esi, edx
add esi, esi
mov edx, dword [esp + 0x24]
cmp esi, dword [edx + 8]
jg 0x522830
mov eax, dword [ecx + 0x24]
mov edx, dword [esp + 0x24]
xor dword [edx + 0xc], eax
mov edx, dword [ecx + 0x18]
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x24]
mov ebx, dword [edx]
mov eax, dword [edx + 4]
cmp esi, eax
jle 0x52260d
lea eax, [ebx + eax*4]
lea edx, [ebx + esi*4]
lea esi, [esi]
lea edi, [edi]
mov dword [eax], 0
add eax, 4
cmp eax, edx
jne 0x522600
mov edx, dword [esp + 0x24]
mov dword [edx + 4], esi
mov ecx, dword [ecx + 0x40]
mov dword [esp + 0x20], ecx
mov esi, dword [esp + 0x18]
test esi, esi
jle 0x522880
mov ebp, dword [esp + 0x18]
shl ebp, 2
xor edi, edi
xor esi, esi
lea esi, [esi]
lea edi, [edi]
mov eax, dword [esp + 0x20]
imul eax, dword [ebx]
mov dword [esp + 0xc], eax
mov ecx, dword [esp + 0x18]
mov dword [esp + 8], ecx
mov edx, dword [esp + 0x1c]
mov dword [esp + 4], edx
mov dword [esp], ebx
call fcn.00538630
add eax, esi
mov edx, dword [ebx + ebp]
add eax, edx
cmp edx, eax
setne cl
and ecx, 0xff
or esi, ecx
cmp edx, eax
setae dl
and edx, 0xff
and esi, edx
mov dword [ebx + ebp], eax
inc edi
add ebx, 4
cmp edi, dword [esp + 0x18]
jne 0x522640
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
cmp edx, dword [eax + 8]
jg 0x522860
mov dword [eax + 4], edx
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 0xc]
mov ecx, dword [esp + 0x28]
mov dword [ecx + 0xc], eax
mov ebx, dword [ecx]
mov edx, dword [esp + 0x18]
shl edx, 2
mov dword [esp + 0x2c], edx
mov edi, edx
mov edx, dword [esp + 0x24]
add edi, dword [edx]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0xc], ecx
mov edx, dword [esp + 0x1c]
mov dword [esp + 8], edx
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.00538d70
sub esi, eax
mov edx, esi
not edx
and edx, ebx
and esi, edi
or edx, esi
mov ecx, dword [esp + 0x18]
sub ecx, 4
mov dword [esp + 0x20], ecx
xor eax, eax
test ecx, ecx
jle 0x52276f
jmp 0x522710
mov ebp, dword [edx + eax*4]
mov esi, dword [edx + eax*4 + 4]
mov ecx, dword [edx + eax*4 + 8]
mov dword [esp + 0x1c], ecx
mov dword [edi + eax*4], 0
mov ecx, dword [edx + eax*4 + 0xc]
mov dword [edi + eax*4 + 4], 0
mov dword [ebx + eax*4], ebp
mov dword [edi + eax*4 + 8], 0
mov dword [ebx + eax*4 + 4], esi
mov dword [edi + eax*4 + 0xc], 0
mov esi, dword [esp + 0x1c]
mov dword [ebx + eax*4 + 8], esi
mov dword [ebx + eax*4 + 0xc], ecx
add eax, 4
cmp dword [esp + 0x20], eax
jg 0x522710
mov eax, dword [esp + 0x18]
sub eax, 5
shr eax, 2
lea eax, [eax*4 + 4]
cmp dword [esp + 0x18], eax
jle 0x5227a3
lea eax, [edx + eax*4]
mov ecx, dword [esp + 0x2c]
add ecx, edx
neg edx
add ebx, edx
add edx, edi
lea esi, [esi]
lea edi, [edi]
mov esi, dword [eax]
mov dword [ebx + eax], esi
mov dword [edx + eax], 0
add eax, 4
cmp eax, ecx
jne 0x522790
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
test eax, eax
jle 0x5227d1
mov edx, dword [edx]
sub edx, 4
lea esi, [esi]
lea edi, [edi]
mov ebx, dword [edx + eax*4]
test ebx, ebx
jne 0x5227ca
dec eax
jne 0x5227c0
mov edx, dword [esp + 0x24]
mov dword [edx + 4], eax
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + 4]
test eax, eax
jle 0x522887
mov edx, dword [ecx]
sub edx, 4
lea esi, [esi]
lea edi, [edi]
mov ecx, dword [edx + eax*4]
test ecx, ecx
jne 0x5227fa
dec eax
jne 0x5227f0
mov esi, dword [esp + 0x28]
mov dword [esi + 4], eax
mov eax, 1
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [eax + 4], 0
mov eax, 1
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], esi
mov dword [esp], edx
mov dword [esp + 0x14], ecx
call fcn.00530d00
test eax, eax
mov ecx, dword [esp + 0x14]
jne 0x5225cf
xor eax, eax
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00530d00
test eax, eax
je 0x52284c
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
jmp 0x5226a2
xor esi, esi
jmp 0x522691
mov eax, 1
jmp 0x52281c