Skip to content

Commit b996932

Browse files
committed
Update document for Quark script CWE-94.py
1 parent 3f1b270 commit b996932

File tree

9 files changed

+161
-94
lines changed

9 files changed

+161
-94
lines changed
3.64 KB
Binary file not shown.

docs/build/html/_static/basic.css

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,6 @@ ol.simple p,
608608
ul.simple p {
609609
margin-bottom: 0;
610610
}
611-
612-
/* Docutils 0.17 and older (footnotes & citations) */
613611
dl.footnote > dt,
614612
dl.citation > dt {
615613
float: left;
@@ -627,33 +625,6 @@ dl.citation > dd:after {
627625
clear: both;
628626
}
629627

630-
/* Docutils 0.18+ (footnotes & citations) */
631-
aside.footnote > span,
632-
div.citation > span {
633-
float: left;
634-
}
635-
aside.footnote > span:last-of-type,
636-
div.citation > span:last-of-type {
637-
padding-right: 0.5em;
638-
}
639-
aside.footnote > p {
640-
margin-left: 2em;
641-
}
642-
div.citation > p {
643-
margin-left: 4em;
644-
}
645-
aside.footnote > p:last-of-type,
646-
div.citation > p:last-of-type {
647-
margin-bottom: 0em;
648-
}
649-
aside.footnote > p:last-of-type:after,
650-
div.citation > p:last-of-type:after {
651-
content: "";
652-
clear: both;
653-
}
654-
655-
/* Footnotes & citations ends */
656-
657628
dl.field-list {
658629
display: grid;
659630
grid-template-columns: fit-content(30%) auto;
@@ -665,11 +636,11 @@ dl.field-list > dt {
665636
padding-left: 0.5em;
666637
padding-right: 5px;
667638
}
668-
669639
dl.field-list > dt:after {
670640
content: ":";
671641
}
672642

643+
673644
dl.field-list > dd {
674645
padding-left: 0.5em;
675646
margin-top: 0em;

docs/build/html/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ var DOCUMENTATION_OPTIONS = {
1010
SOURCELINK_SUFFIX: '.txt',
1111
NAVIGATION_WITH_KEYS: false,
1212
SHOW_SEARCH_SUMMARY: true,
13-
ENABLE_SEARCH_SHORTCUTS: false,
13+
ENABLE_SEARCH_SHORTCUTS: true,
1414
};

docs/build/html/_static/searchtools.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
8888
linkEl.href = linkUrl + "?" + params.toString() + anchor;
8989
linkEl.innerHTML = title;
9090
if (descr)
91-
listItem.appendChild(document.createElement("span")).innerText =
91+
listItem.appendChild(document.createElement("span")).innerHTML =
9292
" (" + descr + ")";
9393
else if (showSearchSummary)
9494
fetch(requestUrl)
@@ -155,10 +155,8 @@ const Search = {
155155
_pulse_status: -1,
156156

157157
htmlToText: (htmlString) => {
158-
const htmlElement = document
159-
.createRange()
160-
.createContextualFragment(htmlString);
161-
_removeChildren(htmlElement.querySelectorAll(".headerlink"));
158+
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
159+
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
162160
const docContent = htmlElement.querySelector('[role="main"]');
163161
if (docContent !== undefined) return docContent.textContent;
164162
console.warn(
@@ -504,21 +502,22 @@ const Search = {
504502
* latter for highlighting it.
505503
*/
506504
makeSearchSummary: (htmlText, keywords, highlightWords) => {
507-
const text = Search.htmlToText(htmlText).toLowerCase();
505+
const text = Search.htmlToText(htmlText);
508506
if (text === "") return null;
509507

508+
const textLower = text.toLowerCase();
510509
const actualStartPosition = [...keywords]
511-
.map((k) => text.indexOf(k.toLowerCase()))
510+
.map((k) => textLower.indexOf(k.toLowerCase()))
512511
.filter((i) => i > -1)
513512
.slice(-1)[0];
514513
const startWithContext = Math.max(actualStartPosition - 120, 0);
515514

516515
const top = startWithContext === 0 ? "" : "...";
517516
const tail = startWithContext + 240 < text.length ? "..." : "";
518517

519-
let summary = document.createElement("div");
518+
let summary = document.createElement("p");
520519
summary.classList.add("context");
521-
summary.innerText = top + text.substr(startWithContext, 240).trim() + tail;
520+
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
522521

523522
highlightWords.forEach((highlightWord) =>
524523
_highlightText(summary, highlightWord, "highlighted")

docs/build/html/genindex.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ <h2 id="C">C</h2>
234234
<li><a href="quark.core.html#quark.core.quark.Quark.check_sequence">check_sequence() (quark.core.quark.Quark method)</a>
235235
</li>
236236
<li><a href="quark.core.struct.html#quark.core.struct.methodobject.MethodObject.class_name">class_name (quark.core.struct.methodobject.MethodObject attribute)</a>
237+
</li>
238+
<li><a href="quark.script.html#quark.script.Method.className">className (quark.script.Method property)</a>
237239
</li>
238240
<li><a href="quark.core.html#quark.core.analysis.QuarkAnalysis.clean_result">clean_result() (quark.core.analysis.QuarkAnalysis method)</a>
239241
</li>
@@ -244,11 +246,11 @@ <h2 id="C">C</h2>
244246
<li><a href="quark.utils.html#quark.utils.colors.colorful_report">colorful_report() (in module quark.utils.colors)</a>
245247
</li>
246248
<li><a href="quark.evaluator.html#quark.evaluator.pyeval.PyEval.CONST">CONST() (quark.evaluator.pyeval.PyEval method)</a>
247-
</li>
248-
<li><a href="quark.evaluator.html#quark.evaluator.pyeval.PyEval.CONST_CLASS">CONST_CLASS() (quark.evaluator.pyeval.PyEval method)</a>
249249
</li>
250250
</ul></td>
251251
<td style="width: 33%; vertical-align: top;"><ul>
252+
<li><a href="quark.evaluator.html#quark.evaluator.pyeval.PyEval.CONST_CLASS">CONST_CLASS() (quark.evaluator.pyeval.PyEval method)</a>
253+
</li>
252254
<li><a href="quark.evaluator.html#quark.evaluator.pyeval.PyEval.CONST_FOUR">CONST_FOUR() (quark.evaluator.pyeval.PyEval method)</a>
253255
</li>
254256
<li><a href="quark.evaluator.html#quark.evaluator.pyeval.PyEval.CONST_HIGHSIXTEEN">CONST_HIGHSIXTEEN() (quark.evaluator.pyeval.PyEval method)</a>
@@ -303,10 +305,14 @@ <h2 id="D">D</h2>
303305
</li>
304306
<li><a href="quark.script.html#quark.script.DefaultRuleset">DefaultRuleset (class in quark.script)</a>
305307
</li>
306-
</ul></td>
307-
<td style="width: 33%; vertical-align: top;"><ul>
308308
<li><a href="quark.core.struct.html#quark.core.struct.methodobject.MethodObject.descriptor">descriptor (quark.core.struct.methodobject.MethodObject attribute)</a>
309+
310+
<ul>
311+
<li><a href="quark.script.html#quark.script.Method.descriptor">(quark.script.Method property)</a>
309312
</li>
313+
</ul></li>
314+
</ul></td>
315+
<td style="width: 33%; vertical-align: top;"><ul>
310316
<li><a href="quark.utils.html#quark.utils.tools.descriptor_to_androguard_format">descriptor_to_androguard_format() (in module quark.utils.tools)</a>
311317
</li>
312318
<li><a href="quark.html#quark.freshquark.download">download() (in module quark.freshquark)</a>
@@ -349,8 +355,6 @@ <h2 id="F">F</h2>
349355
</li>
350356
<li><a href="quark.core.html#quark.core.quark.Quark.find_intersection">find_intersection() (quark.core.quark.Quark method)</a>
351357
</li>
352-
</ul></td>
353-
<td style="width: 33%; vertical-align: top;"><ul>
354358
<li><a href="quark.core.html#quark.core.apkinfo.AndroguardImp.find_method">find_method() (quark.core.apkinfo.AndroguardImp method)</a>
355359

356360
<ul>
@@ -359,7 +363,11 @@ <h2 id="F">F</h2>
359363
<li><a href="quark.core.html#quark.core.rzapkinfo.RizinImp.find_method">(quark.core.rzapkinfo.RizinImp method)</a>
360364
</li>
361365
</ul></li>
366+
</ul></td>
367+
<td style="width: 33%; vertical-align: top;"><ul>
362368
<li><a href="quark.core.html#quark.core.quark.Quark.find_previous_method">find_previous_method() (quark.core.quark.Quark method)</a>
369+
</li>
370+
<li><a href="quark.script.html#quark.script.QuarkResult.findMethodInCaller">findMethodInCaller() (quark.script.QuarkResult method)</a>
363371
</li>
364372
<li><a href="quark.core.html#quark.core.analysis.QuarkAnalysis.first_api">first_api (quark.core.analysis.QuarkAnalysis attribute)</a>
365373
</li>
@@ -599,6 +607,8 @@ <h2 id="M">M</h2>
599607
<li><a href="quark.html#quark.radiocontrast.RadioContrast.method_recursive_search">(quark.radiocontrast.RadioContrast method)</a>
600608
</li>
601609
</ul></li>
610+
<li><a href="quark.script.html#quark.script.Method.methodName">methodName (quark.script.Method property)</a>
611+
</li>
602612
<li><a href="quark.core.struct.html#quark.core.struct.methodobject.MethodObject">MethodObject (class in quark.core.struct.methodobject)</a>
603613
</li>
604614
<li><a href="quark.core.struct.html#quark.core.struct.bytecodeobject.BytecodeObject.mnemonic">mnemonic (quark.core.struct.bytecodeobject.BytecodeObject property)</a>

docs/build/html/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ <h1>Quark-Engine Book<a class="headerlink" href="#quark-engine-book" title="Perm
9797
<li class="toctree-l2"><a class="reference internal" href="quark_script.html#ecosystem-for-mobile-security-tools">Ecosystem for Mobile Security Tools</a></li>
9898
<li class="toctree-l2"><a class="reference internal" href="quark_script.html#introduce-of-quark-script-apis">Introduce of Quark Script APIs</a></li>
9999
<li class="toctree-l2"><a class="reference internal" href="quark_script.html#analyzing-real-case-instastealer-using-quark-script">Analyzing real case (InstaStealer) using Quark Script</a></li>
100-
<li class="toctree-l2"><a class="reference internal" href="quark_script.html#quark-script-used-as-a-vulnerability-finder">Quark Script used as a vulnerability finder</a></li>
100+
<li class="toctree-l2"><a class="reference internal" href="quark_script.html#detect-cwe-798-in-android-application-ovaa-apk">Detect CWE-798 in Android Application (ovaa.apk)</a></li>
101+
<li class="toctree-l2"><a class="reference internal" href="quark_script.html#detect-cwe-94-in-android-application-ovaa-apk">Detect CWE-94 in Android Application (ovaa.apk)</a></li>
101102
</ul>
102103
</li>
103104
<li class="toctree-l1"><a class="reference internal" href="addRules.html">Add Rules</a></li>

docs/build/html/objects.inv

31 Bytes
Binary file not shown.

docs/build/html/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)