mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-12 23:26:33 +02:00
88 lines
3.9 KiB
XML
88 lines
3.9 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">Patching Double</text>
|
|
<text x="600" y="88" text-anchor="middle" class="dim">Changing 42.52525 to 99.99</text>
|
|
|
|
<!-- New Encoding Calc -->
|
|
<rect x="40" y="110" width="1120" height="160" rx="8" class="pnl"/>
|
|
<text x="600" y="148" text-anchor="middle" class="sub">99.99 as IEEE 754 Double</text>
|
|
|
|
<text x="60" y="188" class="cyn">Sign:</text>
|
|
<text x="160" y="188" class="txt">0</text>
|
|
<text x="300" y="188" class="amb">Exp:</text>
|
|
<text x="390" y="188" class="txt">6 + 1023 = 1029</text>
|
|
|
|
<text x="60" y="223" class="grn">Result:</text>
|
|
<text x="200" y="223" class="grn">0x4058FF5C28F5C28F</text>
|
|
|
|
<text x="60" y="253" class="dim">r3 (HIGH) = 0x4058FF5C</text>
|
|
<text x="540" y="253" class="dim">r2 (LOW) = 0x28F5C28F</text>
|
|
|
|
<!-- Before vs After -->
|
|
<rect x="40" y="290" width="540" height="240" rx="8" class="pnl"/>
|
|
<text x="310" y="328" text-anchor="middle" class="sub">Before (42.52525)</text>
|
|
|
|
<rect x="60" y="348" width="500" height="50" rx="4" fill="#0a0a0f" stroke="#ff0040" stroke-width="1"/>
|
|
<text x="80" y="373" class="cyn">r3:</text>
|
|
<text x="150" y="373" class="red">0x4045433B</text>
|
|
|
|
<rect x="60" y="408" width="500" height="50" rx="4" fill="#0a0a0f" stroke="#ff0040" stroke-width="1"/>
|
|
<text x="80" y="433" class="cyn">r2:</text>
|
|
<text x="150" y="433" class="red">0x645A1CAC</text>
|
|
|
|
<text x="60" y="485" class="dim">printf: 42.525250</text>
|
|
<text x="60" y="515" class="dim">Both words non-zero</text>
|
|
|
|
<rect x="620" y="290" width="540" height="240" rx="8" class="pnl"/>
|
|
<text x="890" y="328" text-anchor="middle" class="sub">After (99.99)</text>
|
|
|
|
<rect x="640" y="348" width="500" height="50" rx="4" fill="#0a0a0f" stroke="#00ff41" stroke-width="1"/>
|
|
<text x="660" y="373" class="cyn">r3:</text>
|
|
<text x="730" y="373" class="grn">0x4058FF5C</text>
|
|
<text x="940" y="380" class="amb">changed</text>
|
|
|
|
<rect x="640" y="408" width="500" height="50" rx="4" fill="#0a0a0f" stroke="#00ff41" stroke-width="1"/>
|
|
<text x="660" y="433" class="cyn">r2:</text>
|
|
<text x="730" y="433" class="grn">0x28F5C28F</text>
|
|
<text x="940" y="440" class="amb">changed</text>
|
|
|
|
<text x="640" y="485" class="dim">printf: 99.990000</text>
|
|
<text x="640" y="515" class="dim">BOTH words changed!</text>
|
|
|
|
<!-- Float vs Double Patching -->
|
|
<rect x="40" y="550" width="540" height="230" rx="8" class="pnl"/>
|
|
<text x="310" y="588" text-anchor="middle" class="sub">Float Patch</text>
|
|
|
|
<text x="60" y="628" class="txt">Words changed:</text>
|
|
<text x="300" y="628" class="grn">1</text>
|
|
<text x="60" y="663" class="txt">r2 (low):</text>
|
|
<text x="260" y="663" class="dim">stays 0x0</text>
|
|
<text x="60" y="698" class="txt">r3 (high):</text>
|
|
<text x="280" y="698" class="amb">patched</text>
|
|
<text x="60" y="733" class="dim">Easier to patch</text>
|
|
|
|
<rect x="620" y="550" width="540" height="230" rx="8" class="pnl"/>
|
|
<text x="890" y="588" text-anchor="middle" class="sub">Double Patch</text>
|
|
|
|
<text x="640" y="628" class="txt">Words changed:</text>
|
|
<text x="880" y="628" class="red">2</text>
|
|
<text x="640" y="663" class="txt">r2 (low):</text>
|
|
<text x="840" y="663" class="amb">patched</text>
|
|
<text x="640" y="698" class="txt">r3 (high):</text>
|
|
<text x="860" y="698" class="amb">patched</text>
|
|
<text x="640" y="733" class="dim">Both words must change</text>
|
|
</svg> |