Start documentation of scripting API
[frida/doc.git] / source / api.rst
1 API
2 ===
3
4 The APIs for the individual programming languages all derive from the
5 C++ structure of ``src/core`` adapted to the native spelling of the
6 respective programming language. As an example, all from within guile
7 all methods are available as ``classname-functionname`` with
8 name-components separated by dashes instead of CamelCase.
9
10 Function
11 --------
12
13 .. cpp:class:: Function
14
15 Represents a function in the binary. Functions are typically the
16 target of ``call`` instructions and are composed of
17 :cpp:class:`BasicBlock`
18
19 .. cpp:function:: std::string Function::getName() const
20
21 Returns the Name of the function
22
23 .. cpp:function:: void Function::setName(const std::string& new_name)
24
25 Updates the Name of the Function. Also takes care to notify all
26 consumers of the changed name so the new name is displayed
27 consistently
28
29 .. cpp:function:: bool Function::isDynamic() const
30
31 Returns whether the Function is of the dynamic type. Dynamic
32 functions are the ones which are imported from shared libraries and
33 not structly part of the binary at hand.
34
35 .. cpp:function:: uint64_t Function::getStartAddress() const
36
37 .. cpp:function:: InformationManager* Function::getManager() const
38
39 .. cpp:function:: void Function::addBasicBlock(BasicBlock* block)
40
41 .. cpp:function:: const std::map<uint64_t, BasicBlock*>& Function::blocks()
42
43 BasicBlock
44 ----------
45 .. cpp:class:: BasicBlock
46
47 .. cpp:function:: uint64_t BasicBlock::getStartAddress() const
48 .. cpp:function:: uint64_t BasicBlock::getEndAddress() const
49 .. cpp:function:: void BasicBlock::setStartAddress(uint64_t address)
50 .. cpp:function:: void BasicBlock::setEndAddress(uint64_t address)
51 .. cpp:function:: InformationManager* BasicBlock::getManager() const
52 .. cpp:function:: uint64_t BasicBlock::getNextBlock(size_t index) const
53 .. cpp:function:: void BasicBlock::setNextBlock(size_t index, uint64_t address)
54 .. cpp:function:: std::string BasicBlock::getName() const
55 .. cpp:function:: std::vector<Instruction> BasicBlock::getInstructions() const
56
57 Comment
58 -------
59
60 .. cpp:class:: Comment
61
62 .. cpp:function:: bool Comment::isLocal() const
63
64 Comments, which are valid for every instance of an address are
65 considered *global* while comments only valid within the
66 context of the current function are considered *local*
67
68 .. cpp:function:: void Comment::setText(const std::string& text)
69
70 Updates the text of an comment and takes care of notifying all
71 consumers of the change.
72
73 .. cpp:function:: std::string Comment::getText() const
74
75 Returns the current text of the comment without any :doc:`macros` expanded.
76
77 .. cpp:function:: uint64_t Comment::getAddress()
78
79 Returns address this comment talks about
80
81 .. cpp:function:: Function* Comment::getLocation()
82
83 Returns the function, the comment talks about, or NULL if the
84 function is local
85
86
87 InformationManager
88 ------------------
89
90 Disassembler
91 ------------