You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_sources/contributing/code/development-guidelines.rst.txt
-27Lines changed: 0 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -21,33 +21,6 @@ Example:
21
21
22
22
Core()->getOffset();
23
23
24
-
Calling a Rizin Command
25
-
~~~~~~~~~~~~~~~~~~~~~~~~~
26
-
27
-
There are multiple ways to call a Rizin command:
28
-
29
-
- ``CutterCore::cmdj(<command>)`` - To be used with json commands like ``cmdj("agj")`` or ``cmdj("aflj")``.
30
-
This is the command we used to fetch structured data from Rizin.
31
-
32
-
- ``CutterCore::cmdRaw(<command>)`` - Executes a single Rizin command
33
-
without going through Rizin shell functionality like output redirects, grep, and multiple command parsing.
34
-
35
-
The command then returns its output. This should be used when a command doesn't have output or the output should be handled as-is. If possible, using the JSON variation with ``cmdj`` is always preferred.
36
-
37
-
- ``CutterCore::cmdRawAt(<command>, <address>)`` - Executes a single Rizin command in a given address and returns the output. This helps avoiding weird strings concatenation like ``cmd("ph " + hash + " @ " + QString::num(address))``.
38
-
39
-
- ``CutterCore::cmd()`` - *(Discouraged)* Only use it when ``cmdj`` or ``cmdRaw`` cannot be used. This is used for complex commands using concatenation of several commands (``px 5; pd 7; afl;``), for grepping (``pd 5~call``). for commands inside commands (``?e `afn.```) and so on.
40
-
This is also used when the output is complex and is not parsed correctly in ``cmdRaw``.
41
-
Make sure to carefully sanitize user-controlled variables that are passed to the command, to avoid unexpected command injections.
42
-
43
-
Generally, if one needs to retrieve information from a Rizin command, it
Copy file name to clipboardExpand all lines: docs/contributing/code/development-guidelines.html
-23Lines changed: 0 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -68,29 +68,6 @@ <h3>CutterCore Class<a class="headerlink" href="#cuttercore-class" title="Link t
68
68
</pre></div>
69
69
</div>
70
70
</section>
71
-
<sectionid="calling-a-rizin-command">
72
-
<h3>Calling a Rizin Command<aclass="headerlink" href="#calling-a-rizin-command" title="Link to this heading">¶</a></h3>
73
-
<p>There are multiple ways to call a Rizin command:</p>
74
-
<ulclass="simple">
75
-
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">CutterCore::cmdj(<command>)</span></code> - To be used with json commands like <codeclass="docutils literal notranslate"><spanclass="pre">cmdj("agj")</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">cmdj("aflj")</span></code>.
76
-
This is the command we used to fetch structured data from Rizin.</p></li>
77
-
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">CutterCore::cmdRaw(<command>)</span></code> - Executes a single Rizin command
78
-
without going through Rizin shell functionality like output redirects, grep, and multiple command parsing.</p></li>
79
-
</ul>
80
-
<p>The command then returns its output. This should be used when a command doesn’t have output or the output should be handled as-is. If possible, using the JSON variation with <codeclass="docutils literal notranslate"><spanclass="pre">cmdj</span></code> is always preferred.</p>
81
-
<ulclass="simple">
82
-
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">CutterCore::cmdRawAt(<command>,</span><spanclass="pre"><address>)</span></code> - Executes a single Rizin command in a given address and returns the output. This helps avoiding weird strings concatenation like <codeclass="docutils literal notranslate"><spanclass="pre">cmd("ph</span><spanclass="pre">"</span><spanclass="pre">+</span><spanclass="pre">hash</span><spanclass="pre">+</span><spanclass="pre">"</span><spanclass="pre">@</span><spanclass="pre">"</span><spanclass="pre">+</span><spanclass="pre">QString::num(address))</span></code>.</p></li>
83
-
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">CutterCore::cmd()</span></code> - <em>(Discouraged)</em> Only use it when <codeclass="docutils literal notranslate"><spanclass="pre">cmdj</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">cmdRaw</span></code> cannot be used. This is used for complex commands using concatenation of several commands (<codeclass="docutils literal notranslate"><spanclass="pre">px</span><spanclass="pre">5;</span><spanclass="pre">pd</span><spanclass="pre">7;</span><spanclass="pre">afl;</span></code>), for grepping (<codeclass="docutils literal notranslate"><spanclass="pre">pd</span><spanclass="pre">5~call</span></code>). for commands inside commands (<codeclass="docutils literal notranslate"><spanclass="pre">?e</span><spanclass="pre">`afn.`</span></code>) and so on.
84
-
This is also used when the output is complex and is not parsed correctly in <codeclass="docutils literal notranslate"><spanclass="pre">cmdRaw</span></code>.
85
-
Make sure to carefully sanitize user-controlled variables that are passed to the command, to avoid unexpected command injections.</p></li>
86
-
</ul>
87
-
<p>Generally, if one needs to retrieve information from a Rizin command, it
<h3>Seek the Current File<aclass="headerlink" href="#seek-the-current-file" title="Link to this heading">¶</a></h3>
96
73
<p>To modify Rizin seek use <codeclass="docutils literal notranslate"><spanclass="pre">CutterCore::seek(const</span><spanclass="pre">RVA</span><spanclass="pre">offset)</span></code>. This
0 commit comments