mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-05-19 22:38:05 +02:00
102 lines
5.0 KiB
XML
102 lines
5.0 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800">
|
|
<style>
|
|
.bg{fill:#0a0a0f}.pnl{fill:#12121a;stroke:#1a1a2e}.hdr{fill:#12121a}
|
|
.title{font:bold 42px 'Courier New',monospace;fill:#00ff41}
|
|
.sub{font:bold 28px 'Courier New',monospace;fill:#00d4ff}
|
|
.txt{font:24px 'Courier New',monospace;fill:#c0c0c0}
|
|
.dim{font:20px 'Courier New',monospace;fill:#888}
|
|
.grn{font:bold 24px 'Courier New',monospace;fill:#00ff41}
|
|
.red{font:bold 24px 'Courier New',monospace;fill:#ff0040}
|
|
.cyn{font:bold 24px 'Courier New',monospace;fill:#00d4ff}
|
|
.amb{font:bold 24px 'Courier New',monospace;fill:#ffaa00}
|
|
.badge{stroke:#00ff41;rx:14}
|
|
</style>
|
|
<rect class="bg" width="1200" height="800"/>
|
|
|
|
<!-- Title -->
|
|
<text x="600" y="52" text-anchor="middle" class="title">Stack in Action</text>
|
|
<text x="600" y="88" text-anchor="middle" class="dim">Runtime Stack Analysis</text>
|
|
|
|
<!-- Left Panel: Before Call -->
|
|
<rect x="30" y="105" width="350" height="675" class="pnl" rx="8"/>
|
|
<text x="205" y="148" text-anchor="middle" class="sub">Before Call</text>
|
|
<line x1="50" y1="163" x2="360" y2="163" stroke="#1a1a2e"/>
|
|
|
|
<text x="55" y="205" class="amb">0x20082000</text>
|
|
<text x="55" y="237" class="red">SP here</text>
|
|
|
|
<rect x="60" y="260" width="255" height="55" rx="5" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1" stroke-dasharray="6"/>
|
|
<text x="187" y="295" text-anchor="middle" class="dim">empty (0x20081FFC)</text>
|
|
|
|
<rect x="60" y="325" width="255" height="55" rx="5" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1" stroke-dasharray="6"/>
|
|
<text x="187" y="360" text-anchor="middle" class="dim">empty (0x20081FF8)</text>
|
|
|
|
<rect x="60" y="390" width="255" height="55" rx="5" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1" stroke-dasharray="6"/>
|
|
<text x="187" y="425" text-anchor="middle" class="dim">free stack space</text>
|
|
|
|
<rect x="60" y="455" width="255" height="55" rx="5" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1" stroke-dasharray="6"/>
|
|
<text x="187" y="490" text-anchor="middle" class="dim">unused lower space</text>
|
|
|
|
<text x="55" y="555" class="amb">0x20080000</text>
|
|
|
|
<text x="205" y="650" text-anchor="middle" class="red">Grows DOWN</text>
|
|
<line x1="205" y1="665" x2="205" y2="725" stroke="#ff0040" stroke-width="4"/>
|
|
<polygon points="193,725 205,750 217,725" fill="#ff0040"/>
|
|
|
|
<!-- Middle Panel: After PUSH {r4, lr} -->
|
|
<rect x="410" y="105" width="370" height="675" class="pnl" rx="8"/>
|
|
<text x="595" y="148" text-anchor="middle" class="sub">After PUSH</text>
|
|
<line x1="430" y1="163" x2="760" y2="163" stroke="#1a1a2e"/>
|
|
|
|
<text x="435" y="205" class="amb">0x20082000</text>
|
|
<text x="435" y="237" class="red">PUSH {r4, lr}</text>
|
|
|
|
<rect x="440" y="260" width="255" height="55" rx="5" fill="#1a0f0f" stroke="#ff0040" stroke-width="2"/>
|
|
<text x="567" y="295" text-anchor="middle" class="red">saved LR</text>
|
|
|
|
<rect x="440" y="325" width="255" height="55" rx="5" fill="#1a1a0f" stroke="#ffaa00" stroke-width="2"/>
|
|
<text x="567" y="360" text-anchor="middle" class="amb">saved r4</text>
|
|
|
|
<rect x="440" y="390" width="255" height="55" rx="5" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1" stroke-dasharray="6"/>
|
|
<text x="567" y="425" text-anchor="middle" class="dim">free stack space</text>
|
|
|
|
<rect x="440" y="455" width="255" height="55" rx="5" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1" stroke-dasharray="6"/>
|
|
<text x="567" y="490" text-anchor="middle" class="dim">free stack space</text>
|
|
|
|
<text x="435" y="555" class="red">SP now = 0x20081FF8</text>
|
|
|
|
<text x="435" y="620" class="dim" style="fill:#ff0040">SP moved down</text>
|
|
<text x="435" y="650" class="dim" style="fill:#ff0040">by 8 bytes</text>
|
|
<text x="435" y="720" class="cyn">GDB: x/4xw $sp</text>
|
|
<text x="435" y="752" class="dim">saved regs are now visible</text>
|
|
|
|
<!-- Right Panel: Key Points -->
|
|
<rect x="810" y="105" width="360" height="675" class="pnl" rx="8"/>
|
|
<text x="990" y="148" text-anchor="middle" class="sub">Key Points</text>
|
|
<line x1="830" y1="163" x2="1150" y2="163" stroke="#1a1a2e"/>
|
|
|
|
<text x="835" y="205" class="grn">PUSH saves</text>
|
|
<text x="835" y="240" class="txt">Preserves regs</text>
|
|
<text x="835" y="272" class="txt">before function</text>
|
|
<text x="835" y="304" class="txt">body runs</text>
|
|
|
|
<line x1="830" y1="332" x2="1150" y2="332" stroke="#1a1a2e"/>
|
|
|
|
<text x="835" y="372" class="red">POP restores</text>
|
|
<text x="835" y="407" class="txt">Puts values</text>
|
|
<text x="835" y="439" class="txt">back when func</text>
|
|
<text x="835" y="471" class="txt">returns</text>
|
|
|
|
<line x1="830" y1="499" x2="1150" y2="499" stroke="#1a1a2e"/>
|
|
|
|
<text x="835" y="539" class="amb">Watch in GDB</text>
|
|
<text x="835" y="574" class="txt">x/4xw $sp</text>
|
|
<text x="835" y="606" class="dim">See stack data</text>
|
|
|
|
<line x1="830" y1="634" x2="1150" y2="634" stroke="#1a1a2e"/>
|
|
|
|
<text x="835" y="674" class="cyn">stepi</text>
|
|
<text x="835" y="709" class="txt">Step 1 instr</text>
|
|
<text x="835" y="741" class="txt">watch stack</text>
|
|
<text x="835" y="773" class="dim">change live</text>
|
|
</svg> |