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

The following examples show how to use ghidra.framework.options.Options#setString() . 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: MachoProgramBuilder.java    From ghidra with Apache License 2.0 6 votes vote down vote up
private void processProgramDescription() {
	Options props = program.getOptions(Program.PROGRAM_INFO);
	props.setString("Mach-O File Type",
		MachHeaderFileTypes.getFileTypeName(machoHeader.getFileType()));
	props.setString("Mach-O File Type Description",
		MachHeaderFileTypes.getFileTypeDescription(machoHeader.getFileType()));
	List<String> flags = MachHeaderFlags.getFlags(machoHeader.getFlags());
	for (int i = 0; i < flags.size(); ++i) {
		props.setString("Mach-O Flag " + i, flags.get(i));
	}

	List<SubUmbrellaCommand> umbrellas = machoHeader.getLoadCommands(SubUmbrellaCommand.class);
	for (int i = 0; i < umbrellas.size(); ++i) {
		props.setString("Mach-O Sub-umbrella " + i,
			umbrellas.get(i).getSubUmbrellaFrameworkName().getString());
	}

	List<SubFrameworkCommand> frameworks =
		machoHeader.getLoadCommands(SubFrameworkCommand.class);
	for (int i = 0; i < frameworks.size(); ++i) {
		props.setString("Mach-O Sub-framework " + i,
			frameworks.get(i).getUmbrellaFrameworkName().getString());
	}
}
 
Example 2
Source File: MemSearchHexTest.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Test
public void testHighlightGroupSize() throws Exception {
	Options opt = tool.getOptions(GhidraOptions.CATEGORY_BROWSER_FIELDS);
	opt.setInt(BytesFieldFactory.BYTE_GROUP_SIZE_MSG, 3);
	opt.setString(BytesFieldFactory.DELIMITER_MSG, "#@#");

	setValueText("fd ff ff");
	pressSearchAllButton();

	waitForSearch("Search Memory - ", 1);

	Highlight[] h = getByteHighlights(addr(0x10035f8), "b930fd#@#ffff");
	assertEquals(1, h.length);
	assertEquals(4, h[0].getStart());
	assertEquals(12, h[0].getEnd());

}
 
Example 3
Source File: ImporterUtilities.java    From ghidra with Apache License 2.0 6 votes vote down vote up
/**
 * Ensure that a {@link Program}'s metadata includes its import origin.
 *
 * @param program imported {@link Program} to modify
 * @param fsrl {@link FSRL} of the import source.
 * @param monitor {@link TaskMonitor} to use when accessing filesystem stuff.
 * @throws CancelledException if user cancels
 * @throws IOException if IO error
 */
public static void setProgramProperties(Program program, FSRL fsrl, TaskMonitor monitor)
		throws CancelledException, IOException {

	Objects.requireNonNull(monitor);

	int id = program.startTransaction("setImportProperties");
	try {
		fsrl = FileSystemService.getInstance().getFullyQualifiedFSRL(fsrl, monitor);

		Options propertyList = program.getOptions(Program.PROGRAM_INFO);
		propertyList.setString(ProgramMappingService.PROGRAM_SOURCE_FSRL, fsrl.toString());
		String md5 = program.getExecutableMD5();
		if ((md5 == null || md5.isEmpty()) && fsrl.getMD5() != null) {
			program.setExecutableMD5(fsrl.getMD5());
		}
	}
	finally {
		program.endTransaction(id, true);
	}
	if (program.canSave()) {
		program.save("Added import properties", monitor);
	}
}
 
Example 4
Source File: ApplySourceFiles.java    From ghidra with Apache License 2.0 6 votes vote down vote up
static void applyTo(PdbParser pdbParser, XmlPullParser xmlParser, TaskMonitor monitor,
		MessageLog log) {
	Program program = pdbParser.getProgram();
	Options proplist = program.getOptions(Program.PROGRAM_INFO);
	monitor.setMessage("Applying source files...");
	while (xmlParser.hasNext()) {
		if (monitor.isCancelled()) {
			return;
		}
		XmlElement elem = xmlParser.next();
		if (elem.isEnd() && elem.getName().equals("table")) {
			break;
		}

		String name = elem.getAttribute("name");
		int id = XmlUtilities.parseInt(elem.getAttribute("id"));
		proplist.setString("SourceFile" + id, name);

		xmlParser.next();//skip end element
	}
}
 
