use of com.google.security.zynamics.binnavi.disassembly.IAddressNode in project binnavi by google.
the class PostgreSQLEdgeLoader method initializeGlobalComment.
/**
* Initializes the global comment for an edge.
*
* @param edge The edge whose global comment is initialized.
* @param globalComments The global comment to set.
*/
private static void initializeGlobalComment(final CNaviViewEdge edge, final ArrayList<IComment> globalComments, final SQLProvider provider) {
final INaviViewNode source = edge.getSource();
final INaviViewNode target = edge.getTarget();
if ((source instanceof INaviCodeNode) && (target instanceof IAddressNode)) {
CommentManager.get(provider).initializeGlobalEdgeComment(edge, globalComments);
} else if ((source instanceof INaviFunctionNode) && (target instanceof IAddressNode)) {
CommentManager.get(provider).initializeGlobalEdgeComment(edge, globalComments);
}
}
use of com.google.security.zynamics.binnavi.disassembly.IAddressNode in project binnavi by google.
the class EdgeCache method addEdges.
public void addEdges(final List<INaviEdge> edges) {
final ImmutableMap<Integer, INaviEdge> edgesMap = Maps.uniqueIndex(edges, new Function<INaviEdge, Integer>() {
@Override
public Integer apply(final INaviEdge edge) {
return edge.getId();
}
});
edgesByIdCache.putAll(edgesMap);
for (final INaviEdge edge : edges) {
if (edge.getSource() instanceof IAddressNode && edge.getTarget() instanceof IAddressNode) {
final IAddress sourceAddress = ((IAddressNode) edge.getSource()).getAddress();
final IAddress targetAddress = ((IAddressNode) edge.getTarget()).getAddress();
Integer sourceModuleId = null;
Integer targetModuleId = null;
if (edge.getSource() instanceof INaviCodeNode) {
sourceModuleId = getModuleId((INaviCodeNode) edge.getSource());
} else if (edge.getSource() instanceof INaviFunctionNode) {
sourceModuleId = getModuleId((INaviFunctionNode) edge.getSource());
}
if (edge.getTarget() instanceof INaviCodeNode) {
targetModuleId = getModuleId((INaviCodeNode) edge.getTarget());
} else if (edge.getTarget() instanceof INaviFunctionNode) {
targetModuleId = getModuleId((INaviFunctionNode) edge.getTarget());
}
if (targetModuleId != null && sourceModuleId != null) {
UpdateAddressModuleIdCache(sourceAddress, sourceModuleId, targetAddress, targetModuleId, edge);
}
}
}
}
Aggregations