spasm-ng icon indicating copy to clipboard operation
spasm-ng copied to clipboard

Apps smaller than 256 bytes are not signed correctly

Open tari opened this issue 1 year ago • 4 comments

According to https://www.cemetech.net/forum/viewtopic.php?p=307300#307300, spasm generates incorrect signatures for apps that are smaller than 256 bytes.

tari avatar Jun 12 '24 23:06 tari

It's worth noting that apparently, calculators with boot code <1.10 run such apps with bad signatures just fine.

On an emulated ROM dump of a calculator with boot 1.10 and OS 2.55MP, the app also gets verified and the bad signature is ignored; therefore it seems this issue is only present on physical calculators with boot code 1.10+.

I am unsure if the OS version plays any role in this.

twisted-nematic57 avatar Jun 13 '24 00:06 twisted-nematic57

In that case it's not really a bug in this tool, but a calculator bug. It would be nice to generate a warning in that case, to inform users that a small app may not work on all calculators.

tari avatar Jun 13 '24 07:06 tari

I guess that would be sufficient as it would have saved me my headache.

"Warning: App size is <256B, please consider padding to ensure compatibility with all calculators"

twisted-nematic57 avatar Jun 13 '24 15:06 twisted-nematic57

I reviewed my notes on spasm-ng problems, and I had misremembered the problem. I thought that spasm was barfing on flash pages < 256 bytes. It turns out that it was printing spurious warnings when the last flash page is < 1024. I filed a separate ticket for that problem in #81.

bxparks avatar Jun 20 '24 00:06 bxparks