Skip to content

Commit

Permalink
Fixed some unresolved NIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Strelsky committed May 27, 2021
1 parent b8a1282 commit 4a8a4e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ def ghidraUserDir = System.getProperty("user.home") + "/.ghidra/.${DISTRO_PREFIX
repositories { mavenCentral() }

dependencies {
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "org.jmockit:jmockit:1.44"
testCompile "junit:junit:4.12"
runtimeOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Configurations', include: "**/*.jar")
compile fileTree(dir: ghidraInstallDir + '/Ghidra/Extensions',
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Extensions',
include: "**/*.jar", exclude: project.name + '**')
runtimeOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Framework', include: "**/*.jar")
runtimeOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Features', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Processors', include: "**/*.jar")
compileOnly fileTree(dir: ghidraUserDir + "/Extensions",
include: "**/*.jar", exclude: project.name)
runtimeOnly "org.apache.commons:commons-lang3:3.9"
runtimeOnly fileTree(dir: 'data')
}

eclipse {
Expand Down
27 changes: 13 additions & 14 deletions src/main/java/orbis/analysis/NIDAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,23 @@ private static class NIDResolver {
void resolve(Symbol s) throws Exception {
Namespace ns = s.getParentNamespace();
String name = s.getName();
if (name.length() < 11 || name.length() > 15) {
return;
}
if (name.charAt(11) != '#') {
if (name.length() < 11 || name.charAt(11) != '#') {
return;
}
int i = getIndex(name.charAt(12));
if (name.charAt(13) == '#') {
if (importMan.containsLibrary(i)) {
ns = getExternalLibrary(i);
if (name.length() <= 15) {
if (name.charAt(13) == '#') {
if (importMan.containsLibrary(i)) {
ns = getExternalLibrary(i);
}
} else if (name.charAt(14) == '#') {
i += getIndex(name.charAt(13));
if (importMan.containsLibrary(i)) {
ns = getExternalLibrary(i);
}
} else {
return;
}
} else if (name.charAt(14) == '#') {
i += getIndex(name.charAt(13));
if (importMan.containsLibrary(i)) {
ns = getExternalLibrary(i);
}
} else {
return;
}
name = name.substring(0, 11);
if (db.containsKey(name)) {
Expand Down

0 comments on commit 4a8a4e7

Please sign in to comment.