From d259c8ad40bec782aca1a865f9f205f4756c1193 Mon Sep 17 00:00:00 2001 From: Compot Developer Date: Sun, 15 Nov 2026 23:56:54 +0000 Subject: [PATCH] Web hex view: an older answer changes nothing, and no dump hides the panel An answer that comes after a newer request no longer sets the dump size or goes back to address 0 (Go could then refuse a valid address). A state with no dump, after the service started again, hides the panel and drops a part still coming, instead of keeping the old bytes. --- CHANGELOG.md | 6 ++++++ src/main.c | 2 +- src/web_page.html | 6 ++++-- tests/websim.c | 7 ++++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 514b38a..7567086 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ The version lives in `_VER` in `src/main.c`. Binaries are published only as the [`latest`](https://github.com/OpenIPC/microsnander/releases/latest) release, rebuilt from every push to `main`; this file is the change history. +## 1.43.1 — 2026-11-16 + +- Web mode, hex view: an answer that comes after a newer request changes nothing (before, it could + still set the dump size or go back to address 0, and Go then refused a valid address); a state + with no dump (the service started again) hides the panel instead of keeping the old bytes. + ## 1.43.0 — 2026-11-16 - Android app: a hex view of the last dump (#85), under the status registers, as in the web diff --git a/src/main.c b/src/main.c index d8d5b13..9595a66 100644 --- a/src/main.c +++ b/src/main.c @@ -42,7 +42,7 @@ struct flash_cmd prog; extern unsigned int bsize; -#define _VER "1.43.0" +#define _VER "1.43.1" const char *ms_version = _VER; diff --git a/src/web_page.html b/src/web_page.html index 63a79c9..9bde5fc 100644 --- a/src/web_page.html +++ b/src/web_page.html @@ -200,7 +200,7 @@

MicroSNANDer Web

sr.forEach(function(v,i){h+='
SR'+(i+1)+'
';names[i].forEach(function(n,k){var on=(v>>(7-k))&1;h+='
'+n+'
'})}); $('regs').innerHTML=h; }else if(!s.busy&&['detect','registers','unprotect'].indexOf(s.op)>=0)$('regpanel').hidden=true; - if(s.file&&!s.busy)hexOpen(s.file); + if(!s.busy){if(s.file)hexOpen(s.file);else hexClose()} /* no dump: the service started again */ if(!s.busy&&lastOp==='read'&&s.op==='read'&&s.ok&&s.file){lastOp='';location.href=base+'/dumps/'+encodeURIComponent(s.file)} if(!document.body.classList.contains('ready'))setTimeout(function(){document.body.classList.add('ready')},50); /* the first state is shown at once */ if(s.busy&&!timer)timer=setInterval(poll,500); @@ -209,15 +209,17 @@

MicroSNANDer Web

/* the hex view of the last dump: 512 bytes a page, read with Range */ var hx={file:'',off:0,size:0,req:0},HXP=512; function h2(v,n){var s=v.toString(16).toUpperCase();while(s.length=hx.size)"), - " the hex view of the last dump, read with Range, only the last answer shown"); + strstr(body_of(), "if(b&&my===hx.req)hexDraw(") && + strstr(body_of(), "[0-9a-f]{1,12}$/i") && strstr(body_of(), "if(hx.size&&n>=hx.size)") && + strstr(body_of(), "if(my!==hx.req)return null;") && strstr(body_of(), "if(s.file)hexOpen(s.file);else hexClose()"), + " the hex view of the last dump, read with Range, only the last answer used, hidden with no dump"); check(strstr(body_of(), "function detectThen") && strstr(body_of(), "(o==='erase'||o==='write'||o==='selftest'||o==='unprotect')&&!s.chip"), " Erase and Write wait for a chip: off without one, a Detect before the question");