Example 5
Source File: BytesFieldFactory.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void setDelim(String s, Options options) {
	if (s == null) {
		s = " ";
		options.setString(DELIMITER_MSG, s);
	}
	delim = s;
}
 
Example 6
Source File: ResourceDataDirectory.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void processVersionInfo(Address addr, ResourceInfo info, Program program,
		MessageLog log, TaskMonitor monitor) throws IOException {
	Options infoList = program.getOptions(Program.PROGRAM_INFO);
	VS_VERSION_INFO versionInfo = null;
	try {
		int ptr = ntHeader.rvaToPointer(info.getAddress());
		if (ptr < 0) {
			Msg.error(this, "Invalid RVA " + Integer.toHexString(info.getAddress()));
			return;
		}
		versionInfo = new VS_VERSION_INFO(reader, ptr);
		PeUtils.createData(program, addr, versionInfo.toDataType(), log);
	}
	catch (DuplicateNameException e) {
		Msg.error(this, "Unexpected Exception: VS_VERSION_INFO structure previously defined",
			e);
	}
	VS_VERSION_CHILD[] children = versionInfo.getChildren();
	for (VS_VERSION_CHILD child : children) {
		if (monitor.isCancelled()) {
			return;
		}
		markupChild(child, addr, program, log, monitor);
	}

	String[] keys = versionInfo.getKeys();
	for (String key : keys) {
		if (monitor.isCancelled()) {
			return;
		}
		String value = versionInfo.getValue(key);
		infoList.setString(key, value);
	}
}
 
Example 7
Source File: PropertyListMergeManager.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void setValue(Options options, String propertyName, OptionType type, Object value) {

		switch (type) {
			case BOOLEAN_TYPE:
				options.setBoolean(propertyName, ((Boolean) value).booleanValue());
				break;

			case DOUBLE_TYPE:
				options.setDouble(propertyName, ((Double) value).doubleValue());
				break;

			case INT_TYPE:
				options.setInt(propertyName, ((Integer) value).intValue());
				break;

			case LONG_TYPE:
				options.setLong(propertyName, ((Long) value).longValue());
				break;

			case STRING_TYPE:
				options.setString(propertyName, (String) value);
				break;
			case DATE_TYPE:
				options.setDate(propertyName, (Date) value);
				break;

			case NO_TYPE:
			default:
		}
	}
 
Example 8
Source File: PdbParserTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private Program buildProgram(String exeLocation) throws Exception {

		Program currentTestProgram;

		builder = new ProgramBuilder(programBasename + ".exe", ProgramBuilder._TOY);

		builder.createMemory("test", "0x100", 0x500);
		builder.setBytes("0x110",
			"21 00 01 66 8c 25 28 21 00 01 66 8c 2d 24 21 00 01 9c 8f 05 58 21 00 01 8b 45 00 a3 " +
				"4c 21 00 01 8b 45 04 a3 50 21 00 01 8d 45 08 a3 5c 21 00 01 8b 85 e0 fc ff ff " +
				"c7 05 98 20 00 01 01 00 01 00 a1 50 21 00 01 a3 54 20 00 01 c7 05 48 20 00 01 " +
				"09 04 00 c0 c7 05 4c 20 00 01 01 00 00 00 a1 0c 20 00 01 89 85 d8 fc ff ff a1 " +
				"10 20 00 01 89 85 dc fc ff ff 6a 00 ff 15 28 10 00 01 68 d4 11 00 01 ff 15 38 " +
				"10 00 01 68 09 04 00 c0 ff 15 08 10 00 01 50 ff 15 0c 10 00 01 c3 cc cc cc cc cc");

		currentTestProgram = builder.getProgram();
		currentTestProgram.startTransaction("TEST_" + programBasename + ".exe");

		Options optionsList = currentTestProgram.getOptions(Program.PROGRAM_INFO);
		optionsList.setString(PdbParserConstants.PDB_GUID, notepadGUID);
		optionsList.setString(PdbParserConstants.PDB_AGE, notepadAge);
		optionsList.setString(PdbParserConstants.PDB_FILE, programBasename + ".pdb");
		optionsList.setString("Executable Location",
			exeLocation + File.separator + builder.getProgram().getName());

		return currentTestProgram;
	}
 
