@Override
	public DataType toDataType() throws DuplicateNameException, IOException {
		StructureDataType struct = new StructureDataType("CS_CodeDirectory", 0);
		struct.add(DWORD, "magic", "magic number (CSMAGIC_CODEDIRECTORY)");
		struct.add(DWORD, "length", "total length of CodeDirectory blob");
		struct.add(DWORD, "version", "compatibility version");
		struct.add(DWORD, "flags", "setup and mode flags");
		struct.add(DWORD, "hashOffset", "offset of hash slot element at index zero");
		struct.add(DWORD, "identOffset", "offset of identifier string");
		struct.add(DWORD, "nSpecialSlots", "number of special hash slots");
		struct.add(DWORD, "nCodeSlots", "number of ordinary (code) hash slots");
		struct.add(DWORD, "codeLimit", "limit to main image signature range");
		struct.add(BYTE, "hashSize", "size of each hash in bytes");
		struct.add(BYTE, "hashType", "type of hash (cdHashType* constants)");
		struct.add(BYTE, "platform", "platform identifier; zero if not platform binary");
		struct.add(BYTE, "pageSize", "log2(page size in bytes); 0 => infinite");
		struct.add(DWORD, "spare2", "unused (must be zero)");
		if (version >= 0x20100) {
			struct.add(DWORD, "scatterOffset", "offset of optional scatter vector");
		}
		if (version >= 0x20200) {
			struct.add(DWORD, "teamOffset", "offset of optional team identifier");
		}
		if (version >= 0x20300) {
			struct.add(DWORD, "spare3", "unused (must be zero)");
			struct.add(QWORD, "codeLimit64", "limit to main image signature range, 64 bits");
		}
		if (version >= 0x20400) {
			struct.add(QWORD, "execSegBase", "offset of executable segment");
			struct.add(QWORD, "execSegLimit", "limit of executable segment");
			struct.add(QWORD, "execSegFlags", "executable segment flags");
		}
		if (version >= 0x20500) {
			struct.add(DWORD, "runtime", "");
			struct.add(DWORD, "preEncryptOffset", "");
		}
		if (version >= 0x20600) {
			struct.add(BYTE, "linkageHashType", "");
			struct.add(BYTE, "linkageHashApplicationType", "");
			struct.add(WORD, "linkageApplicationSubType", "");
			struct.add(DWORD, "linkageOffset", "");
			struct.add(DWORD, "linkageSize", "");
		}
		struct.setCategoryPath(new CategoryPath(MachConstants.DATA_TYPE_CATEGORY));
		return struct;
	}
Creates a new {@link CodeSignatureCodeDirectory}

@param reader A {@link BinaryReader} positioned at the start of the structure
@throws IOException if there was an IO-related problem creating the structure
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/commands/codesignature/CodeSignatureCodeDirectory.java