Skip to content

Commit be1d451

Browse files
committed
Update docs from rizinorg/cutter
Original Commit: 76643671fd1a5384640e492d200d36f78b9db25f docs: remove mention of Rizin cmd calls (#3337)
1 parent cc30632 commit be1d451

File tree

3 files changed

+1
-51
lines changed

3 files changed

+1
-51
lines changed

docs/_sources/contributing/code/development-guidelines.rst.txt

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,6 @@ Example:
2121
2222
Core()->getOffset();
2323
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
44-
is preferred to use the JSON API.
45-
46-
Example:
47-
48-
.. code:: cpp
49-
50-
CutterJson array = Core()->cmdj("pdj 1 @ main");
5124
5225
Seek the Current File
5326
~~~~~~~~~~~~~~~~~~~~~

docs/contributing/code/development-guidelines.html

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,6 @@ <h3>CutterCore Class<a class="headerlink" href="#cuttercore-class" title="Link t
6868
</pre></div>
6969
</div>
7070
</section>
71-
<section id="calling-a-rizin-command">
72-
<h3>Calling a Rizin Command<a class="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-
<ul class="simple">
75-
<li><p><code class="docutils literal notranslate"><span class="pre">CutterCore::cmdj(&lt;command&gt;)</span></code> - To be used with json commands like <code class="docutils literal notranslate"><span class="pre">cmdj(&quot;agj&quot;)</span></code> or <code class="docutils literal notranslate"><span class="pre">cmdj(&quot;aflj&quot;)</span></code>.
76-
This is the command we used to fetch structured data from Rizin.</p></li>
77-
<li><p><code class="docutils literal notranslate"><span class="pre">CutterCore::cmdRaw(&lt;command&gt;)</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 <code class="docutils literal notranslate"><span class="pre">cmdj</span></code> is always preferred.</p>
81-
<ul class="simple">
82-
<li><p><code class="docutils literal notranslate"><span class="pre">CutterCore::cmdRawAt(&lt;command&gt;,</span> <span class="pre">&lt;address&gt;)</span></code> - Executes a single Rizin command in a given address and returns the output. This helps avoiding weird strings concatenation like <code class="docutils literal notranslate"><span class="pre">cmd(&quot;ph</span> <span class="pre">&quot;</span> <span class="pre">+</span> <span class="pre">hash</span> <span class="pre">+</span> <span class="pre">&quot;</span> <span class="pre">&#64;</span> <span class="pre">&quot;</span> <span class="pre">+</span> <span class="pre">QString::num(address))</span></code>.</p></li>
83-
<li><p><code class="docutils literal notranslate"><span class="pre">CutterCore::cmd()</span></code> - <em>(Discouraged)</em> Only use it when <code class="docutils literal notranslate"><span class="pre">cmdj</span></code> or <code class="docutils literal notranslate"><span class="pre">cmdRaw</span></code> cannot be used. This is used for complex commands using concatenation of several commands (<code class="docutils literal notranslate"><span class="pre">px</span> <span class="pre">5;</span> <span class="pre">pd</span> <span class="pre">7;</span> <span class="pre">afl;</span></code>), for grepping (<code class="docutils literal notranslate"><span class="pre">pd</span> <span class="pre">5~call</span></code>). for commands inside commands (<code class="docutils literal notranslate"><span class="pre">?e</span> <span class="pre">`afn.`</span></code>) and so on.
84-
This is also used when the output is complex and is not parsed correctly in <code class="docutils literal notranslate"><span class="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
88-
is preferred to use the JSON API.</p>
89-
<p>Example:</p>
90-
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">CutterJson</span><span class="w"> </span><span class="n">array</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Core</span><span class="p">()</span><span class="o">-&gt;</span><span class="n">cmdj</span><span class="p">(</span><span class="s">&quot;pdj 1 @ main&quot;</span><span class="p">);</span>
91-
</pre></div>
92-
</div>
93-
</section>
9471
<section id="seek-the-current-file">
9572
<h3>Seek the Current File<a class="headerlink" href="#seek-the-current-file" title="Link to this heading"></a></h3>
9673
<p>To modify Rizin seek use <code class="docutils literal notranslate"><span class="pre">CutterCore::seek(const</span> <span class="pre">RVA</span> <span class="pre">offset)</span></code>. This

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)