Example 9
Source File: DataTypeArchiveDB.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void propertiesCreate() {
		Options pl = getOptions(ARCHIVE_INFO);
		boolean origChangeState = changed;
		pl.setString(CREATED_WITH_GHIDRA_VERSION, Application.getApplicationVersion());
		pl.setDate(DATE_CREATED, new Date());
//	    registerDefaultPointerSize();
		changed = origChangeState;
	}
 
Example 10
Source File: ProgramDB.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void propertiesCreate() {
	Options pl = getOptions(PROGRAM_INFO);
	boolean origChangeState = changed;
	pl.setString(EXECUTABLE_PATH, UNKNOWN);
	pl.setString(EXECUTABLE_FORMAT, UNKNOWN);
	pl.setString(CREATED_WITH_GHIDRA_VERSION, Application.getApplicationVersion());
	pl.setDate(DATE_CREATED, new Date());
	changed = origChangeState;
}
 
Example 11
Source File: ToolPropertiesExampleScript.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void run() throws Exception {

	PluginTool tool = state.getTool();

	Options options = tool.getOptions( "name of my script" );

	String fooString = options.getString( "foo", null );

	if ( fooString == null ) {//does not exist in tool options

		fooString = askString( "enter foo", "what value for foo:" );

		if ( fooString != null ) {
			options.setString( "foo", fooString );
		}
	}

	popup( fooString );
}
 
Example 12
Source File: ProgramDB.java    From ghidra with Apache License 2.0 4 votes vote down vote up
private void checkOldProperties(int openMode, TaskMonitor monitor)
		throws IOException, VersionException {
	Record record = table.getRecord(new StringField(EXECUTE_PATH));
	if (record != null) {
		if (openMode == READ_ONLY) {
			return; // not important, get on path or format will return "unknown"
		}
		if (openMode != UPGRADE) {
			throw new VersionException(true);
		}
		Options pl = getOptions(PROGRAM_INFO);
		String value = record.getString(0);
		pl.setString(EXECUTABLE_PATH, value);
		table.deleteRecord(record.getKeyField());
		record = table.getRecord(new StringField(EXECUTE_FORMAT));
		if (record != null) {
			pl.setString(EXECUTABLE_FORMAT, value);
			table.deleteRecord(record.getKeyField());
		}
	}
	int storedVersion = getStoredVersion();
	if (storedVersion < ANALYSIS_OPTIONS_MOVED_VERSION) {
		if (openMode == READ_ONLY) {
			return;
		}
		if (openMode != UPGRADE) {
			throw new VersionException(true);
		}
		Options oldList = getOptions("Analysis");
		for (String propertyName : oldList.getOptionNames()) {
			oldList.removeOption(propertyName);
		}
	}
	if (storedVersion < METADATA_ADDED_VERSION) {
		if (openMode == READ_ONLY) {
			return;
		}
		if (openMode != UPGRADE) {
			throw new VersionException(true);
		}
	}

}
 
Example 13
Source File: ProgramDB.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void setExecutableSHA256(String sha256) {
	Options pl = getOptions(PROGRAM_INFO);
	pl.setString(EXECUTABLE_SHA256, sha256);
	changed = true;
}
 
Example 14
Source File: ProgramDB.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void setExecutableMD5(String md5) {
	Options pl = getOptions(PROGRAM_INFO);
	pl.setString(EXECUTABLE_MD5, md5);
	changed = true;
}
 
Example 15
Source File: GhidraScript.java    From ghidra with Apache License 2.0 4 votes vote down vote up
/**
 * Private method, returns any error message that may have resulted from attempting to set
 * the given analysis option to the given analysis value.
 *
 * @param options  the options for which analysisOption should be set to
 * 			analysisOptionValue
 * @param analysisOption	the option to be changed
 * @param analysisOptionValue	the value to be set for the option
 * @return  a String description of any errors that occurred during setting of options; if
 * 		empty String is returned, no problems occurred.
 */
