ghidra.app.util.Option Java Examples
The following examples show how to use
ghidra.app.util.Option.
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: DyldCacheLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec, DomainObject domainObject, boolean loadIntoProgram) { List<Option> list = super.getDefaultOptions(provider, loadSpec, domainObject, loadIntoProgram); if (!loadIntoProgram) { list.add(new Option(PROCESS_SYMBOLS_OPTION_NAME, PROCESS_SYMBOLS_OPTION_DEFAULT, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-processSymbols")); list.add( new Option(CREATE_DYLIB_SECTIONS_OPTION_NAME, CREATE_DYLIB_SECTIONS_OPTION_DEFAULT, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-createDylibSections")); list.add( new Option(ADD_RELOCATION_ENTRIES_OPTION_NAME, ADD_RELOCATION_ENTRIES_OPTION_DEFAULT, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-addRelocationEntries")); } return list; }
Example #2
Source File: IntelHexLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override protected boolean loadProgramInto(ByteProvider provider, LoadSpec loadSpec, List<Option> options, MessageLog log, Program prog, TaskMonitor monitor) throws IOException, CancelledException { Address baseAddr = getBaseAddr(options); if (baseAddr == null) { baseAddr = prog.getAddressFactory().getDefaultAddressSpace().getAddress(0); } boolean success = false; try { processIntelHex(provider, options, log, prog, monitor); success = true; } catch (AddressOverflowException e) { throw new IOException( "Hex file specifies range greater than allowed address space - " + e.getMessage()); } return success; }
Example #3
Source File: GhidraProject.java From ghidra with Apache License 2.0 | 6 votes |
private Program importByStealingCodeFromAutoImporterByUsingBestGuess(File file) throws CancelledException, DuplicateNameException, InvalidNameException, VersionException, IOException { MessageLog messageLog = new MessageLog(); OptionChooser EMPTY_OPTIONS = (optionChoices, addressFactory) -> { Option option = new Option(AbstractLibrarySupportLoader.SYM_OPTION_NAME, false); ArrayList<Option> arrayList = new ArrayList<>(); arrayList.add(option); return arrayList; }; String programNameOverride = null; List<Program> programs = AutoImporter.importFresh(file, null, this, messageLog, MONITOR, LoaderService.ACCEPT_ALL, LoadSpecChooser.CHOOSE_THE_FIRST_PREFERRED, programNameOverride, EMPTY_OPTIONS, MultipleProgramsStrategy.ONE_PROGRAM_OR_NULL); if (programs != null && programs.size() == 1) { return programs.get(0); } return null; }
Example #4
Source File: MotorolaHexLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override protected boolean loadProgramInto(ByteProvider provider, LoadSpec loadSpec, List<Option> options, MessageLog log, Program prog, TaskMonitor monitor) throws IOException, CancelledException { Address baseAddr = getBaseAddr(options); if (baseAddr == null) { baseAddr = prog.getAddressFactory().getDefaultAddressSpace().getAddress(0); } boolean success = false; try { processMotorolaHex(provider, options, prog, baseAddr, monitor); success = true; } catch (AddressOverflowException e) { throw new IOException( "Hex file specifies range greater than allowed address space - " + e.getMessage()); } return success; }
Example #5
Source File: XmlLoader.java From ghidra with Apache License 2.0 | 6 votes |
private boolean doImportWork(final ProgramXmlMgr mgr, final List<Option> options, final MessageLog log, Program prog, TaskMonitor monitor, final boolean isAddToProgram) throws IOException { MessageLog mgrLog = null; boolean success = false; try { XmlProgramOptions xmlOptions = new XmlProgramOptions(); xmlOptions.setOptions(options); xmlOptions.setAddToProgram(isAddToProgram); mgrLog = mgr.read(prog, monitor, xmlOptions); log.copyFrom(mgrLog); success = true; } catch (Exception e) { String message = "(empty)"; if (mgrLog != null && !"".equals(mgrLog.toString())) { message = mgrLog.toString(); } if (log != null && !"".equals(log.toString())) { message = log.toString(); } Msg.warn(this, "XML import exception, log: " + message, e); throw new IOException(e.getMessage(), e); } return success; }
Example #6
Source File: AbstractLibrarySupportLoader.java From ghidra with Apache License 2.0 | 6 votes |
private void apply(List<Program> programs, List<Option> options, MessageLog log, TaskMonitor monitor) throws CancelledException { monitor.initialize(programs.size()); for (int i = 0; i < programs.size() && isCreateExportSymbolFiles(options); ++i) { Program p = programs.get(i); monitor.checkCanceled(); monitor.setProgress(i); int id = p.startTransaction("apply"); boolean success = false; try { applyLibrarySymbols(p, log, monitor); applyImports(p, log, monitor); success = true; } finally { p.endTransaction(id, success); } } LibraryLookupTable.cleanup(); }
Example #7
Source File: MachoLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program, TaskMonitor monitor, MessageLog log) throws IOException { try { FileBytes fileBytes = MemoryBlockUtils.createFileBytes(program, provider, monitor); // A Mach-O file may contain PRELINK information. If so, we use a special // program builder that knows how to deal with it. List<PrelinkMap> prelinkList = MachoPrelinkUtils.parsePrelinkXml(provider, monitor); if (!prelinkList.isEmpty()) { MachoPrelinkProgramBuilder.buildProgram(program, provider, fileBytes, prelinkList, log, monitor); } else { MachoProgramBuilder.buildProgram(program, provider, fileBytes, log, monitor); } } catch (Exception e) { throw new IOException(e.getMessage()); } }
Example #8
Source File: AbstractLibrarySupportLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override protected boolean loadProgramInto(ByteProvider provider, LoadSpec loadSpec, List<Option> options, MessageLog log, Program program, TaskMonitor monitor) throws CancelledException, IOException { LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec(); LanguageID languageID = program.getLanguageID(); CompilerSpecID compilerSpecID = program.getCompilerSpec().getCompilerSpecID(); if (!(pair.languageID.equals(languageID) && pair.compilerSpecID.equals(compilerSpecID))) { log.appendMsg(provider.getAbsolutePath() + " does not have the same language/compiler spec as program " + program.getName()); return false; } log.appendMsg("----- Loading " + provider.getAbsolutePath() + " -----"); load(provider, loadSpec, options, program, monitor, log); return true; }
Example #9
Source File: DefLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program prog, TaskMonitor monitor, MessageLog log) throws IOException { if (!prog.getExecutableFormat().equals(PeLoader.PE_NAME)) { throw new IOException("Program must be a " + PeLoader.PE_NAME); } SymbolTable symtab = prog.getSymbolTable(); Consumer<String> errorConsumer = err -> log.error("DefLoader", err); for (DefExportLine def : parseExports(provider)) { Symbol symbol = SymbolUtilities.getLabelOrFunctionSymbol(prog, SymbolUtilities.ORDINAL_PREFIX + def.getOrdinal(), errorConsumer); if (symbol == null) { continue; } try { Symbol label = symtab.createLabel(symbol.getAddress(), def.getName(), SourceType.IMPORTED); label.setPrimary(); } catch (InvalidInputException e) { log.appendMsg(e.getMessage()); } } }
Example #10
Source File: AbstractLibrarySupportLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { if (options != null) { for (Option option : options) { String name = option.getName(); if (name.equals(SYM_OPTION_NAME) || name.equals(LIB_OPTION_NAME)) { if (!Boolean.class.isAssignableFrom(option.getValueClass())) { return "Invalid type for option: " + name + " - " + option.getValueClass(); } } } } return super.validateOptions(provider, loadSpec, options, program); }
Example #11
Source File: ElfLoader.java From ghidra with Apache License 2.0 | 6 votes |
@Override public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec, DomainObject domainObject, boolean loadIntoProgram) { // NOTE: add-to-program is not supported List<Option> options = super.getDefaultOptions(provider, loadSpec, domainObject, loadIntoProgram); try { ElfLoaderOptionsFactory.addOptions(options, provider, loadSpec); } catch (Exception e) { Msg.error(this, "Error while generating Elf import options", e); // ignore here, will catch later } return options; }
Example #12
Source File: GzfLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { if (options != null && options.size() > 0) { return "GzfLoader takes no options"; } return null; }
Example #13
Source File: IntelHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { Address baseAddr = null; for (Option option : options) { String optName = option.getName(); try { if (optName.equals(OPTION_NAME_BASE_ADDRESS)) { baseAddr = (Address) option.getValue(); if (baseAddr == null) { return "Invalid base address"; } } else if (optName.equals(OPTION_NAME_BLOCK_NAME)) { if (!String.class.isAssignableFrom(option.getValueClass())) { return OPTION_NAME_BLOCK_NAME + " must be a String"; } } else if (optName.equals(OPTION_NAME_IS_OVERLAY)) { if (!Boolean.class.isAssignableFrom(option.getValueClass())) { return OPTION_NAME_IS_OVERLAY + " must be a boolean"; } } else { return "Unknown option: " + optName; } } catch (ClassCastException e) { return "Invalid type for option: " + optName + " - " + e.getMessage(); } } return null; }
Example #14
Source File: GzfLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public List<DomainObject> load(ByteProvider provider, String programName, DomainFolder programFolder, LoadSpec loadSpec, List<Option> options, MessageLog messageLog, Object consumer, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException { DomainObject dobj; if (programFolder == null) { dobj = loadPackedProgramDatabase(provider, programName, consumer, monitor); } else { DomainFile df = doLoad(provider, programName, programFolder, monitor); boolean success = false; try { if (!ProgramContentHandler.PROGRAM_CONTENT_TYPE.equals(df.getContentType())) { throw new IOException("File imported is not a Program: " + programName); } monitor.setMessage("Opening " + programName); dobj = df.getDomainObject(consumer, true, false, monitor); success = true; } finally { if (!success) { df.delete(); } } } List<DomainObject> results = new ArrayList<>(); results.add(dobj); return results; }
Example #15
Source File: AbstractLibrarySupportLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec, DomainObject domainObject, boolean loadIntoProgram) { List<Option> list = super.getDefaultOptions(provider, loadSpec, domainObject, loadIntoProgram); list.add(new Option(SYM_OPTION_NAME, IS_CREATE_EXPORT_SYMBOL_FILES_DEFAULT, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-createExportSymbolFiles")); list.add(new Option(LIB_OPTION_NAME, IS_LOAD_LIBRARIES_DEFAULT, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-loadExternalLibs")); return list; }
Example #16
Source File: GdtLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { if (options != null && options.size() > 0) { return "GDTLoader takes no options"; } return null; }
Example #17
Source File: AbstractProgramLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { if (options != null) { for (Option option : options) { String name = option.getName(); if (name.equals(APPLY_LABELS_OPTION_NAME) || name.equals(ANCHOR_LABELS_OPTION_NAME)) { if (!Boolean.class.isAssignableFrom(option.getValueClass())) { return "Invalid type for option: " + name + " - " + option.getValueClass(); } } } } return null; }
Example #18
Source File: GameCubeLoader.java From Ghidra-GameCube-Loader with Apache License 2.0 | 5 votes |
@Override protected List<Program> loadProgram(ByteProvider provider, String programName, DomainFolder programFolder, LoadSpec loadSpec, List<Option> options, MessageLog log, Object consumer, TaskMonitor monitor) throws IOException, CancelledException { LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec(); Language importerLanguage = getLanguageService().getLanguage(pair.languageID); CompilerSpec importerCompilerSpec = importerLanguage.getCompilerSpecByID(pair.compilerSpecID); Address baseAddress = importerLanguage.getAddressFactory().getDefaultAddressSpace().getAddress(0); Program program = createProgram(provider, programName, baseAddress, getName(), importerLanguage, importerCompilerSpec, consumer); boolean success = false; try { success = this.loadInto(provider, loadSpec, options, log, program, monitor); } finally { if (!success) { program.release(consumer); program = null; } } List<Program> results = new ArrayList<Program>(); if (program != null) { results.add(program); } return results; }
Example #19
Source File: GameCubeLoader.java From Ghidra-GameCube-Loader with Apache License 2.0 | 5 votes |
@Override public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec, DomainObject domainObject, boolean isLoadIntoProgram) { List<Option> list = super.getDefaultOptions(provider, loadSpec, domainObject, isLoadIntoProgram); list.add(new Option(AUTOLOAD_MAPS_OPTION_NAME, true, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-autoloadMaps")); list.add(new Option(ADD_RELOCATIONS_OPTION_NAME, false, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-saveRelocations")); list.add(new Option(ADD_RESERVED_AND_HARDWAREREGISTERS, true, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-addSystemMemorySections")); list.add(new Option(SPECIFY_BINARY_MEM_ADDRESSES, false, Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-specifyFileMemAddrs")); return list; }
Example #20
Source File: IntelHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
private Address getBaseAddr(List<Option> options) { Address baseAddr = null; for (Option option : options) { String optName = option.getName(); if (optName.equals(OPTION_NAME_BASE_ADDRESS)) { baseAddr = (Address) option.getValue(); } } return baseAddr; }
Example #21
Source File: SkeletonLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { // TODO: If this loader has custom options, validate them here. Not all options require // validation. return super.validateOptions(provider, loadSpec, options, program); }
Example #22
Source File: ProgramTextOptions.java From ghidra with Apache License 2.0 | 5 votes |
List<Option> getOptions() {//TODO add right into list Option[] options = new Option[] { new Option(OPTION_WIDTH, OPTION_WIDTH_LABEL, new Integer(labelWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_ADDR, new Integer(addrWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_BYTES, new Integer(bytesWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_PREMNEMONIC, new Integer(preMnemonicWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_MNEMONIC, new Integer(mnemonicWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_OPERAND, new Integer(operandWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_EOL, new Integer(eolWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_REF, new Integer(refWidth)), new Option(OPTION_WIDTH, OPTION_WIDTH_DATA_FIELD, new Integer(dataFieldNameWidth)), new Option(OPTION_SHOW, OPTION_SHOW_COMMENTS, new Boolean(showComments)), new Option(OPTION_SHOW, OPTION_SHOW_PROPERTIES, new Boolean(showProperties)), new Option(OPTION_SHOW, OPTION_SHOW_STRUCTURES, new Boolean(showStructures)), new Option(OPTION_SHOW, OPTION_SHOW_UNDEFINED, new Boolean(showUndefinedData)), new Option(OPTION_SHOW, OPTION_SHOW_REF_HEADER, new Boolean(showReferenceHeaders)), new Option(OPTION_SHOW, OPTION_SHOW_BACK_REFS, new Boolean(showBackReferences)), new Option(OPTION_SHOW, OPTION_SHOW_FORWARD_REFS, new Boolean(showForwardReferences)), new Option(OPTION_SHOW, OPTION_SHOW_FUNCTIONS, new Boolean(showFunctions)), new Option(OPTION_SHOW, OPTION_SHOW_BLOCK_NAMES, new Boolean(showBlockNameInOperands)), new Option(OPTION_ADV, OPTION_ADV_LABEL_SUFFIX, labelSuffix), new Option(OPTION_ADV, OPTION_ADV_COMMENT_SUFFIX, commentPrefix), }; List<Option> optionsList = new ArrayList<Option>(); Collections.addAll(optionsList, options); return optionsList; }
Example #23
Source File: IntelHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec, DomainObject domainObject, boolean loadIntoProgram) { String blockName = ""; boolean isOverlay = false; Address baseAddr = null; if (domainObject instanceof Program) { Program program = (Program) domainObject; AddressFactory addressFactory = program.getAddressFactory(); if (addressFactory != null) { AddressSpace defaultAddressSpace = addressFactory.getDefaultAddressSpace(); if (defaultAddressSpace != null) { baseAddr = defaultAddressSpace.getAddress(0); } } } ArrayList<Option> list = new ArrayList<Option>(); if (loadIntoProgram) { list.add(new Option(OPTION_NAME_IS_OVERLAY, isOverlay)); list.add(new Option(OPTION_NAME_BLOCK_NAME, blockName)); } else { isOverlay = false; } if (baseAddr == null) { list.add(new Option(OPTION_NAME_BASE_ADDRESS, Address.class)); } else { list.add(new Option(OPTION_NAME_BASE_ADDRESS, baseAddr)); } return list; }
Example #24
Source File: MotorolaHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) { Address baseAddr = null; for (Option option : options) { String optName = option.getName(); try { if (optName.equals(OPTION_NAME_BASE_ADDRESS)) { baseAddr = (Address) option.getValue(); if (baseAddr == null) { return "Invalid base address"; } } else if (optName.equals(OPTION_NAME_BLOCK_NAME)) { if (!String.class.isAssignableFrom(option.getValueClass())) { return OPTION_NAME_BLOCK_NAME + " must be a String"; } } else if (optName.equals(OPTION_NAME_IS_OVERLAY)) { if (!Boolean.class.isAssignableFrom(option.getValueClass())) { return OPTION_NAME_IS_OVERLAY + " must be a boolean"; } } else { return "Unknown option: " + optName; } } catch (ClassCastException e) { return "Invalid type for option: " + optName + " - " + e.getMessage(); } } return null; }
Example #25
Source File: MotorolaHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
private Address getBaseAddr(List<Option> options) { Address baseAddr = null; for (Option option : options) { String optName = option.getName(); if (optName.equals(OPTION_NAME_BASE_ADDRESS)) { baseAddr = (Address) option.getValue(); } } return baseAddr; }
Example #26
Source File: MotorolaHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
private String getBlockName(List<Option> options) { String blockName = ""; for (Option option : options) { String optName = option.getName(); if (optName.equals(OPTION_NAME_BLOCK_NAME)) { blockName = (String) option.getValue(); } } return blockName; }
Example #27
Source File: MotorolaHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override protected List<Program> loadProgram(ByteProvider provider, String programName, DomainFolder programFolder, LoadSpec loadSpec, List<Option> options, MessageLog log, Object consumer, TaskMonitor monitor) throws IOException, CancelledException { LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec(); Language importerLanguage = getLanguageService().getLanguage(pair.languageID); CompilerSpec importerCompilerSpec = importerLanguage.getCompilerSpecByID(pair.compilerSpecID); Program prog = createProgram(provider, programName, null, getName(), importerLanguage, importerCompilerSpec, consumer); boolean success = false; try { success = loadInto(provider, loadSpec, options, log, prog, monitor); if (success) { createDefaultMemoryBlocks(prog, importerLanguage, log); } } finally { if (!success) { prog.release(consumer); prog = null; } } List<Program> results = new ArrayList<Program>(); if (prog != null) { results.add(prog); } return results; }
Example #28
Source File: MotorolaHexLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec, DomainObject domainObject, boolean loadIntoProgram) { String blockName = ""; boolean isOverlay = false; Address baseAddr = null; if (domainObject instanceof Program) { Program program = (Program) domainObject; AddressFactory addressFactory = program.getAddressFactory(); if (addressFactory != null) { AddressSpace defaultAddressSpace = addressFactory.getDefaultAddressSpace(); if (defaultAddressSpace != null) { baseAddr = defaultAddressSpace.getAddress(0); } } } ArrayList<Option> list = new ArrayList<Option>(); if (loadIntoProgram) { list.add(new Option(OPTION_NAME_IS_OVERLAY, isOverlay)); list.add(new Option(OPTION_NAME_BLOCK_NAME, blockName)); } else { isOverlay = false; } if (baseAddr == null) { list.add(new Option(OPTION_NAME_BASE_ADDRESS, Address.class)); } else { list.add(new Option(OPTION_NAME_BASE_ADDRESS, baseAddr)); } return list; }
Example #29
Source File: XmlLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override protected List<Program> loadProgram(ByteProvider provider, String programName, DomainFolder programFolder, LoadSpec loadSpec, List<Option> options, MessageLog log, Object consumer, TaskMonitor monitor) throws IOException, CancelledException { List<Program> results = new ArrayList<>(); LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec(); Language importerLanguage = getLanguageService().getLanguage(pair.languageID); CompilerSpec importerCompilerSpec = importerLanguage.getCompilerSpecByID(pair.compilerSpecID); ParseResult result = parse(provider); if (result.lastInfo == null) { return results; } Address imageBase = null; if (result.lastInfo.imageBase != null) { imageBase = importerLanguage.getAddressFactory().getAddress(result.lastInfo.imageBase); } Program prog = createProgram(provider, programName, imageBase, getName(), importerLanguage, importerCompilerSpec, consumer); boolean success = false; try { success = doImport(result.lastXmlMgr, options, log, prog, monitor, false); if (success) { createDefaultMemoryBlocks(prog, importerLanguage, log); } } finally { if (!success) { prog.release(consumer); prog = null; } } if (prog != null) { results.add(prog); } return results; }
Example #30
Source File: XmlLoader.java From ghidra with Apache License 2.0 | 5 votes |
@Override protected boolean loadProgramInto(ByteProvider provider, LoadSpec loadSpec, List<Option> options, MessageLog log, Program prog, TaskMonitor monitor) throws IOException, CancelledException { File file = provider.getFile(); return doImport(new ProgramXmlMgr(file), options, log, prog, monitor, true); }