use of com.google.security.zynamics.binnavi.API.disassembly.TagManager in project binnavi by google.
the class ProjectFactory method get.
public static Project get() {
final MockSqlProvider provider = new MockSqlProvider();
final Date creationDate = new Date();
final Date modificationDate = new Date();
final CProject internalProject = new CProject(123, "Name", "Comment", creationDate, modificationDate, 55, new FilledList<DebuggerTemplate>(), 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 Project(db, internalProject, nodeTagManager, viewTagManager);
}
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()));
}
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);
}
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);
}
use of com.google.security.zynamics.binnavi.API.disassembly.TagManager in project binnavi by google.
the class TraceLoggerTest method setUp.
@Before
public void setUp() throws CouldntLoadDataException, InvalidDatabaseVersionException {
final SQLProvider mockProvider = new MockSqlProvider();
// CDatabase("", "", "", "", "", false,
final IDatabase internalDatabase = new MockDatabase();
// false);
final Database database = new Database(internalDatabase);
database.load();
final MockProject mockProject = new MockProject();
final ITreeNode<CTag> nodeRootNode = new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, mockProvider));
final Tree<CTag> nodeTagTree = new Tree<CTag>(nodeRootNode);
final TagManager nodeTagManager = new TagManager(new CTagManager(nodeTagTree, TagType.NODE_TAG, mockProvider));
final ITreeNode<CTag> viewRootNode = new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, mockProvider));
final Tree<CTag> viewTagTree = new Tree<CTag>(viewRootNode);
final TagManager viewTagManager = new TagManager(new CTagManager(viewTagTree, TagType.VIEW_TAG, mockProvider));
final Module module = new Module(database, mockModule, nodeTagManager, viewTagManager);
final Project project = new Project(database, mockProject, nodeTagManager, viewTagManager);
m_mockModule = new Module(database, mockModule, viewTagManager, nodeTagManager);
m_debugSettings = new ModuleTargetSettings(m_mockModule.getNative());
m_mockDebugger = new MockDebugger(m_debugSettings);
m_mockDebugger.setAddressTranslator(mockModule, new CAddress(0), new CAddress(0x1000));
final Debugger debugger = new Debugger(m_mockDebugger);
m_logger = new TraceLogger(debugger, module);
m_projectLogger = new TraceLogger(debugger, project);
}
Aggregations