mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
New GhidraDev.
This commit is contained in:
parent
a004012c9a
commit
dcad9f3272
8 changed files with 97 additions and 49 deletions
|
@ -76,9 +76,9 @@ implements IWorkbenchPreferencePage {
|
|||
|
||||
// Description label
|
||||
Label descriptionLabel = new Label(container, SWT.NULL);
|
||||
descriptionLabel.setText("Add or remove Ghidra installations.\n" +
|
||||
descriptionLabel.setText("Add or remove Ghidra installation directories.\n" +
|
||||
"The checked Ghidra installation is the default used when creating new projects.\n" +
|
||||
"Red entries correspond to invalid Ghidra installations.");
|
||||
"Red entries correspond to invalid Ghidra installation directories.");
|
||||
new Label(container, SWT.NONE).setText(""); // filler
|
||||
|
||||
// Ghidra installations table
|
||||
|
|
|
@ -77,6 +77,10 @@ public class CreateGhidraModuleProjectWizard extends Wizard implements INewWizar
|
|||
|
||||
@Override
|
||||
public boolean performFinish() {
|
||||
if (!validate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File ghidraInstallDir = ghidraInstallationPage.getGhidraInstallDir();
|
||||
String projectName = projectPage.getProjectName();
|
||||
boolean createRunConfig = projectPage.shouldCreateRunConfig();
|
||||
|
@ -148,4 +152,20 @@ public class CreateGhidraModuleProjectWizard extends Wizard implements INewWizar
|
|||
monitor.done();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the wizard pages. If they are invalid, an error popup will be displayed which
|
||||
* will indicate the problem.
|
||||
*
|
||||
* @return True if the data returned from the wizard pages are valid; otherwise, false
|
||||
*/
|
||||
private boolean validate() {
|
||||
if (projectPage.getProjectDir().getAbsolutePath().startsWith(
|
||||
ghidraInstallationPage.getGhidraInstallDir().getAbsolutePath())) {
|
||||
EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory",
|
||||
"Project root directory cannot reside inside of the selected Ghidra installation directory.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.ui.INewWizard;
|
|||
import org.eclipse.ui.IWorkbench;
|
||||
|
||||
import ghidra.GhidraApplicationLayout;
|
||||
import ghidradev.EclipseMessageUtils;
|
||||
import ghidradev.ghidraprojectcreator.utils.GhidraScriptUtils;
|
||||
import ghidradev.ghidraprojectcreator.wizards.pages.*;
|
||||
|
||||
|
@ -68,6 +69,10 @@ public class CreateGhidraScriptProjectWizard extends Wizard implements INewWizar
|
|||
|
||||
@Override
|
||||
public boolean performFinish() {
|
||||
if (!validate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File ghidraInstallDir = ghidraInstallationPage.getGhidraInstallDir();
|
||||
String projectName = projectPage.getProjectName();
|
||||
File projectDir = projectPage.getProjectDir();
|
||||
|
@ -134,4 +139,20 @@ public class CreateGhidraScriptProjectWizard extends Wizard implements INewWizar
|
|||
monitor.done();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the wizard pages. If they are invalid, an error popup will be displayed which
|
||||
* will indicate the problem.
|
||||
*
|
||||
* @return True if the data returned from the wizard pages are valid; otherwise, false
|
||||
*/
|
||||
private boolean validate() {
|
||||
if (projectPage.getProjectDir().getAbsolutePath().startsWith(
|
||||
ghidraInstallationPage.getGhidraInstallDir().getAbsolutePath())) {
|
||||
EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory",
|
||||
"Project root directory cannot reside inside of the selected Ghidra installation directory.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue