Function at 0x40cdbb
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edx, dword [eax + 4]
mov edi, ecx
test edx, edx
je 0x40cddd
mov ecx, dword [eax + 8]
sub ecx, edx
sar ecx, 4
mov dword [ebp - 8], ecx
jne 0x40cde5
xor eax, eax
inc eax
jmp 0x40d035
mov esi, ecx
push 0x64
shl esi, 3
mov eax, esi
xor edx, edx
pop ebx
div ebx
cmp dword [edi + 0x464], esi
lea eax, [eax + esi + 8]
mov dword [ebp - 4], eax
jae 0x40ce4a
mov eax, dword [edi + 0x460]
test eax, eax
je 0x40ce1d
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
and dword [edi + 0x460], 0
pop ecx
mov ecx, dword [ebp - 8]
mov eax, ecx
shl eax, 3
inc eax
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [edi + 0x460], eax
jne 0x40ce3b
xor eax, eax
jmp 0x40d035
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 8]
shl eax, 3
mov dword [edi + 0x464], eax
mov eax, dword [edi + 0x460]
mov ebx, 0xff
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov esi, dword [eax + 4]
cmp esi, dword [eax + 8]
je 0x40cf06
mov eax, dword [esi]
mov ecx, dword [edi + 0x43c]
sub eax, dword [edi + 4]
xor edx, edx
push 8
div ecx
mov edx, eax
shl edx, 8
shr eax, 8
xor al, dl
and ax, bx
xor eax, edx
xor edx, edx
mov word [ebp - 0x18], ax
mov eax, dword [esi + 4]
sub eax, dword [edi + 8]
div ecx
mov edx, eax
shl edx, 8
shr eax, 8
xor al, dl
and ax, bx
xor eax, edx
xor edx, edx
mov word [ebp - 0x16], ax
mov eax, dword [esi + 8]
sub eax, dword [esi]
div ecx
mov edx, eax
shl edx, 8
shr eax, 8
xor al, dl
and ax, bx
xor eax, edx
xor edx, edx
mov word [ebp - 0x14], ax
mov eax, dword [esi + 0xc]
sub eax, dword [esi + 4]
div ecx
mov ecx, eax
shl ecx, 8
shr eax, 8
xor al, cl
and ax, bx
xor eax, ecx
mov word [ebp - 0x12], ax
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xc]
call sub.MSVCRT.dll_memcpy
mov eax, dword [ebp + 8]
add dword [ebp - 0xc], 8
add esi, 0x10
add esp, 0xc
cmp esi, dword [eax + 8]
jne 0x40ce67
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 4]
cmp dword [edi + 0x45c], eax
jae 0x40cf4e
mov eax, dword [edi + 0x458]
test eax, eax
je 0x40cf29
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
and dword [edi + 0x458], 0
pop ecx
mov eax, dword [ebp - 4]
inc eax
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [edi + 0x458], eax
je 0x40ce34
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 8]
mov dword [edi + 0x45c], eax
mov eax, ecx
shl eax, 3
push eax
lea eax, [ebp - 4]
push dword [edi + 0x460]
push eax
push dword [edi + 0x458]
call fcn.0042208b
add esp, 0x10
test eax, eax
jne 0x40ce34
mov esi, dword [ebp - 8]
mov eax, esi
imul eax, eax, 0xe
push eax
push dword [ebp - 4]
push esi
push str.C:DATASCZ_SCwinvncwinvnc_vncclient.cpp_:__Sending_CacheZip_Rects_d_Size_d___d__r_n
push 9
push 0x4378c8
call fcn.004053a7
mov eax, esi
mov ecx, esi
shl eax, 8
sar ecx, 8
xor cl, al
add esp, 0x18
and cx, bx
mov dword [ebp - 0x1c], 0x700ffff
xor ecx, eax
xor eax, eax
mov word [ebp - 0x22], ax
mov word [ebp - 0x20], ax
mov word [ebp - 0x1e], ax
mov eax, dword [ebp - 4]
mov word [ebp - 0x24], cx
mov ecx, eax
mov edx, eax
and ecx, 0xff0000
shr edx, 0x10
or ecx, edx
mov edx, eax
and edx, 0xff00
push 0xc
shl eax, 0x10
or edx, eax
lea eax, [ebp - 0x24]
shr ecx, 8
shl edx, 8
or ecx, edx
push eax
mov dword [ebp - 0x10], ecx
mov ecx, dword [edi + 0xc8]
call fcn.0041e0b9
test eax, eax
je 0x40ce34
mov ecx, dword [edi + 0xc8]
lea eax, [ebp - 0x10]
push 4
push eax
call fcn.0041e0b9
test eax, eax
je 0x40ce34
push dword [ebp - 4]
mov ecx, dword [edi + 0xc8]
push dword [edi + 0x458]
call fcn.0041e0b9
neg eax
sbb eax, eax
neg eax
pop edi
pop esi
pop ebx
leave
ret 4