Skip the two bytes that indicate the packet length for variable-length packets when searching for \xff, otherwise run into issues when the two bytes for the length include \xff.