Posted by zdw 5 days ago
>Very importantly, there doesn’t seem to be any “input” into this routine. It doesn’t pop anything from the stack, nor does it care about any register values passed into it. Which can only mean that the result of this routine is completely constant!
This is not necessarily a fair assumption (though it worked this time). It could be some sort of a rolling code, where the reply is not constant but changes, and remains verifiable. Example: garge door openers have no input from the garage, but the sent signal differs every button click, and the garage can verify its correctnessBut even that need not be true. here is how you could design that dongle to require no persistent state on RX and still not allow simple replay.
TX code:
static u8 counter = 0;
tmp = randU12() * 16 + (counter++);
tmp2 = sha256(secret + tmp) & 0xffff;
send32((tmp << 16) + tmp2)
RX code:
static u16 prevSeenCodes[16];
static u8 idx = 0; tmp = recv32();
tmp2 = tmp & 0xffff;
tmp >>= 16;
if (sha256(secret + tmp) & 0xffff != tmp2)
fail();
if (tmp in prevSeenCodes)
fail();
prevSeenCodes[15 & idx++] = tmp;
now you need to replay at least a sequence of 16 codesthat array is in ram and need not persist across program runs. dongle can be powered off or can be left on. all will work
I had to do this for a company so they could continue to use their old specialised Win98 software on modern computers using Dosbox and an emulator.
> It required an input key that was unique to our dongle series & our own code that was whatever we wanted. The reply was a hash of both values.
> The last version we used was USB. They retired the parallel style long ago.
It worked well enough and allowed the company to run until the founder retired and folded the business.
in/out instructions wouldn't have a C equivalent. My assumption would be it only translates instructions that a C compiler would typically create.
They should be glad the copy protection is not more in the style of "The Games: Winter Challenge", where playing a pirated copy would make it subtly impossible to play many levels [1]. Would be 'fun' if the exported accounting data would contain all kinds of subtle errors.
Wrong! To my great surprise Linux wouldn't load, even after trying three different versions of Linux. After doing a massive search on the internet, I finally found a post that said I should crack open the case and remove the Optane chip, which I did. Presto, Linux was loaded and working fine!
If the authors client had been using an RPG accounting system for 40 years then it might be BPCS and there were tools out there to convert RPG to other less traumatic languages.
But fascinating article nonetheless and brought back memories of being an apps programmer. I also remember those dongles. Really fun when you had multiple apps with their own dongles and only one port.
It was actually a well designed and functional system, just too many bugs.
it’s wild to think about the hardware risk people used to accept putting your entire household's financial history on a system that bricks itself the second a 40-year-old plastic dongle fails. really great read.
You have no idea how deep this rabbit hole goes.
Patents are barely better than copyright, as far as society net-positive.