Skip to content

Commit

Permalink
Fixed startEA and endEA in the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmr232 committed Oct 15, 2019
1 parent 20c4366 commit f02b7e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/api/Code-Blocks.rst
Expand Up @@ -9,8 +9,8 @@ to as a flowchart.
>>> block = sark.CodeBlock()
>>> print(list(block.next))
[<CodeBlock(startEA=0x00417567, endEA=0x00417570)>,
<CodeBlock(startEA=0x0041759E, endEA=0x004175D4)>]
[<CodeBlock(start_ea=0x00417567, end_ea=0x00417570)>,
<CodeBlock(start_ea=0x0041759E, end_ea=0x004175D4)>]
Sark's ``CodeBlock`` object inherits from the ``idaapi.BasicBlock``
objects, and adds a few handy members.
Expand Down Expand Up @@ -67,16 +67,16 @@ was added.
The function returns a `NetworkX <https://networkx.github.io/>`__
``DiGraph`` object representing the flowchart, with each node being the
``startEA`` of a matching block. Using NetworkX's functionality, it is
``start_ea`` of a matching block. Using NetworkX's functionality, it is
easy to trace routes in the graph.

.. code:: python
>>> import networkx as nx
>>> func = sark.Function()
>>> graph = sark.get_nx_graph(func.ea)
>>> start_address = sark.get_block_start(func.startEA) # The `get_block_start(ea)` is short for `get_codeblock(ea).startEA`
>>> end_address = sark.get_block_start(func.endEA - 1) # Remember, `endEA` is outside the function!
>>> start_address = sark.get_block_start(func.start_ea) # The `get_block_start(ea)` is short for `get_codeblock(ea).start_ea`
>>> end_address = sark.get_block_start(func.end_ea - 1) # Remember, `end_ea` is outside the function!
>>> path = nx.shortest_path(graph, start_address, end_address)
>>> print("From {} to {}".format(hex(start_address), hex(end_address)))
From 0x417400L to 0x4176a6L
Expand Down
6 changes: 3 additions & 3 deletions docs/api/Functions.rst
Expand Up @@ -31,11 +31,11 @@ single object. Some useful members are:
+-------------+----------------------------------------------------------------+
| Member | Usage |
+=============+================================================================+
| startEA | starting address |
| start_ea | starting address |
+-------------+----------------------------------------------------------------+
| endEA | end address |
| end_ea | end address |
+-------------+----------------------------------------------------------------+
| ea | alias for ``startEA`` (for comparability with ``sark.Line``) |
| ea | alias for ``start_ea`` (for comparability with ``sark.Line``) |
+-------------+----------------------------------------------------------------+
| comments | function comments |
+-------------+----------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/api/IDB-Graphs.rst
Expand Up @@ -12,4 +12,4 @@ Getting IDB Graphs

To get an IDB graph, use ``sark.graph.get_idb_graph()``. The function traverses
all xrefs from and to all functions to create a graph of the IDB, with
each node being the address of a function's ``startEA``.
each node being the address of a function's ``start_ea``.
6 changes: 3 additions & 3 deletions docs/api/segments.rst
Expand Up @@ -27,11 +27,11 @@ single object. Some useful members are:
+-------------+----------------------------------------------------------------+
| Member | Usage |
+=============+================================================================+
| startEA | starting address |
| start_ea | starting address |
+-------------+----------------------------------------------------------------+
| endEA | end address |
| end_ea | end address |
+-------------+----------------------------------------------------------------+
| ea | alias for ``startEA`` (for comparability with ``sark.Segment``)|
| ea | alias for ``start_ea`` (for comparability with ``sark.Segment``)|
+-------------+----------------------------------------------------------------+
| comments | segment comments |
+-------------+----------------------------------------------------------------+
Expand Down

0 comments on commit f02b7e7

Please sign in to comment.