private String setAnalysisOption(Options options, String analysisOption,
		String analysisOptionValue) {

	String changeFailedMessage = "";
	if (analysisOptionValue == null) {
		return changeFailedMessage + " " + analysisOption +
			" Can not set an analyzer option to null value.";
	}

	if (!options.contains(analysisOption)) {
		return changeFailedMessage + analysisOption + " could not be found for this program.";
	}

	OptionType optionType = options.getType(analysisOption);
	try {
		switch (optionType) {

			case INT_TYPE:
				options.setInt(analysisOption, Integer.valueOf(analysisOptionValue));
				break;

			case LONG_TYPE:
				options.setLong(analysisOption, Long.valueOf(analysisOptionValue));
				break;

			case STRING_TYPE:
				options.setString(analysisOption, analysisOptionValue);
				break;

			case DOUBLE_TYPE:

				options.setDouble(analysisOption, Double.valueOf(analysisOptionValue));
				break;
			case FLOAT_TYPE:
				options.setFloat(analysisOption, Float.valueOf(analysisOptionValue));
				break;

			case BOOLEAN_TYPE:
				// Tests if text actually equals "true" or "false
				String tempBool = analysisOptionValue.toLowerCase();

				if (tempBool.equals("true") || tempBool.equals("false")) {
					options.setBoolean(analysisOption, Boolean.valueOf(tempBool));
				}

				break;
			case ENUM_TYPE:
				setEnum(options, analysisOption, analysisOptionValue);
				break;
			case KEYSTROKE_TYPE:
			case FONT_TYPE:
			case DATE_TYPE:
			case BYTE_ARRAY_TYPE:
			case COLOR_TYPE:
			case CUSTOM_TYPE:
			case FILE_TYPE:
				changeFailedMessage +=
					"Not allowed to change settings usings strings for type: " + optionType;

			case NO_TYPE:
			default:
				changeFailedMessage += "The option could not be found for this program.";
		}

	}
	catch (NumberFormatException numFormatExc) {
		changeFailedMessage += "Could not convert '" + analysisOptionValue +
			"' to a number of type " + optionType + ".";
	}
	catch (IllegalArgumentException e) {
		changeFailedMessage = "Error changing setting for option '" + analysisOption + "'. ";
	}

	return changeFailedMessage;
}
 
Example 16
Source File: VTControllerTest.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Test
   public void testPersistingControllerConfigState() throws Exception {

	// get out the correlator options
	AddressCorrelatorManager correlator = controller.getCorrelator();
	assertNotNull("The controller did not find any correlators", correlator);

	// set some options settings
	Options options = correlator.getOptions(LastResortAddressCorrelator.class);
	String testDefaultValue = "Test Default Value";
	String testOptionKey = "Test Option Name";
	String value = options.getString(testOptionKey, testDefaultValue);
	assertEquals(value, testDefaultValue);

	String firstNewOptionValue = "New Option Value";
	options.setString(testOptionKey, firstNewOptionValue);
	assertEquals(firstNewOptionValue, options.getString(testOptionKey, null));
	correlator.setOptions(LastResortAddressCorrelator.class, options);
	// save the options 
	SaveState saveState = new SaveState();
	controller.writeConfigState(saveState);

	// change the options
	String secondNewValue = "Second New Value";
	options.setString(testOptionKey, secondNewValue);
	correlator.setOptions(LastResortAddressCorrelator.class, options);

	// pull the values again and make sure they are still correct (that writing the config
	// state did not change the cached controller and options) 
	correlator = controller.getCorrelator();
	options = correlator.getOptions(LastResortAddressCorrelator.class);
	assertEquals(secondNewValue, options.getString(testOptionKey, null));

	// restore the options
	controller.readConfigState(saveState);

	// verify the settings
	// (we have to pull the correlator and options again, as changing the config state may 
	// change the cached values in the controller)
	correlator = controller.getCorrelator();
	options = correlator.getOptions(LastResortAddressCorrelator.class);
	assertEquals(firstNewOptionValue, options.getString(testOptionKey, null));
}
 
Example 17
Source File: ProgramDB.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void setCompiler(String compiler) {
	Options pl = getOptions(PROGRAM_INFO);
	pl.setString(COMPILER, compiler);
	changed = true;
}
 
