]> git.siccegge.de Git - frida/doc.git/commitdiff
Write some more API documentation
authorChristoph Egger <christoph@christoph-egger.org>
Mon, 12 Oct 2015 06:50:55 +0000 (08:50 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Mon, 12 Oct 2015 06:50:55 +0000 (08:50 +0200)
source/api.rst

index ad044f0e9d0ad6c55e44a76d8fd1ebc48d80d34c..c6e6624ad63a8a6c97bb6e5b615ee973444380be 100644 (file)
@@ -50,8 +50,19 @@ BasicBlock
 .. cpp:function:: void BasicBlock::setEndAddress(uint64_t address)
 .. cpp:function:: InformationManager* BasicBlock::getManager() const
 .. cpp:function:: uint64_t BasicBlock::getNextBlock(size_t index) const
 .. cpp:function:: void BasicBlock::setEndAddress(uint64_t address)
 .. cpp:function:: InformationManager* BasicBlock::getManager() const
 .. cpp:function:: uint64_t BasicBlock::getNextBlock(size_t index) const
+
+   index may either be 0 or 1 returning the following basic block. It
+   will only return a value different from ``NULL`` if the last
+   instruction was a conditional jump. In this case the Block returned
+   for 1 is the block reached when the jump is not taken
+
 .. cpp:function:: void BasicBlock::setNextBlock(size_t index, uint64_t address)
 .. cpp:function:: std::string BasicBlock::getName() const
 .. cpp:function:: void BasicBlock::setNextBlock(size_t index, uint64_t address)
 .. cpp:function:: std::string BasicBlock::getName() const
+
+   Returns a generated name for the block. This is only intended for
+   display. Currently it is ``BLOCK_startaddress_endaddress``. The
+   block may not be uniqly identified by the name
+
 .. cpp:function:: std::vector<Instruction> BasicBlock::getInstructions() const
 
 Comment
 .. cpp:function:: std::vector<Instruction> BasicBlock::getInstructions() const
 
 Comment
@@ -87,5 +98,66 @@ Comment
 InformationManager
 ------------------
 
 InformationManager
 ------------------
 
+.. cpp:class:: InformationManager
+
+   Core frida information storage. Keeps track of all known
+   information and notifies the consumers like the GUI of all changes
+   to its data structures
+
+.. cpp:function:: Disassembler* InformationManager::getDisassembler()
+
+.. cpp:function:: uint64_t InformationManager::getEntryAddress()
+
+   Returns the entry address of the binary as read from the ELF / COFF
+   header or 0 if the information is not available
+
+.. cpp:function:: Function* InformationManager::getFunction(uint64_t address)
+.. cpp:function:: std::map<uint64_t, Function*>::const_iterator \
+                                 InformationManager::beginFunctions()
+.. cpp:function:: std::map<uint64_t, Function*>::const_iterator \
+                                 InformationManager::endFunctions()
+
+.. cpp:function:: BasicBlock* InformationManager::getBasicBlock(uint64_t address)
+.. cpp:function:: std::map<uint64_t, BasicBlock*>::const_iterator \
+                                 InformationManager::beginBasicBlocks()
+.. cpp:function:: std::map<uint64_t, BasicBlock*>::const_iterator \
+                                 InformationManager::endBasicBlocks()
+
+.. cpp:function:: std::pair< \
+                                 std::multimap<uint64_t, Comment*>::const_iterator, \
+                                 std::multimap<uint64_t, Comment*>::const_iterator> \
+                                 InformationManager::getComments(uint64_t address)
+
+   There may be several comments for a given address and some of them
+   may be global comments while others are just local
+   ones. :cpp:func:`getComments` therefore returns an iterator over
+   all such :cpp:class:`Comments <Comment>`
+
+.. cpp:function:: std::multimap<uint64_t,Comment*>::const_iterator \
+                                 InformationManager::beginComments()
+.. cpp:function:: std::multimap<uint64_t,Comment*>::const_iterator \
+                                 InformationManager::endComments()
+
 Disassembler
 ------------
 Disassembler
 ------------
+
+.. cpp:class:: Disassembler
+
+   Interface implemented by all Disassemblers. Can be used by scripts
+   to start actions
+
+.. cpp:function:: Function * Disassembler::disassembleFunctionAt(uint64_t address)
+
+   Starts recursive disassembling starting at the given ``address``
+
+.. cpp:function:: Function * Disassembler::disassembleFunctionAt(uint64_t address, \
+   const std::string& name)
+
+   The same as :cpp:func:`Disassmebler::disassembleFunctionAt` but
+   also assigns the given name to the function starting at
+   ``address``. All further functions will get a default name again.
+
+.. cpp:function:: std::vector<Instruction> \
+                                 Disassembler::getInstructions(const BasicBlock* block)
+
+   Returns a stream of instructions making up the :cpp:class:`BasicBlock`