public static Sequence findPascalSequence(MemBuffer buf, Sequence sequence, int alignment) {
		DataType stringDataType = sequence.getStringDataType();
		if ((stringDataType instanceof PascalUnicodeDataType) ||
			(stringDataType instanceof UnicodeDataType)) {
			return findUnicodePascal(buf, sequence);
		}
		if ((stringDataType instanceof PascalStringDataType) ||
			(stringDataType instanceof PascalString255DataType) ||
			(stringDataType instanceof StringDataType)) {
			return findAsciiPascal(buf, sequence, alignment);
		}
		return null;
	}
Looks for Pascal strings given a sequence of bytes that represent a sequence of ascii chars.
@param buf the Memory buffer containing the bytes that make up the string.
@param sequence the sequence that specifies the start, end, and type of ascii sequence (i.e. ascii,
unicode16).  This method looks for both 2 byte and 1 byte leading pascal lengths both before
and at the beginning of the given sequence.

@return a new sequence that has been adjusted  to represent a pascal string or null if
a pascal string was not found.
Ghidra/Features/Base/src/main/java/ghidra/program/util/string/PascalUtil.java