Search in sources :

Example 6 with TagManager

use of com.google.security.zynamics.binnavi.API.disassembly.TagManager in project binnavi by google.

the class TagManagerTest method testGetTag.

@Test
public void testGetTag() throws com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException {
    final TreeNode<CTag> rootNode = new TreeNode<CTag>(new CTag(1, "root", "", TagType.NODE_TAG, m_provider));
    final Tree<CTag> tree = new Tree<CTag>(rootNode);
    final ITagManager manager = new CTagManager(tree, TagType.NODE_TAG, m_provider);
    final ITreeNode<CTag> secondNode = manager.addTag(rootNode, "2nd");
    final ITreeNode<CTag> thirdNode = manager.addTag(rootNode, "3rd");
    final TagManager tagManager = new TagManager(manager);
    assertNotNull(tagManager.getTag(rootNode.getObject()));
    assertNotNull(tagManager.getTag(secondNode.getObject()));
    assertNotNull(tagManager.getTag(thirdNode.getObject()));
}
Also used : ITagManager(com.google.security.zynamics.binnavi.Tagging.ITagManager) TagManager(com.google.security.zynamics.binnavi.API.disassembly.TagManager) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) ITagManager(com.google.security.zynamics.binnavi.Tagging.ITagManager) TreeNode(com.google.security.zynamics.zylib.types.trees.TreeNode) ITreeNode(com.google.security.zynamics.zylib.types.trees.ITreeNode) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) Tree(com.google.security.zynamics.zylib.types.trees.Tree) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) Test(org.junit.Test)

Example 7 with TagManager

use of com.google.security.zynamics.binnavi.API.disassembly.TagManager in project binnavi by google.

the class ModuleFactory method get.

public static Module get(final INaviModule module) {
    final MockSqlProvider provider = new MockSqlProvider();
    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);
}
Also used : TagManager(com.google.security.zynamics.binnavi.API.disassembly.TagManager) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Database(com.google.security.zynamics.binnavi.API.disassembly.Database) Tree(com.google.security.zynamics.zylib.types.trees.Tree) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) Module(com.google.security.zynamics.binnavi.API.disassembly.Module) CModule(com.google.security.zynamics.binnavi.disassembly.Modules.CModule)

Example 8 with TagManager

use of com.google.security.zynamics.binnavi.API.disassembly.TagManager 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);
}
Also used : TagManager(com.google.security.zynamics.binnavi.API.disassembly.TagManager) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Database(com.google.security.zynamics.binnavi.API.disassembly.Database) Tree(com.google.security.zynamics.zylib.types.trees.Tree) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) Module(com.google.security.zynamics.binnavi.API.disassembly.Module) CModule(com.google.security.zynamics.binnavi.disassembly.Modules.CModule)

Example 9 with TagManager

use of com.google.security.zynamics.binnavi.API.disassembly.TagManager in project binnavi by google.

the class ModuleFactory method get.

public static Module get() {
    final MockSqlProvider provider = new MockSqlProvider();
    final Date creationDate = new Date();
    final Date modificationDate = new Date();
    final CModule internalModule = new CModule(123, "Name", "Comment", creationDate, modificationDate, "12345678123456781234567812345678", "1234567812345678123456781234567812345678", 55, 66, new CAddress(0x555), new CAddress(0x666), new DebuggerTemplate(1, "Mock Debugger", "localhaus", 88, provider), null, Integer.MAX_VALUE, false, 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, internalModule, nodeTagManager, viewTagManager);
}
Also used : DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) Date(java.util.Date) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) TagManager(com.google.security.zynamics.binnavi.API.disassembly.TagManager) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Database(com.google.security.zynamics.binnavi.API.disassembly.Database) Tree(com.google.security.zynamics.zylib.types.trees.Tree) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) Module(com.google.security.zynamics.binnavi.API.disassembly.Module) CModule(com.google.security.zynamics.binnavi.disassembly.Modules.CModule) CModule(com.google.security.zynamics.binnavi.disassembly.Modules.CModule)

Example 10 with TagManager

use of com.google.security.zynamics.binnavi.API.disassembly.TagManager in project binnavi by google.

the class DatabaseTest method testViewTagManager.

@Test
public void testViewTagManager() {
    final MockDatabase mockDatabase = new MockDatabase();
    final Database database = new Database(mockDatabase);
    final TagManager manager1 = database.getViewTagManager();
    final TagManager manager2 = database.getViewTagManager();
    assertNotNull(manager1);
    assertEquals(manager1, manager2);
}
Also used : TagManager(com.google.security.zynamics.binnavi.API.disassembly.TagManager) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Database(com.google.security.zynamics.binnavi.API.disassembly.Database) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Test(org.junit.Test)

Aggregations

TagManager (com.google.security.zynamics.binnavi.API.disassembly.TagManager)10 Database (com.google.security.zynamics.binnavi.API.disassembly.Database)9 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)8 CTagManager (com.google.security.zynamics.binnavi.Tagging.CTagManager)8 Tree (com.google.security.zynamics.zylib.types.trees.Tree)8 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)7 Module (com.google.security.zynamics.binnavi.API.disassembly.Module)6 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)6 CModule (com.google.security.zynamics.binnavi.disassembly.Modules.CModule)4 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)3 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)3 ITreeNode (com.google.security.zynamics.zylib.types.trees.ITreeNode)3 TreeNode (com.google.security.zynamics.zylib.types.trees.TreeNode)3 Date (java.util.Date)3 Before (org.junit.Before)3 Test (org.junit.Test)3 Project (com.google.security.zynamics.binnavi.API.disassembly.Project)2 CDatabase (com.google.security.zynamics.binnavi.Database.CDatabase)2 SQLProvider (com.google.security.zynamics.binnavi.Database.Interfaces.SQLProvider)2 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)2