Example 18
Source File: ReportDisassemblyStats.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void run() throws Exception {

	// find all the sections of memory marked as executable

	if (this.isRunningHeadless()) {
		runScript("MakeFuncsAtLabelsScript.java");
	}

	AddressSetView execMemSet = currentProgram.getMemory().getExecuteSet();
	InstructionIterator instIter =
		currentProgram.getListing().getInstructions(execMemSet, true);
	FunctionManager fm = currentProgram.getFunctionManager();
	//calculate the number of instructions not in functions and the total number of instructions
	int instCount = 0;
	int instNotInFuncCount = 0;
	int instByteCount = 0;
	while (instIter.hasNext()) {
		Instruction inst = instIter.next();
		instByteCount += inst.getBytes().length;
		Function func = fm.getFunctionContaining(inst.getAddress());
		if (func == null) {
			instNotInFuncCount++;
		}
		instCount++;
	}
	//count the number of defined data bytes
	int dataByteCount = 0;
	DataIterator dataIter = currentProgram.getListing().getData(execMemSet, true);
	while (dataIter.hasNext()) {
		Data data = dataIter.next();
		if (data.isDefined()) {
			dataByteCount += data.getBytes().length;
		}
	}

	long numTotalBytes = execMemSet.getNumAddresses();
	double undefinedPercentage =
		100.0 - (100.0 * (instByteCount + dataByteCount) / numTotalBytes);
	double notInFuncPercentage = instNotInFuncCount * 100.0 / instCount;

	printf("Name: %s", getProgramFile().toString());
	printf("Language: %s", currentProgram.getLanguageID());
	printf("CompilerSpec: %s", currentProgram.getCompilerSpec().getCompilerSpecID());
	printf("Number of functions: %d", fm.getFunctionCount());
	printf("Number of addresses: %d", numTotalBytes);
	printf("Percentage of undefined addresses: %f", undefinedPercentage);
	printf("Percentage of instructions not in functions: %f", notInFuncPercentage);

	Iterator<Bookmark> bmi = currentProgram.getBookmarkManager().getBookmarksIterator("Error");
	int numConflicts = 0;
	int numRelocationErrors = 0;
	while (bmi.hasNext()) {
		Bookmark bm = bmi.next();
		if (bm.toString().contains("conflicting")) {
			numConflicts++;
			continue;
		}
		if (bm.toString().contains("relocation")) {
			numRelocationErrors++;
			continue;
		}
		printf("!!%s", bm.toString());
	}
	printf("Number of conflicts: %d", numConflicts);
	printf("Number of relocation errors: %d", numRelocationErrors);
	if (this.isRunningHeadless()) {
		if ((undefinedPercentage <= UNDEFINED_THRESHOLD) &&
			(notInFuncPercentage <= NOT_IN_FUNC_THRESHOLD)) {
			totalNumOfFunctions += fm.getFunctionCount();
			printf("Total number of functions: %d", totalNumOfFunctions);
			//search for .siginfo file
			File siginfoFile = new File(getProgramFile().getAbsolutePath() + ".siginfo");
			boolean siginfoExists = siginfoFile.exists();
			if (!siginfoExists) {
				printf("No siginfo file found");
			}
			else {
				//read the .siginfo file and save the information to the project
				BufferedReader br = new BufferedReader(new FileReader(siginfoFile));
				String verinfo = br.readLine();
				br.close();
				Options propList = currentProgram.getOptions("Signature Info");
				propList.setString("Version Name", verinfo);
				printf("Saving version %s to project", verinfo);
			}
		}
		else {
			printf("Program not imported");
			setHeadlessContinuationOption(HeadlessContinuationOption.ABORT_AND_DELETE);
		}
		printf("");

	}

}
 
