Java Code Examples for ghidra.framework.options.Options#restoreDefaultValue()

The following examples show how to use ghidra.framework.options.Options#restoreDefaultValue() . 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: GhidraScript.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Reset all analysis options to their default values.
 *
 * @param program  the program for which all analysis options should be reset
 */
public void resetAllAnalysisOptions(Program program) {
	Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);

	for (String propertyName : options.getOptionNames()) {
		options.restoreDefaultValue(propertyName);
	}
}
 
Example 2
Source File: GhidraScript.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Resets a specified list of analysis options to their default values.
 *
 * @param program  the program for which the specific analysis options should be reset
 * @param analysisOptions  the specified analysis options to reset (invalid options
 * 			will be ignored)
 */
public void resetAnalysisOptions(Program program, List<String> analysisOptions) {
	Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);

	for (String analysisOption : analysisOptions) {
		options.restoreDefaultValue(analysisOption);
	}
}
 
Example 3
Source File: AutoAnalysisManager.java    From ghidra with Apache License 2.0 5 votes vote down vote up
public void restoreDefaultOptions() {
	boolean commit = false;
	int id = program.startTransaction("Restore Default Analysis Options");
	try {
		Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);
		for (String propertyName : options.getOptionNames()) {
			options.restoreDefaultValue(propertyName);
		}

		commit = true;
	}
	finally {
		program.endTransaction(id, commit);
	}
}
 
Example 4
Source File: GhidraScript.java    From ghidra with Apache License 2.0 2 votes vote down vote up
/**
 * Reset one analysis option to its default value.
 *
 * @param program  the program for which the specified analysis options should be reset
 * @param analysisOption  the specified analysis option to reset (invalid options will be
 * 		  	ignored)
 */
public void resetAnalysisOption(Program program, String analysisOption) {
	Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);
	options.restoreDefaultValue(analysisOption);
}