Function at 0x438330
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x4f5568]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov ebx, dword [eax + 4]
mov esi, ecx
sub ebx, dword [eax]
sar ebx, 4
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x2c], ebx
test ebx, ebx
jne 0x438370
lea eax, [ebx + 1]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004aca59
mov esp, ebp
pop ebp
ret 4
lea edi, [ebx*8]
mov eax, 0x51eb851f
mul edi
lea eax, [edi + 8]
shr edx, 5
add eax, edx
mov dword [ebp - 0x18], eax
cmp dword [esi + 0x530], edi
jae 0x4383ce
mov eax, dword [esi + 0x52c]
test eax, eax
je 0x4383ae
push eax
call fcn.004ad334
add esp, 4
mov dword [esi + 0x52c], 0
lea eax, [edi + 1]
push eax
call fcn.004aca50
add esp, 4
mov dword [esi + 0x52c], eax
test eax, eax
je 0x438626
mov dword [esi + 0x530], edi
mov eax, dword [esi + 0x52c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax]
cmp ecx, dword [eax + 4]
je 0x43848f
mov eax, dword [ecx]
xor edx, edx
sub eax, dword [esi + 0x18]
div dword [esi + 0x518]
mov ebx, dword [esi + 0x518]
mov edx, eax
shl eax, 8
shr edx, 8
and edx, 0xff
or edx, eax
mov eax, dword [ecx + 4]
sub eax, dword [esi + 0x1c]
mov word [ebp - 0x28], dx
xor edx, edx
div dword [esi + 0x518]
mov edx, eax
shl eax, 8
shr edx, 8
and edx, 0xff
or edx, eax
mov eax, dword [ecx + 8]
sub eax, dword [ecx]
mov word [ebp - 0x26], dx
xor edx, edx
div ebx
mov edx, eax
shl eax, 8
shr edx, 8
and edx, 0xff
or edx, eax
mov eax, dword [ecx + 0xc]
sub eax, dword [ecx + 4]
add ecx, 0x10
mov word [ebp - 0x24], dx
xor edx, edx
div ebx
mov edx, eax
shl eax, 8
shr edx, 8
and edx, 0xff
or edx, eax
mov eax, dword [ebp - 0x28]
mov word [ebp - 0x22], dx
mov edx, dword [ebp - 0x20]
mov dword [edx], eax
mov eax, dword [ebp - 0x24]
mov dword [edx + 4], eax
add edx, 8
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], edx
cmp ecx, dword [eax + 4]
jne 0x4383e5
mov ebx, dword [ebp - 0x2c]
mov eax, dword [esi + 0x528]
cmp eax, dword [ebp - 0x18]
jae 0x4384db
mov eax, dword [esi + 0x524]
test eax, eax
je 0x4384b7
push eax
call fcn.004ad334
add esp, 4
mov dword [esi + 0x524], 0
mov eax, dword [ebp - 0x18]
inc eax
push eax
call fcn.004aca50
add esp, 4
mov dword [esi + 0x524], eax
test eax, eax
je 0x438626
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x528], eax
push edi
push dword [esi + 0x52c]
lea eax, [ebp - 0x18]
push eax
push dword [esi + 0x524]
call fcn.004a72a0
add esp, 0x10
test eax, eax
jne 0x438626
lea eax, [ebx*8]
sub eax, ebx
add eax, eax
push eax
push dword [ebp - 0x18]
push ebx
push str.vncclient.cpp_:__Sending_CacheZip_Rects_d_Size_d___d__r_n
push 9
push 0x4f6c50
call fcn.00414f90
mov ecx, dword [ebp - 0x18]
mov eax, ebx
mov edi, dword [esi + 0x10c]
mov edx, ecx
sar eax, 8
and edx, 0xff0000
and eax, 0xff
shl ebx, 8
or eax, ebx
mov dword [ebp - 0xc], 0x700ffff
mov word [ebp - 0x14], ax
add esp, 0x18
xor eax, eax
mov dword [ebp - 0x12], eax
mov word [ebp - 0xe], ax
mov eax, ecx
shr eax, 0x10
or edx, eax
mov eax, ecx
and eax, 0xff00
shl ecx, 0x10
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov dword [ebp - 0x34], edx
cmp dword [edi + 8], 0xffffffff
je 0x438626
cmp byte [edi + 0x18], 0
mov ebx, 0xc
je 0x4385cd
mov eax, dword [edi + 0x10]
cmp byte [eax + 0x21], 0
je 0x4385cd
cmp byte [edi + 0x68], 0
je 0x4385b0
mov ecx, dword [edi + 0x64]
add ecx, dword [edi + 0x6c]
movq xmm0, qword [ebp - 0x14]
movq qword [ecx], xmm0
mov eax, dword [ebp - 0xc]
mov dword [ecx + 8], eax
add dword [edi + 0x6c], ebx
jmp 0x4385e4
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
push 0xc
lea eax, [ebp - 0x14]
mov ecx, edi
push eax
call fcn.00473380
mov ebx, dword [ebp - 0x1c]
jmp 0x4385d0
lea eax, [ebp - 0x14]
push ebx
push eax
mov ecx, edi
call fcn.00472d30
xor ecx, ecx
cmp eax, ebx
sete cl
test ecx, ecx
je 0x438626
mov ecx, dword [esi + 0x10c]
lea eax, [ebp - 0x34]
push 4
push eax
call fcn.00472f50
test eax, eax
je 0x438626
push dword [ebp - 0x18]
mov ecx, dword [esi + 0x10c]
push dword [esi + 0x524]
call fcn.00472f50
neg eax
sbb eax, eax
neg eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004aca59
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004aca59
mov esp, ebp
pop ebp
ret 4