Package Libs :: Module immvcglib
[hide private]
[frames] | no frames]

Module immvcglib

source code

Reads vcg buffer and creates the graph using Immunity Debugger lib

(c) Immunity, Inc. 2004-2007

Immunity Inc.

Classes [hide private]
  graphTree
  ParseVCGList
recursive VCG parser

Functions [hide private]
  testVCGParse(path)
test our new VCG parsing logic
  generateGraphFromBuf(buf)
  generateGraph(address)
generates a VCG given a function address
  adjustStartCoords(vertices, G)
  createVertexList(nodes, handler)
iterate vcg file to get vertex list and vertices's buffers
  finalAttemptToPlace(vertices)
  searchForDummyPathsH2South(edgelist, vertices)
  searchForDummyPathsH2North(edgelist, vertices)
  applyDummyPathsH2SouthTrue(vertexlist, edgelist)
  applyDummyPathsH2South(vertexlist, edgelist)
  applyDummyPathsH2North2(vertexlist, edgelist)
  applyDummyPathsH2North(vertexlist, edgelist)
  searchForDummyPathsW(edgelist, vertices)
  pathFinder(vertices)
find edge's path To find an endge path we start joining two vertex with 3 basic strokes, A -> B -> C after placing each of this basci strokes we check if it is not overlapping a vertex, if so we decide a alternate path based on dummy blank points A -> A' -> A'' -> B -> C where A' (x2,y2) is the original A (x2,y2) so the next basic stroke B, knows how to keep going
  addEndPointToEdge(edgelist)
  drawVertices(vertices)
  drawEdges(edgelist, handler)
  createAdjacencyList(G, vertices, edges)
creates a directed adjacency list for every vertex
  checkPlanarity(vertices)
  firstAttemptToPlace(vertices)
First attempt to place vertices We are going to suppose Graph is planar and attempt to place vertices directly, in real world this wont happens, but at least we'll have temptative coords for every vertex
  checkForPlacedVertex(vertex2check, vertices)
Note: needs to divide graph in layers
  checkForPlacedVertex2(vertex2check, vertices)
Note: needs to divide graph in layers
  defineVertexRelation(vertices)
  generateVCG(address)
this function will generate a vcg compatible buffer to create the graph
  saveVCG(address, filename)

Variables [hide private]
  __VERSION__ = '1.2'
...
  PALETTE = ['manhattan_edges: yes\r\n', 'layoutalgorithm: minde...

Function Details [hide private]

testVCGParse(path)

source code 
test our new VCG parsing logic

generateGraphFromBuf(buf)

source code 
None

generateGraph(address)

source code 
generates a VCG given a function address

adjustStartCoords(vertices, G)

source code 
None

createVertexList(nodes, handler)

source code 
iterate vcg file to get vertex list and vertices's buffers

finalAttemptToPlace(vertices)

source code 
None

searchForDummyPathsH2South(edgelist, vertices)

source code 
None

searchForDummyPathsH2North(edgelist, vertices)

source code 
None

applyDummyPathsH2SouthTrue(vertexlist, edgelist)

source code 
None

applyDummyPathsH2South(vertexlist, edgelist)

source code 
None

applyDummyPathsH2North2(vertexlist, edgelist)

source code 
None

applyDummyPathsH2North(vertexlist, edgelist)

source code 
None

searchForDummyPathsW(edgelist, vertices)

source code 
None

pathFinder(vertices)

source code 
find edge's path To find an endge path we start joining two vertex with 3 basic strokes, A -> B -> C after placing each of this basci strokes we check if it is not overlapping a vertex, if so we decide a alternate path based on dummy blank points A -> A' -> A'' -> B -> C where A' (x2,y2) is the original A (x2,y2) so the next basic stroke B, knows how to keep going

addEndPointToEdge(edgelist)

source code 
None

drawVertices(vertices)

source code 
None

drawEdges(edgelist, handler)

source code 
None

createAdjacencyList(G, vertices, edges)

source code 
creates a directed adjacency list for every vertex

checkPlanarity(vertices)

source code 
None

firstAttemptToPlace(vertices)

source code 
First attempt to place vertices We are going to suppose Graph is planar and attempt to place vertices directly, in real world this wont happens, but at least we'll have temptative coords for every vertex

checkForPlacedVertex(vertex2check, vertices)

source code 

Note: needs to divide graph in layers

Draft notes: step 1 get temptative coords to place vertex step 2 check if coords overlaps already placed vertex

step 2 a) first we have to check if (y,y2) of vertex is in range of the placed vertex,

if y >= yp and y <= y2p or y2 >= yp and y2 <= y2p:

if that condition is true, means we have a vertex in the same y that an already placed vertex, so it might be possible of an overlapping to exists, so we are going to ask:

if x >= xp and x <= x2p: if that condition is true, then we have an overlapping over the y coord of the vertex (left point)

if x2 >= xp and x <= x2p: if that condition is true, then we have an overlapping over the y coord of the vertex (right point)

and if does, check whether x or x2 is overlapping once we know that, we need to check wheter x or x2 of overlapped vertex is touched if x , move west x - 10 and recheck

checkForPlacedVertex2(vertex2check, vertices)

source code 

Note: needs to divide graph in layers

Draft notes: step 1 get temptative coords to place vertex step 2 check if coords overlaps already placed vertex

step 2 a) first we have to check if (y,y2) of vertex is in range of the placed vertex,

if y >= yp and y <= y2p or y2 >= yp and y2 <= y2p:

if that condition is true, means we have a vertex in the same y that an already placed vertex, so it might be possible of an overlapping to exists, so we are going to ask:

if x >= xp and x <= x2p: if that condition is true, then we have an overlapping over the y coord of the vertex (left point)

if x2 >= xp and x <= x2p: if that condition is true, then we have an overlapping over the y coord of the vertex (right point)

and if does, check whether x or x2 is overlapping once we know that, we need to check wheter x or x2 of overlapped vertex is touched if x , move west x - 10 and recheck

defineVertexRelation(vertices)

source code 
None

generateVCG(address)

source code 
this function will generate a vcg compatible buffer to create the graph

saveVCG(address, filename)

source code 
None

Variables Details [hide private]

__VERSION__


NOTES:
need to divide graph in layers
save max layer in graph
every set of childs [unique and different part vertex] E a different layer
save vertex of layer in each layer
mark blank path points in each layer [i preffer path points to dummy vertices] 

for layer in layers:
   move east and west vertices, depending on their type *

pathfinder(graph)
  search empy spots where edge lines might travel
  
  
a cool thing might be mark the whole graph as east-slanted or west-slanted, according the graph
the n east or n west it will move

if the graph is slanting too much to east from center point, we can start thinking on going west
that can be too fuzzy, but will try to make an aproach for human eye


new lib against old lib:
orphan vertices from old lib has been solved, now every vertex has at least 1 relationship saved 
parent<->child type of vertex are correctly relationed now

Value:
'1.2'                                                                  
      

PALETTE

None
Value:
['manhattan_edges: yes\r\n',
 'layoutalgorithm: mindepth\r\n',
 'finetuning: no\r\n',
 'layout_downfactor: 100\r\n',
 'layout_upfactor: 0\r\n',
 'layout_nearfactor: 0\r\n',
 'xlspace: 12\r\n',
 'yspace: 30\r\n',
...