Skip to content

Commit

Permalink
Final minor tweaks for CodeCut 1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
evm-sec committed Nov 22, 2023
1 parent b1a348b commit 44dbcdc
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 32 deletions.
3 changes: 1 addition & 2 deletions codecut-gui/src/main/java/codecutguiv2/CodeCutGUIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public class CodeCutGUIPlugin extends Plugin implements DomainObjectListener {
final static Cursor NORM_CURSOR = new Cursor(Cursor.DEFAULT_CURSOR);

private final static String OPTION_NAME_PYTHON_EXEC = "Python Executable";
private final static String OPTION_DEFAULT_PYTHON_EXEC = "/projects/venv/bin/python3";
//private final static String OPTION_DEFAULT_PYTHON_EXEC = "/usr/local/bin/python3"; // for testing
private final static String OPTION_DEFAULT_PYTHON_EXEC = "/usr/bin/python3";
private String pythonExec = OPTION_DEFAULT_PYTHON_EXEC;

private DockingAction openRefsAction;
Expand Down
7 changes: 5 additions & 2 deletions codecut-gui/src/main/java/codecutguiv2/CodecutUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ public static List<Namespace> getAllNamespaces(Program program) {
SymbolType type = symbol.getSymbolType();
if (type == SymbolType.FUNCTION) {
Namespace ns = ((Function)symbol.getObject()).getParentNamespace();
if (!namespaceList.contains(ns)) {
namespaceList.add(ns);
//make sure it's a "real" namespace with a body - otherwise we can't work with it
if ((ns.getBody().getMinAddress() != null) && (ns.getBody().getMaxAddress() != null)) {
if (!namespaceList.contains(ns)) {
namespaceList.add(ns);
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion codecut-gui/src/main/java/codecutguiv2/CombineProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ class CombineProvider extends ComponentProviderAdapter implements ActionListener
private Namespace firstNamespace;
private Namespace secondNamespace;
private Namespace combinedNamespace;
private SymbolProvider symProvider;

CombineProvider(CodeCutGUIPlugin plugin) {
super(plugin.getTool(), "Combine Namespaces", plugin.getName(), ProgramActionContext.class);
this.plugin = plugin;
symProvider = plugin.getSymbolProvider();

setIcon(ICON);
addToToolbar();
Expand Down Expand Up @@ -241,12 +243,12 @@ else if (nS == this.secondNamespace) {

}
}

}
}

this.closeComponent();

symProvider.reload();


}
Expand Down
6 changes: 5 additions & 1 deletion codecut-gui/src/main/java/codecutguiv2/CreateProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ class CreateProvider extends ComponentProviderAdapter implements ActionListener

private Namespace namespace;
private Symbol symbol;
private SymbolProvider symProvider;

CreateProvider(CodeCutGUIPlugin plugin) {
super(plugin.getTool(), "Create Namespace", plugin.getName(), ProgramActionContext.class);
this.plugin = plugin;

symProvider = plugin.getSymbolProvider();

setIcon(ICON);
addToToolbar();
Expand Down Expand Up @@ -141,9 +144,10 @@ public void actionPerformed(ActionEvent e) {
Msg.info(this, "Exception when attempting to change namespace of symbol "
+ this.symbol.getName() + " to " + nS.getName());
}

this.closeComponent();

symProvider.reload();
}
}

Expand Down
7 changes: 6 additions & 1 deletion codecut-gui/src/main/java/codecutguiv2/NamespacePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ public int compare(Namespace ns1, Namespace ns2) {

Namespace ns = it.next();
AddressSetView ar = ns.getBody();
Msg.info(this, "Add: " + ns.getName() + " " + ar.getMinAddress().toString() + " " + ar.getMaxAddress().toString());
if ((ar.getMinAddress() != null) && (ar.getMaxAddress() != null)) {
Msg.info(this, "Add: " + ns.getName() + " " + ar.getMinAddress().toString() + " " + ar.getMaxAddress().toString());
}
else {
Msg.info(this, "Add: " + ns.getName() + " null min or max??");
}
SymbolIterator symIter = this.program.getSymbolTable().getSymbols(ns);
SymbolTableModel model = new SymbolTableModel(this.program, this.symProvider, this.tool, symIter, ns);

Expand Down
3 changes: 3 additions & 0 deletions codecut-gui/src/main/java/codecutguiv2/RenameProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ class RenameProvider extends ComponentProviderAdapter implements ActionListener
private JButton button;

private Namespace namespace;
private SymbolProvider symProvider;

RenameProvider(CodeCutGUIPlugin plugin) {
super(plugin.getTool(), "Rename Namespace", plugin.getName(), ProgramActionContext.class);
this.plugin = plugin;
symProvider = plugin.getSymbolProvider();

setIcon(ICON);
addToToolbar();
Expand Down Expand Up @@ -172,6 +174,7 @@ public void actionPerformed(ActionEvent e) {
this.closeComponent();
}
}
symProvider.reload();
}

}
Expand Down
23 changes: 0 additions & 23 deletions deepcut-ghidra/src/main/help/help/topics/deepcut/help.html

This file was deleted.

2 changes: 1 addition & 1 deletion deepcut-ghidra/src/main/java/deepcut/DeepCutAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class DeepCutAnalyzer extends AbstractAnalyzer {

private final static String OPTION_NAME_PYTHON_EXEC = "Python Executable";
private final static String OPTION_DESCRIPTION_PYTHON_EXEC = "";
private final static String OPTION_DEFAULT_PYTHON_EXEC = "/projects/venv/bin/python3";
private final static String OPTION_DEFAULT_PYTHON_EXEC = "/usr/bin/python3";
private String pythonExec = OPTION_DEFAULT_PYTHON_EXEC;

public DeepCutAnalyzer() {
Expand Down
2 changes: 1 addition & 1 deletion deepcut-ghidra/src/main/java/deepcut/DeepCutPython.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void startProcess() throws IOException {

process = runtime.exec(exec);

// Yes this is confusing. stdin is a Java OutputStream, stdin is an InputStream
// Yes this is confusing. stdin is a Java OutputStream, stdout is an InputStream
stdin = process.getOutputStream();
stdout = process.getInputStream();
stderr = process.getErrorStream();
Expand Down

0 comments on commit 44dbcdc

Please sign in to comment.