Java Code Examples for ghidra.program.model.data.DataType#setCategoryPath()

The following examples show how to use ghidra.program.model.data.DataType#setCategoryPath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CliAbstractStream.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Does basic markup that all streams will want:
 * <ul>
 *   <li>Set monitor message</li>
 *   <li>Validate addresses</li>
 *   <li>Add bookmark</li>
 *   <li>Add symbol</li>
 *   <li>Create data type</li>
 * </ul>
 * Subclass should first call this and then provide any custom markup they need. 
 */
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
		NTHeader ntHeader) throws DuplicateNameException, IOException {

	monitor.setMessage("[" + program.getName() + "]: CLI stream...");
	Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, rva);

	program.getBookmarkManager().setBookmark(addr, BookmarkType.INFO, "CLI Stream",
		header.getName());

	try {
		program.getSymbolTable().createLabel(addr, "CLI_Stream_" + header.getName(),
			SourceType.ANALYSIS);
	}
	catch (InvalidInputException e) {
		Msg.error(this, "Error marking up CLI stream \"" + header.getName() + "\"", e);
		return;
	}

	if (!program.getMemory().contains(addr)) {
		return;
	}

	DataType dt = this.toDataType();
	dt.setCategoryPath(new CategoryPath(PATH));
	PeUtils.createData(program, addr, dt, log);
}
 
Example 2
Source File: TypeItem.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( TypeItem.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}
 
Example 3
Source File: TypeIDItem.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( TypeIDItem.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}
 
Example 4
Source File: FieldIDItem.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( FieldIDItem.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}
 
Example 5
Source File: MapItem.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( MapItem.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}
 
Example 6
Source File: FieldAnnotation.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( FieldAnnotation.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}
 
Example 7
Source File: ClassDefItem.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( ClassDefItem.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}
 
Example 8
Source File: MethodIDItem.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public DataType toDataType( ) throws DuplicateNameException, IOException {
	DataType dataType = StructConverterUtil.toDataType( MethodIDItem.class );
	dataType.setCategoryPath( new CategoryPath( "/dex" ) );
	return dataType;
}