From 291bc6fb70f47d28d23440f03a8a7fa49eb9a391 Mon Sep 17 00:00:00 2001 From: N0zoM1z0 <1705004398@qq.com> Date: Fri, 9 Oct 2026 12:02:58 +0800 Subject: [PATCH] feat(website): show manual analysis beside a one-prompt workflow --- website/README.md | 9 + website/evidence/calculator-and-dino.md | 9 + website/figures.md | 12 +- .../assets/figures/analyst-thinking.svg | 15 + website/public/assets/home.js | 8 + website/public/assets/main.js | 35 ++- website/public/assets/styles.css | 262 +++++++++++++++--- website/public/index.html | 228 ++++++++++++--- website/style-guide.md | 5 + 9 files changed, 493 insertions(+), 90 deletions(-) create mode 100644 website/public/assets/figures/analyst-thinking.svg diff --git a/website/README.md b/website/README.md index f0da06ca4..0f29bc32b 100644 --- a/website/README.md +++ b/website/README.md @@ -100,6 +100,15 @@ and complete private Evidence records are not website assets. The homepage starts with a short installation prompt and the ordinary setup command, then explains what reverse engineering is and why someone would use it. The manual/agent comparison introduces REA’s role before the examples. +The comparison uses the same Calculator question on both sides: three +selectable manual steps pair original instructions with an analyst illustration +and thought bubbles; the agent side begins with “One prompt.” and a copyable +question. Thoughts illustrate the reasoning behind the findings. The shared +code-step script selects the initial note on load, so all three notes remain +readable when JavaScript is disabled. +The original-instruction panel starts expanded on desktop. On narrow screens, +the homepage script collapses it; a native disclosure keeps the code available +while the thought bubble and agent prompt remain close together. Dinosaur is the first example; Calculator follows as the native example. Both name the goal and the reason to inspect the program before showing the demo. A labeled finding explains what REA returned, and the flow distinguishes diff --git a/website/evidence/calculator-and-dino.md b/website/evidence/calculator-and-dino.md index b46d2113e..a7e9c093e 100644 --- a/website/evidence/calculator-and-dino.md +++ b/website/evidence/calculator-and-dino.md @@ -36,6 +36,15 @@ the constant 100 in both paths. One path divides the current value by 100; the other combines the current value with the previous value divided by 100. The published assembly is selected exactly from the returned instruction list. +The opening manual/agent comparison selects instructions at +`0x180124945–0x180124992` and `0x180124a14–0x180124a34`, with explicit omissions. +Its three highlights identify the operator comparisons, construction of 100 +and arithmetic helper calls, and the final multiplication path. The analyst +thought bubbles illustrate the work of decoding those facts; they are not a +recorded analyst transcript or a measured comparison of investigation times. +The same percentage question appears in the agent prompt. Helper meanings and +operator names are interpretations checked against the public source below. + The binary is stripped. A local instruction scan located candidates using operator IDs and the constant 100; REA then produced the complete function dossier. Function selection was analyst-assisted. The illustrative agent diff --git a/website/figures.md b/website/figures.md index e02f894ef..c0ab93d60 100644 --- a/website/figures.md +++ b/website/figures.md @@ -13,6 +13,7 @@ The published diagrams are SVG source assets: - `public/assets/figures/rea-investigation-flow.svg` — 1774 × 887 viewBox. - `public/assets/figures/dx-ball-sound-pan-investigation.svg` — 1774 × 887 viewBox. - `public/assets/figures/th04-bullet-ring.svg` — 1000 × 520 viewBox. +- `public/assets/figures/analyst-thinking.svg` — 160 × 120 viewBox. Two original layout references were generated with the built-in image generation tool and reviewed visually. Their prompts are retained below. The final SVGs @@ -44,11 +45,20 @@ rendering at desktop and mobile widths. ## Beginner homepage and dinosaur reconstruction -The dinosaur role comparison and Calculator percentage controls are semantic +The manual/agent comparison and Calculator percentage controls are semantic HTML. Calculator’s assembly comes from a real installed model DLL; the named calculation is a readable summary crosschecked against Microsoft’s public source. See [evidence/calculator-and-dino.md](evidence/calculator-and-dino.md). +The introduction pairs selected Calculator instructions with three selectable +analyst thoughts: decode operator branches, trace arithmetic calls, then name +the percentage rule. The small analyst illustration is authored SVG; the +thought bubbles, findings and labels are selectable HTML. The thoughts +illustrate the analysis rather than reproduce a recorded conversation. The +agent side asks the same question and separates REA’s evidence from the +agent’s explanation. Keep those roles and the instruction highlights aligned +when changing a step. + The homepage explains reverse engineering before the worked examples. Each example opens with its goal and reason for inspecting the program. A selected highlight marks the intended result; the “REA returned” block identifies the diff --git a/website/public/assets/figures/analyst-thinking.svg b/website/public/assets/figures/analyst-thinking.svg new file mode 100644 index 000000000..53a92d5d9 --- /dev/null +++ b/website/public/assets/figures/analyst-thinking.svg @@ -0,0 +1,15 @@ + diff --git a/website/public/assets/home.js b/website/public/assets/home.js index 448052cc7..27cd1b32f 100644 --- a/website/public/assets/home.js +++ b/website/public/assets/home.js @@ -55,4 +55,12 @@ function initializePercentDemo() { render(); } +function initializeExpertAssembly() { + const excerpt = document.querySelector("[data-expert-assembly]"); + if (excerpt && window.matchMedia("(max-width: 640px)").matches) { + excerpt.open = false; + } +} + +initializeExpertAssembly(); initializePercentDemo(); diff --git a/website/public/assets/main.js b/website/public/assets/main.js index 98751f280..b927dff64 100644 --- a/website/public/assets/main.js +++ b/website/public/assets/main.js @@ -39,23 +39,28 @@ initializeCopyButtons(); function initializeStepComparisons() { document.querySelectorAll("[data-step-comparison]").forEach((comparison) => { const buttons = comparison.querySelectorAll("[data-select-step]"); - buttons.forEach((button) => { - button.addEventListener("click", () => { - const selected = button.getAttribute("data-select-step"); - buttons.forEach((candidate) => { - candidate.setAttribute("aria-pressed", String(candidate === button)); - }); - comparison.querySelectorAll("[data-step]").forEach((fragment) => { - fragment.classList.toggle( - "is-active", - fragment.getAttribute("data-step") === selected, - ); - }); - comparison.querySelectorAll("[data-step-note]").forEach((note) => { - note.hidden = note.getAttribute("data-step-note") !== selected; - }); + const selectStep = (button) => { + const selected = button.getAttribute("data-select-step"); + buttons.forEach((candidate) => { + candidate.setAttribute("aria-pressed", String(candidate === button)); }); + comparison.querySelectorAll("[data-step]").forEach((fragment) => { + fragment.classList.toggle( + "is-active", + fragment.getAttribute("data-step") === selected, + ); + }); + comparison.querySelectorAll("[data-step-note]").forEach((note) => { + note.hidden = note.getAttribute("data-step-note") !== selected; + }); + }; + buttons.forEach((button) => { + button.addEventListener("click", () => selectStep(button)); }); + const initial = Array.from(buttons).find( + (button) => button.getAttribute("aria-pressed") === "true", + ); + if (initial) selectStep(initial); }); } diff --git a/website/public/assets/styles.css b/website/public/assets/styles.css index 55b04ee22..3bcc84d9e 100644 --- a/website/public/assets/styles.css +++ b/website/public/assets/styles.css @@ -1297,10 +1297,18 @@ pre code { } .home-role-comparison { display: grid; - grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); - gap: 0 2.5rem; + grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); + gap: 0 2rem; margin: 0; } +.comparison-question { + margin-block: 1.8rem 1.2rem; + font-size: 1.05rem; + color: var(--muted); +} +.comparison-question strong { + color: var(--ink); +} .comparison-label { padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); @@ -1310,47 +1318,204 @@ pre code { .agent-investigation > .comparison-label { color: var(--accent); } -.manual-steps { - display: grid; - gap: 1rem; - padding: 0; - list-style: none; +.expert-step-selector { + grid-template-columns: repeat(3, minmax(0, 1fr)); + margin-block: 1.2rem 1rem; } -.manual-steps li { - display: flex; - gap: 1rem; +.expert-step-selector button { + min-height: 44px; + padding: 0.6rem 0.4rem; + font-size: 0.75rem; +} +.expert-step-selector button span { + font-size: 0.7rem; +} +.expert-analysis-grid { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 0.52fr); + align-items: start; + gap: 0.9rem; +} +.expert-assembly { + min-width: 0; margin: 0; } -.manual-steps li > span { - padding-top: 0.2rem; +.expert-assembly .code-header { + padding: 0.7rem 0.8rem; + font-size: 0.7rem; + cursor: pointer; + list-style: none; +} +.expert-assembly summary::-webkit-details-marker { + display: none; +} +.expert-assembly summary:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 3px; +} +.assembly-disclosure::after { + content: "Show +"; + color: var(--accent); + white-space: nowrap; +} +.expert-assembly[open] .assembly-disclosure::after { + content: "Hide −"; +} +.expert-assembly pre { + margin: 0; + padding: 0.8rem; + font-size: 0.7rem; + line-height: 1.6; +} +.assembly-omission { color: var(--muted); - font: - 0.75rem "SFMono-Regular", - Consolas, - "Liberation Mono", - monospace; } -.manual-steps strong, -.manual-steps small { +.expert-reasoning { + min-width: 0; + padding-top: 0.1rem; +} +.expert-thought { + position: relative; + padding: 1rem 0.9rem; + border: 1px solid var(--line); + border-radius: 16px; + background: var(--page); +} +.expert-thought + .expert-thought { + margin-top: 1rem; +} +.expert-thought::before, +.expert-thought::after { + content: ""; + position: absolute; + border: 1px solid var(--line); + border-radius: 50%; + background: var(--page); +} +.expert-thought::before { + bottom: -18px; + right: 38px; + width: 12px; + height: 12px; +} +.expert-thought::after { + bottom: -30px; + right: 47px; + width: 6px; + height: 6px; +} +.expert-thought > p { + margin: 0; + font-size: 0.85rem; + line-height: 1.65; +} +.expert-thought > .thought-label { + margin-bottom: 0.6rem; + color: var(--accent); + font-size: 0.7rem; + font-weight: 600; +} +.expert-thought > .expert-task { + margin-top: 0.8rem; + color: var(--muted); + font-size: 0.75rem; +} +.expert-facts { + display: grid; + gap: 0.45rem; + margin: 0.9rem 0 0; + padding-top: 0.8rem; + border-top: 1px solid var(--line); + font-size: 0.7rem; +} +.expert-facts div { + display: flex; + justify-content: space-between; + gap: 0.5rem; +} +.expert-facts dt { + font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; +} +.expert-facts dd { + margin: 0; + color: var(--accent); +} +.expert-rule { + display: grid; + gap: 0.3rem; + margin-top: 0.9rem; + padding-top: 0.8rem; + border-top: 1px solid var(--line); + font-size: 0.75rem; +} +.expert-rule strong { + color: var(--accent); + font-size: 1.4rem; +} +.expert-illustration { display: block; + width: 120px; + height: 90px; + margin: 2rem 0 0 auto; } -.manual-steps strong { - font-size: 0.95rem; +.expert-caption { + margin: 0.5rem 0 0; + color: var(--muted); + font-size: 0.65rem; + text-align: right; +} +.manual-work-summary { + margin: 1rem 0 0; + color: var(--muted); + font-size: 0.85rem; +} +.manual-work-summary strong { font-weight: 500; } -.manual-steps small { - margin-top: 0.15rem; - color: var(--muted); - font-size: 0.8rem; +.agent-one-prompt { + margin: 1.2rem 0 0.3rem; + color: var(--accent); + font-size: clamp(1.8rem, 3vw, 2.5rem); + font-weight: 600; + letter-spacing: -0.045em; } -.manual-code { - margin-top: 1.3rem; - padding: 1rem 1.25rem; - border-left: 2px solid var(--line); - background: var(--soft); +.agent-intro { + margin: 0 0 1.2rem; color: var(--muted); - font-size: 0.8rem; - line-height: 1.65; + font-size: 0.9rem; +} +.agent-percent-rule { + display: grid; + justify-items: start; + gap: 0.2rem; + margin-top: 0.9rem; + color: var(--accent); +} +.agent-percent-rule code { + color: var(--ink); +} +.agent-percent-rule > span { + margin-left: 0.4rem; + color: var(--muted); +} +.agent-percent-rule strong { + font-size: 1.2rem; +} +.agent-evidence-roles { + display: grid; + gap: 1rem; + margin: 1.2rem 0 0; +} +.agent-evidence-roles dt { + margin-bottom: 0.25rem; + color: var(--accent); + font-size: 0.75rem; + font-weight: 600; +} +.agent-evidence-roles dd { + margin: 0; + color: var(--muted); + font-size: 0.85rem; } .agent-investigation-note { color: var(--muted); @@ -1600,6 +1765,39 @@ pre code { } } @media (max-width: 640px) { + .expert-analysis-grid { + grid-template-columns: minmax(0, 1fr); + } + .expert-reasoning { + display: grid; + grid-template-columns: minmax(0, 1fr) 88px; + column-gap: 0.75rem; + align-items: end; + } + .expert-thought::before { + right: -18px; + bottom: 42px; + } + .expert-thought::after { + right: -30px; + bottom: 36px; + } + .expert-illustration { + width: 88px; + height: 66px; + margin: 0; + } + .expert-caption { + grid-column: 1 / -1; + text-align: left; + } + .expert-step-selector button { + font-size: 0.7rem; + } + .expert-step-selector button span { + display: block; + margin: 0 0 0.2rem; + } .case-brief { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; diff --git a/website/public/index.html b/website/public/index.html index 1722767dd..26f8d2b0a 100644 --- a/website/public/index.html +++ b/website/public/index.html @@ -128,51 +128,181 @@ change it or rebuild it.
++ One question: + why does Calculator give 220 for 200 + 10%? +
Before REA · You investigate
-0x180124945: MOV EAX, dword ptr [R13 + 0x18]
+0x180124949: CMP EAX, 0x5c
+0x18012494c: JZ 0x180124aba
+0x180124952: CMP EAX, 0x5b
+0x180124955: JZ 0x180124aba
+0x18012495b: MOV EDX, 0x64
+0x180124960: LEA RCX, [RSP + 0x160]
+0x180124968: CALL 0x180122650
+0x18012496e: LEA RDX, [R13 + 0x160]
+0x180124975: LEA RCX, [RSP + 0x78]
+0x18012497a: CALL 0x180109720
+0x18012497f: MOV RSI, RAX
+0x180124982: MOV qword ptr [RSP + 0x28], RAX
+0x180124987: LEA RDX, [RSP + 0x160]
+0x18012498f: MOV RCX, RAX
+0x180124992: CALL 0x180123190
+; … value-copy instructions omitted …
+0x180124a14: MOV RDX, RDI
+0x180124a17: LEA RCX, [RSP + 0xf8]
+0x180124a1f: CALL 0x180109720
+0x180124a24: LEA R8, [RSP + 0x30]
+0x180124a29: MOV RDX, RAX
+0x180124a2c: LEA RCX, [RSP + 0xb8]
+0x180124a34: CALL 0x180123c10
+ + You decode the instructions, follow the calls and reconstruct + the calculation. +
With REA · You ask your agent
++ Ask your agent in plain English. +
Use REA to inspect this dinosaur game. Why does it get - faster? Show the speed rule.Use REA to inspect Windows Calculator. Why does 200 + 10% + give 220?
- The game adds a little speed on each update. Its script sets - the starting speed, the increment and the stopping - point. + After +, the % button takes + a percentage of the first number.
+10% of 200 = 20200 + 20 = 220
+