Files
Embedded-Hacking/WEEK05/slides/WEEK05-IMG08.svg
T
Kevin Thomas 6a9090915b Initial commit
2026-07-06 21:23:12 -04:00

71 lines
3.4 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">Double in Ghidra</text>
<text x="600" y="88" text-anchor="middle" class="dim">Analyzing 42.52525 in memory</text>
<!-- Decompiled View -->
<rect x="40" y="110" width="540" height="230" rx="8" class="pnl"/>
<text x="310" y="148" text-anchor="middle" class="sub">Decompiled main()</text>
<rect x="60" y="168" width="500" height="150" rx="4" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1"/>
<text x="80" y="198" class="cyn">int main(void) {</text>
<text x="110" y="228" class="txt">double fav_num</text>
<text x="110" y="258" class="amb"> = 42.52525;</text>
<text x="110" y="288" class="txt">stdio_init_all();</text>
<text x="80" y="308" class="cyn">}</text>
<!-- Key Difference from Float -->
<rect x="620" y="110" width="540" height="230" rx="8" class="pnl"/>
<text x="890" y="148" text-anchor="middle" class="sub">Key Difference</text>
<text x="640" y="188" class="txt">Float (42.5):</text>
<text x="640" y="218" class="dim">r2 = 0x00000000 (zero!)</text>
<text x="640" y="248" class="dim">r3 = 0x40454000</text>
<text x="640" y="288" class="grn">Double (42.52525):</text>
<text x="640" y="318" class="amb">r2 = 0x645A1CAC (non-zero!)</text>
<!-- Register Pair -->
<rect x="40" y="360" width="1120" height="170" rx="8" class="pnl"/>
<text x="600" y="398" text-anchor="middle" class="sub">Register Pair r2:r3</text>
<rect x="60" y="418" width="520" height="55" rx="4" fill="#0a0a0f" stroke="#ffaa00" stroke-width="1"/>
<text x="80" y="445" class="amb">r3 (HIGH):</text>
<text x="280" y="445" class="grn">0x4045433B</text>
<rect x="620" y="418" width="520" height="55" rx="4" fill="#0a0a0f" stroke="#ffaa00" stroke-width="1"/>
<text x="640" y="445" class="amb">r2 (LOW):</text>
<text x="830" y="445" class="grn">0x645A1CAC</text>
<text x="60" y="510" class="dim">Combined: 0x4045433B645A1CAC = 42.52525</text>
<!-- Assembly View -->
<rect x="40" y="550" width="1120" height="230" rx="8" class="pnl"/>
<text x="600" y="588" text-anchor="middle" class="sub">Assembly (ldrd)</text>
<rect x="60" y="608" width="700" height="140" rx="4" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1"/>
<text x="80" y="638" class="cyn">ldrd r2,r3,[PC,#0x10]</text>
<text x="80" y="668" class="dim">; Loads BOTH words at once</text>
<text x="80" y="698" class="dim">; r2 gets low word</text>
<text x="80" y="728" class="dim">; r3 gets high word</text>
<rect x="780" y="608" width="360" height="140" rx="4" fill="#0a0a0f" stroke="#00ff41" stroke-width="1"/>
<text x="800" y="648" class="grn">ldrd = Load</text>
<text x="800" y="678" class="grn">Register</text>
<text x="800" y="708" class="grn">Doubleword</text>
<text x="800" y="738" class="dim">ARM Cortex-M33</text>
</svg>