use of com.google.security.zynamics.binnavi.API.disassembly.Module in project binnavi by google.
the class ModuleFactory method get.
public static Module get(final INaviModule module, final SQLProvider provider) {
final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
final Database db = new Database(new MockDatabase());
return new Module(db, module, nodeTagManager, viewTagManager);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Module in project binnavi by google.
the class PluginInterface method showInWindow.
/**
* Shows a view in a given window.
*
* @param window The window where the view is shown.
* @param view The view to show.
*
* @return The view2d object that is shown.
*/
public View2D showInWindow(final GraphWindow window, final View view) {
Preconditions.checkNotNull(view, "Error: View argument can not be null");
final ViewContainer container = view.getContainer();
if (container instanceof Module) {
final Module module = (Module) container;
return show(window.getNative(), view, new CModuleContainer(container.getDatabase().getNative(), module.getNative()));
} else {
final Project project = (Project) container;
return show(window.getNative(), view, new CProjectContainer(container.getDatabase().getNative(), project.getNative()));
}
}
use of com.google.security.zynamics.binnavi.API.disassembly.Module in project binnavi by google.
the class BreakpointManagerTest method testGetEchoBreakpoint.
@Test
public void testGetEchoBreakpoint() {
try {
apiManager.getEchoBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
try {
apiManager.getEchoBreakpoint(null, new Address(0x123));
fail();
} catch (final NullPointerException exception) {
}
apiManager.setEchoBreakpoint(module, new Address(0x123));
final Breakpoint breakpoint = apiManager.getEchoBreakpoint(module, new Address(0x123));
assertEquals(0x123, breakpoint.getAddress().toLong());
final Module module = ModuleFactory.get();
apiManager.setEchoBreakpoint(module, new Address(0x123));
assertTrue(apiManager.hasEchoBreakpoint(module, new Address(0x123)));
final Breakpoint breakpoint2 = apiManager.getEchoBreakpoint(module, new Address(0x123));
assertEquals(0x123, breakpoint2.getAddress().toLong());
apiManager.removeEchoBreakpoint(module, new Address(0x123));
}
use of com.google.security.zynamics.binnavi.API.disassembly.Module in project binnavi by google.
the class DebuggerTest method testRelocation1.
@Test
public void testRelocation1() {
final INaviModule nativeModule = new MockModule();
mockDebugger.setAddressTranslator(nativeModule, new CAddress(100), new CAddress(200));
final Module module = ModuleFactory.get(nativeModule);
assertEquals(250, debugger.toImagebase(module, new Address(150)).toLong());
assertEquals(150, debugger.toFilebase(module, new Address(250)).toLong());
}
use of com.google.security.zynamics.binnavi.API.disassembly.Module in project binnavi by google.
the class PluginInterface method showInNewWindow.
/**
* Shows a view in a new window.
*
* @param view The view to show.
*
* @return The view2d object that is shown.
*/
public View2D showInNewWindow(final View view) {
Preconditions.checkNotNull(view, "Error: View argument can not be null");
final ViewContainer container = view.getContainer();
if (container instanceof Module) {
final Module module = (Module) container;
return show(null, view, new CModuleContainer(container.getDatabase().getNative(), module.getNative()));
} else {
final Project project = (Project) container;
return show(null, view, new CProjectContainer(container.getDatabase().getNative(), project.getNative()));
}
}
Aggregations