diff --git a/GPL/CabExtract/Module.manifest b/GPL/CabExtract/Module.manifest deleted file mode 100644 index d98fc28fe9..0000000000 --- a/GPL/CabExtract/Module.manifest +++ /dev/null @@ -1,2 +0,0 @@ -MODULE FILE LICENSE: os/linux64/cabextract GPL 3 -MODULE FILE LICENSE: os/osx64/cabextract GPL 3 diff --git a/GPL/CabExtract/build.gradle b/GPL/CabExtract/build.gradle deleted file mode 100644 index 374a463115..0000000000 --- a/GPL/CabExtract/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: Public Domain - */ -apply from: file("../gpl.gradle").getCanonicalPath() - -if (findProject(':Generic') != null) { - apply from: "$rootProject.projectDir/gradle/nativeProject.gradle" - apply from: "$rootProject.projectDir/gradle/distributableGPLModule.gradle" -} -else { - apply from: "../nativeBuildProperties.gradle" -} - -apply plugin: 'eclipse' - -eclipse.project.name = 'GPL CabExtract' - -project.ext.cabextract = "cabextract-1.6" - -/********************************************************************************* - * Deprecated - will be removed - *********************************************************************************/ - -/********************************************************************************* - * CabExtract platform specific tasks - * - * The cabextract tool requires that its 'configure' script is called before make. - *********************************************************************************/ -def currentPlatform = getCurrentPlatformName() -if (['linux64', 'osx64'].contains(currentPlatform)) { - - def makeName = "${currentPlatform}CabExtractMake" - - task (makeName, type: Exec) { - group "private" - workingDir "build/unpack/${cabextract}" - executable "make" - - // Specify output so cabextract is only built if this is missing - outputs.file("build/os/${currentPlatform}/cabextract") - - // Extract archive and ./configure - doFirst { - copy { - from tarTree(file("data/${cabextract}.tar.gz")) - into 'build/unpack' - } - // Force all unpacked files to have the same timestamp - ant.touch() { - fileset(dir: file("build/unpack/${cabextract}")) - } - exec { - workingDir "build/unpack/${cabextract}" - executable "./configure" - } - } - - // Move out the built cabextract and delete the extracted files - doLast { - copy { - from "build/unpack/${cabextract}/cabextract" - into "build/os/${currentPlatform}" - } - delete file("build/unpack/${cabextract}") - } - } -} diff --git a/GPL/CabExtract/certification.manifest b/GPL/CabExtract/certification.manifest deleted file mode 100644 index aa851666c6..0000000000 --- a/GPL/CabExtract/certification.manifest +++ /dev/null @@ -1,5 +0,0 @@ -##VERSION: 2.0 -##MODULE IP: GPL 3 -##MODULE IP: Public Domain -Module.manifest||Public Domain||||END| -data/cabextract-1.6.tar.gz||GPL 3||||END| diff --git a/GPL/CabExtract/data/cabextract-1.6.tar.gz b/GPL/CabExtract/data/cabextract-1.6.tar.gz deleted file mode 100644 index 0c8f398d2a..0000000000 Binary files a/GPL/CabExtract/data/cabextract-1.6.tar.gz and /dev/null differ diff --git a/GPL/CabExtract/settings.gradle b/GPL/CabExtract/settings.gradle deleted file mode 100644 index 1092a7aaab..0000000000 --- a/GPL/CabExtract/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -/* ### - * IP: Public Domain - */ diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/commands/NList.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/commands/NList.java index 26505e5923..60d4e39117 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/commands/NList.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/commands/NList.java @@ -150,6 +150,11 @@ public class NList implements StructConverter { (n_type & NListConstants.MASK_N_TYPE) == NListConstants.TYPE_N_PBUD; } + public boolean isIndirect() { + return n_sect == NListConstants.NO_SECT && + (n_type & NListConstants.MASK_N_TYPE) == NListConstants.TYPE_N_INDR; + } + public boolean isSymbolicDebugging() { return (n_type & NListConstants.MASK_N_STAB) != 0; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java index 4211c4f41a..c11e774465 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java @@ -396,6 +396,11 @@ public class MachoProgramBuilder { continue; } + // is a re-exported symbol, will be added as an external later + if (symbol.isIndirect()) { + continue; + } + if (symbol.isExternal() || symbol.isPrivateExternal()) { program.getSymbolTable().addExternalEntryPoint(addr); } @@ -483,8 +488,8 @@ public class MachoProgramBuilder { String name = generateValidName(symbol.getString()); if (name != null && name.length() > 0) { try { - program.getSymbolTable() - .createLabel(startAddr, name, namespace, SourceType.IMPORTED); + program.getSymbolTable().createLabel(startAddr, name, namespace, + SourceType.IMPORTED); } catch (Exception e) { log.appendMsg("Unable to create indirect symbol " + name); @@ -565,9 +570,8 @@ public class MachoProgramBuilder { symbol.setName(ObjectiveC1_Constants.OBJC_MSG_SEND_RTP_NAME, SourceType.IMPORTED); } else { - program.getSymbolTable() - .createLabel(address, ObjectiveC1_Constants.OBJC_MSG_SEND_RTP_NAME, - SourceType.IMPORTED); + program.getSymbolTable().createLabel(address, + ObjectiveC1_Constants.OBJC_MSG_SEND_RTP_NAME, SourceType.IMPORTED); } } @@ -593,8 +597,8 @@ public class MachoProgramBuilder { continue; } if (symbol.isTypeUndefined()) { - List globalSymbols = program.getSymbolTable() - .getLabelOrFunctionSymbols(symbol.getString(), null); + List globalSymbols = program.getSymbolTable().getLabelOrFunctionSymbols( + symbol.getString(), null); if (globalSymbols.isEmpty()) {//IF IT DOES NOT ALREADY EXIST... undefinedSymbols.add(symbol); } @@ -946,8 +950,8 @@ public class MachoProgramBuilder { * See crt.c from opensource.apple.com */ private void processProgramVars() { - if (program.getLanguage().getProcessor() == Processor - .findOrPossiblyCreateProcessor("PowerPC")) { + if (program.getLanguage().getProcessor() == Processor.findOrPossiblyCreateProcessor( + "PowerPC")) { return; } @@ -1030,7 +1034,7 @@ public class MachoProgramBuilder { if (monitor.isCancelled()) { return; } - + MemoryBlock sectionMemoryBlock = getMemoryBlock(section); if (sectionMemoryBlock == null) { if (section.getNumberOfRelocations() > 0) { @@ -1080,20 +1084,18 @@ public class MachoProgramBuilder { } } - program.getRelocationTable() - .add(address, relocationInfo.getType(), - new long[] { relocationInfo.getValue(), relocationInfo.getLength(), - relocationInfo.isPcRelocated() ? 1 : 0, - relocationInfo.isExternal() ? 1 : 0, - relocationInfo.isScattered() ? 1 : 0}, - origBytes, relocation.getTargetDescription()); + program.getRelocationTable().add(address, relocationInfo.getType(), + new long[] { relocationInfo.getValue(), relocationInfo.getLength(), + relocationInfo.isPcRelocated() ? 1 : 0, relocationInfo.isExternal() ? 1 : 0, + relocationInfo.isScattered() ? 1 : 0 }, + origBytes, relocation.getTargetDescription()); } } } private void handleRelocationError(Address address, String message) { - program.getBookmarkManager() - .setBookmark(address, BookmarkType.ERROR, "Relocations", message); + program.getBookmarkManager().setBookmark(address, BookmarkType.ERROR, "Relocations", + message); log.appendMsg(message); } @@ -1180,9 +1182,8 @@ public class MachoProgramBuilder { byte[] originalRelocationBytes = getOriginalRelocationBytes(relocation, relocationAddress); - program.getRelocationTable() - .add(relocationAddress, relocation.getType(), relocation.toValues(), - originalRelocationBytes, null); + program.getRelocationTable().add(relocationAddress, relocation.getType(), + relocation.toValues(), originalRelocationBytes, null); } private void addLibrary(String library) { @@ -1297,9 +1298,8 @@ public class MachoProgramBuilder { private void markAsThumb(Address address) throws ContextChangeException, AddressOverflowException { - if (!program.getLanguage() - .getProcessor() - .equals(Processor.findOrPossiblyCreateProcessor("ARM"))) { + if (!program.getLanguage().getProcessor().equals( + Processor.findOrPossiblyCreateProcessor("ARM"))) { return; } if ((address.getOffset() & 1) == 1) { @@ -1327,9 +1327,8 @@ public class MachoProgramBuilder { try { MemoryBlock memoryBlock = memory.getBlock(reference.getToAddress()); Namespace namespace = createNamespace(memoryBlock.getName()); - program.getSymbolTable() - .createLabel(reference.getToAddress(), fromSymbol.getName(), namespace, - SourceType.IMPORTED); + program.getSymbolTable().createLabel(reference.getToAddress(), + fromSymbol.getName(), namespace, SourceType.IMPORTED); } catch (Exception e) { //log.appendMsg("Unable to create lazy pointer symbol " + fromSymbol.getName() + " at " + reference.getToAddress()); @@ -1345,9 +1344,8 @@ public class MachoProgramBuilder { private Namespace createNamespace(String namespaceName) { try { - return program.getSymbolTable() - .createNameSpace(program.getGlobalNamespace(), namespaceName, - SourceType.IMPORTED); + return program.getSymbolTable().createNameSpace(program.getGlobalNamespace(), + namespaceName, SourceType.IMPORTED); } catch (DuplicateNameException | InvalidInputException e) { Namespace namespace = diff --git a/gradle/root/eclipse.gradle b/gradle/root/eclipse.gradle index 035602cd50..aa1d8a1732 100644 --- a/gradle/root/eclipse.gradle +++ b/gradle/root/eclipse.gradle @@ -127,15 +127,7 @@ eclipse { id = 'org.eclipse.ui.ide.multiFilter' arguments = '1.0-name-matches-false-false-GhidraDocs' } - } - resourceFilter { - appliesTo = 'FILES_AND_FOLDERS' - type = 'EXCLUDE_ALL' - matcher { - id = 'org.eclipse.ui.ide.multiFilter' - arguments = '1.0-name-matches-false-true-CabExtract' - } - } + } resourceFilter { appliesTo = 'FILES_AND_FOLDERS' type = 'EXCLUDE_ALL'