use of com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace in project binnavi by google.
the class Project method convertData.
/**
* Converts the internal project data to API project data.
*/
private void convertData() {
m_debuggerTemplates = new FilledList<DebuggerTemplate>();
final List<DebuggerTemplate> apiTemplates = m_database.getDebuggerTemplateManager().getDebuggerTemplates();
for (final com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate debuggerTemplate : m_project.getConfiguration().getDebuggers()) {
m_debuggerTemplates.add(ObjectFinders.getObject(debuggerTemplate, apiTemplates));
}
m_traces = new FilledList<Trace>();
for (final TraceList trace : m_project.getContent().getTraces()) {
m_traces.add(new Trace(trace));
}
m_addressSpaces = new FilledList<AddressSpace>();
for (final INaviAddressSpace addressSpace : m_project.getContent().getAddressSpaces()) {
m_addressSpaces.add(new AddressSpace(m_database, this, addressSpace));
}
m_views = new FilledList<View>();
for (final INaviView view : m_project.getContent().getViews()) {
m_views.add(new View(this, view, m_nodeTagManager, m_viewTagManager));
}
}
use of com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace in project binnavi by google.
the class CAddressSpaceNodeMenuBuilder method getPluginAddressSpaces.
/**
* Returns the API address space objects for the address spaces for which the menu was built.
*
* @return The API address space objects.
*/
private List<AddressSpace> getPluginAddressSpaces() {
final DatabaseManager manager = PluginInterface.instance().getDatabaseManager();
for (final Database database : manager) {
if (database.getNative() == m_database) {
for (final Project project : database.getProjects()) {
if (project.getNative() == m_project) {
final List<AddressSpace> allSpaces = project.getAddressSpaces();
final List<AddressSpace> menuSpaces = new ArrayList<AddressSpace>();
for (final INaviAddressSpace addressSpace : m_addressSpaces) {
menuSpaces.add(ObjectFinders.getObject(addressSpace, allSpaces));
}
return menuSpaces;
}
}
}
}
throw new IllegalStateException("IE01159: Unknown database");
}
use of com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace in project binnavi by google.
the class CAddressSpaceFunctions method loadAddressSpaces.
/**
* Loads one or more address spaces.
*
* @param projectTree Project tree of the main window.
* @param addressSpaces The address spaces to load.
*/
public static void loadAddressSpaces(final JTree projectTree, final INaviAddressSpace[] addressSpaces) {
new Thread() {
@Override
public void run() {
final CDefaultProgressOperation operation = new CDefaultProgressOperation("Loading address spaces", false, true);
operation.getProgressPanel().setMaximum(addressSpaces.length);
for (final INaviAddressSpace addressSpace : addressSpaces) {
operation.getProgressPanel().setText("Loading address spaces" + ": '" + addressSpace.getConfiguration().getName() + "'");
try {
addressSpace.load();
new SwingInvoker() {
@Override
protected void operation() {
CNodeExpander.expandNode(projectTree, addressSpace);
}
}.invokeLater();
} catch (final CouldntLoadDataException exception) {
CUtilityFunctions.logException(exception);
final String message = "E00109: " + "Address space could not be loaded";
final String description = CUtilityFunctions.createDescription(String.format("The address space '%s' could not be loaded. Try loading the address space again. If the problem persists, disconnect from and reconnect to the database, restart com.google.security.zynamics.binnavi, or contact the BinNavi support.", addressSpace.getConfiguration().getName()), new String[] { "Database connection problems." }, new String[] { "The address space was not loaded." });
NaviErrorDialog.show(SwingUtilities.getWindowAncestor(projectTree), message, description, exception);
} catch (final LoadCancelledException e) {
// Do nothing
} finally {
operation.getProgressPanel().next();
}
}
operation.stop();
}
}.start();
}
use of com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace in project binnavi by google.
the class CProjectFunctions method removeAddressSpace.
/**
* Removes an address spaces from a project.
*
* @param parent Parent window used for dialogs.
* @param project The project the address space belongs to.
* @param addressSpaces The address spaces to be removed from the project.
* @param updater Updates the project tree after the address space was removed.
*/
public static void removeAddressSpace(final JFrame parent, final INaviProject project, final INaviAddressSpace[] addressSpaces, final ITreeUpdater updater) {
if (CMessageBox.showYesNoQuestion(parent, String.format("Do you really want to delete the following address spaces from the project?\n\n%s", CNameListGenerators.getNameList(addressSpaces))) == JOptionPane.YES_OPTION) {
for (final INaviAddressSpace addressSpace : addressSpaces) {
new Thread() {
@Override
public void run() {
final CDefaultProgressOperation operation = new CDefaultProgressOperation("", false, true);
operation.getProgressPanel().setMaximum(1);
operation.getProgressPanel().setText("Removing address space" + ": " + addressSpace.getConfiguration().getName());
operation.getProgressPanel().next();
if (addressSpace.isLoaded()) {
addressSpace.close();
}
if (addressSpace.isLoaded()) {
final String innerMessage = "E00123: " + "Address space could not be deleted";
final String innerDescription = CUtilityFunctions.createDescription(String.format("BinNavi could not delete the address space '%s'.", addressSpace.getConfiguration().getName()), new String[] { "BinNavi or one of the active plugins vetoed the deletion " + "operation." }, new String[] { "The address space can not be deleted until the delete " + "operation is not vetoed anymore." });
NaviErrorDialog.show(parent, innerMessage, innerDescription);
} else {
try {
project.getContent().removeAddressSpace(addressSpace);
updater.update();
} catch (final CouldntDeleteException exception) {
CUtilityFunctions.logException(exception);
final String innerMessage = "E00143: " + "Address space could not be deleted";
final String innerDescription = CUtilityFunctions.createDescription("The selected address space could not be deleted.", new String[] { "There was a problem with the database connection." }, new String[] { "The address space was not deleted." });
NaviErrorDialog.show(parent, innerMessage, innerDescription, exception);
}
}
operation.stop();
}
}.start();
}
}
}
use of com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace in project binnavi by google.
the class CAddressSpaceNode method doubleClicked.
@Override
public void doubleClicked() {
if (!m_addressSpace.isLoaded()) {
final Action action = CActionProxy.proxy(new CLoadAddressSpaceAction(getProjectTree(), new INaviAddressSpace[] { m_addressSpace }));
action.actionPerformed(new ActionEvent(this, 0, ""));
}
}
Aggregations