Example 19
Source File: CodeBrowserOptionsTest.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Test
public void testBytesFieldOptions() throws Exception {

	showTool(tool);
	loadProgram();
	Options options = tool.getOptions(GhidraOptions.CATEGORY_BROWSER_FIELDS);
	List<String> names = getOptionNames(options, "Bytes Field");
	assertEquals("Different number of byte options than expected:\n" + names + "\n\n", 6,
		names.size());
	assertEquals("Bytes Field.Byte Group Size", names.get(0));
	assertEquals("Bytes Field.Delimiter", names.get(1));
	assertEquals("Bytes Field.Display Structure Alignment Bytes", names.get(2));
	assertEquals("Bytes Field.Display in Upper Case", names.get(3));
	assertEquals("Bytes Field.Maximum Lines To Display", names.get(4));
	assertEquals("Bytes Field.Reverse Instruction Byte Ordering", names.get(5));

	// option 0 - Byte Group Size
	options.setInt(names.get(0), 2);
	cb.updateNow();
	cb.goToField(addr("0x1001000"), "Bytes", 0, 0);
	ListingTextField btf = (ListingTextField) cb.getCurrentField();
	assertEquals("0102 0304", btf.getText());

	// option 1 - Delimiter
	options.setString(names.get(1), "-");
	cb.updateNow();
	cb.goToField(addr("0x1001000"), "Bytes", 0, 0);
	btf = (ListingTextField) cb.getCurrentField();
	assertEquals("0102-0304", btf.getText());

	// option 2 - Display Structure Alignment Bytes
	//   see separate tests

	// option 3 - Display in Upper Case
	cb.goToField(addr("0x1001100"), "Bytes", 2, 0);
	btf = (ListingTextField) cb.getCurrentField();
	assertEquals("0102-0304-0506-0708-090a-0b0c", btf.getText());

	options.setBoolean(names.get(3), true);
	cb.updateNow();
	btf = (ListingTextField) cb.getCurrentField();
	assertEquals("0102-0304-0506-0708-090A-0B0C", btf.getText());

	// option 4 - Maximum Lines To Display
	cb.goToField(addr("0x100aef8"), "Bytes", 0, 0);
	cb.updateNow();
	StructureDataType struct = new StructureDataType("fred", 50);
	CreateDataCmd cmd = new CreateDataCmd(addr("0x100aef8"), struct);
	tool.execute(cmd, program);

	options.setInt(names.get(4), 3);
	cb.updateNow();
	cb.goToField(addr("0x100aef8"), "Bytes", 0, 0);
	btf = (ListingTextField) cb.getCurrentField();
	assertEquals(3, getNumberOfLines(btf));

	// option 5 - Reverse Instruction Byte Ordering
	cb.goToField(addr("0x10038b1"), "Bytes", 0, 0);
	btf = (ListingTextField) cb.getCurrentField();

	assertEquals("85C0", btf.getText());

	options.setBoolean(names.get(5), true);
	cb.updateNow();
	cb.goToField(addr("0x10038b1"), "Bytes", 0, 0);
	btf = (ListingTextField) cb.getCurrentField();

	assertEquals("C085", btf.getText());

	options.setBoolean(names.get(5), false);
	cb.updateNow();
	cb.goToField(addr("0x10038b1"), "Bytes", 0, 0);
	btf = (ListingTextField) cb.getCurrentField();

	assertEquals("85C0", btf.getText());

}
 
Example 20
Source File: JavaAnalyzer.java    From ghidra with Apache License 2.0 4 votes vote down vote up
private void recordJavaVersionInfo(Program program, ClassFileJava classFile) {
	Options programInfo = program.getOptions(Program.PROGRAM_INFO);
	programInfo.setInt("Major Version", classFile.getMajorVersion());
	programInfo.setInt("Minor Version", classFile.getMinorVersion());
	String javaVersion;
	switch (classFile.getMajorVersion()) {
		case 45:
			javaVersion = "1.1";
			break;
		case 46:
			javaVersion = "1.2";
			break;
		case 47:
			javaVersion = "1.3";
			break;
		case 48:
			javaVersion = "1.4";
			break;
		case 49:
			javaVersion = "1.5";
			break;
		case 50:
			javaVersion = "1.6";
			break;
		case 51:
			javaVersion = "1.7";
			break;
		case 52:
			javaVersion = "1.8";
			break;
		case 53:
			javaVersion = "9";
			break;
		case 54:
			javaVersion = "10";
			break;
		case 55:
			javaVersion = "11";
			break;
		case 56:
			javaVersion = "12";
			break;
		case 57:
			javaVersion = "13";
			break;
		default:
			javaVersion = "Unknown";
			break;
	}
	programInfo.setString("Java Version", javaVersion);
}