From 6a92b015ad707daad3cb75d9e4bf89f1de2d578e Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Sat, 10 Oct 2015 18:52:42 +0200 Subject: [PATCH] Start documentation of scripting API --- source/api.rst | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ source/index.rst | 3 +- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 source/api.rst diff --git a/source/api.rst b/source/api.rst new file mode 100644 index 0000000..ad044f0 --- /dev/null +++ b/source/api.rst @@ -0,0 +1,91 @@ +API +=== + +The APIs for the individual programming languages all derive from the +C++ structure of ``src/core`` adapted to the native spelling of the +respective programming language. As an example, all from within guile +all methods are available as ``classname-functionname`` with +name-components separated by dashes instead of CamelCase. + +Function +-------- + +.. cpp:class:: Function + + Represents a function in the binary. Functions are typically the + target of ``call`` instructions and are composed of + :cpp:class:`BasicBlock` + +.. cpp:function:: std::string Function::getName() const + + Returns the Name of the function + +.. cpp:function:: void Function::setName(const std::string& new_name) + + Updates the Name of the Function. Also takes care to notify all + consumers of the changed name so the new name is displayed + consistently + +.. cpp:function:: bool Function::isDynamic() const + + Returns whether the Function is of the dynamic type. Dynamic + functions are the ones which are imported from shared libraries and + not structly part of the binary at hand. + +.. cpp:function:: uint64_t Function::getStartAddress() const + +.. cpp:function:: InformationManager* Function::getManager() const + +.. cpp:function:: void Function::addBasicBlock(BasicBlock* block) + +.. cpp:function:: const std::map& Function::blocks() + +BasicBlock +---------- +.. cpp:class:: BasicBlock + +.. cpp:function:: uint64_t BasicBlock::getStartAddress() const +.. cpp:function:: uint64_t BasicBlock::getEndAddress() const +.. cpp:function:: void BasicBlock::setStartAddress(uint64_t address) +.. 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::setNextBlock(size_t index, uint64_t address) +.. cpp:function:: std::string BasicBlock::getName() const +.. cpp:function:: std::vector BasicBlock::getInstructions() const + +Comment +------- + +.. cpp:class:: Comment + +.. cpp:function:: bool Comment::isLocal() const + + Comments, which are valid for every instance of an address are + considered *global* while comments only valid within the + context of the current function are considered *local* + +.. cpp:function:: void Comment::setText(const std::string& text) + + Updates the text of an comment and takes care of notifying all + consumers of the change. + +.. cpp:function:: std::string Comment::getText() const + + Returns the current text of the comment without any :doc:`macros` expanded. + +.. cpp:function:: uint64_t Comment::getAddress() + + Returns address this comment talks about + +.. cpp:function:: Function* Comment::getLocation() + + Returns the function, the comment talks about, or NULL if the + function is local + + +InformationManager +------------------ + +Disassembler +------------ diff --git a/source/index.rst b/source/index.rst index 3596dc8..3466c74 100644 --- a/source/index.rst +++ b/source/index.rst @@ -16,7 +16,8 @@ Contents: using macros scripting - + api + Indices and tables ================== -- 2.39.2