From: Christoph Egger Date: Mon, 12 Oct 2015 06:50:55 +0000 (+0200) Subject: Write some more API documentation X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Fdoc.git;a=commitdiff_plain;h=647b90a987eeff96ba3d36db388a01ab6810c07f Write some more API documentation --- diff --git a/source/api.rst b/source/api.rst index ad044f0..c6e6624 100644 --- a/source/api.rst +++ b/source/api.rst @@ -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 + + 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 + + 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 BasicBlock::getInstructions() const Comment @@ -87,5 +98,66 @@ Comment 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::const_iterator \ + InformationManager::beginFunctions() +.. cpp:function:: std::map::const_iterator \ + InformationManager::endFunctions() + +.. cpp:function:: BasicBlock* InformationManager::getBasicBlock(uint64_t address) +.. cpp:function:: std::map::const_iterator \ + InformationManager::beginBasicBlocks() +.. cpp:function:: std::map::const_iterator \ + InformationManager::endBasicBlocks() + +.. cpp:function:: std::pair< \ + std::multimap::const_iterator, \ + std::multimap::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 ` + +.. cpp:function:: std::multimap::const_iterator \ + InformationManager::beginComments() +.. cpp:function:: std::multimap::const_iterator \ + InformationManager::endComments() + 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 \ + Disassembler::getInstructions(const BasicBlock* block) + + Returns a stream of instructions making up the :cpp:class:`BasicBlock`