News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ssg

A novel way to protect BASIC programs on CPC464

Started by ssg, 22:52, 15 August 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ssg

This is something I discovered myself while brute forcing everything in BASIC interpreter back in the 80's, so I think nobody else had known it before me.

You probably know how a program listing is shown only with its first line:


LIST
10 'CRACKED BY SSG
Ready


That's done by fiddling with the line length bytes of the first line (&170, &171). That was well known back then.

My technique was to add a REM line with Ctrl+F and add another dummy line, because Ctrl+F caused skipping the next line.


10 'CRACKED BY SSG
20 '✓
30 'Dummy line
40 ' Some secret code


Normally it lists fully, but after you ran the program once this is what you'd see:


10 'CRACKED BY SSG
20 '✓


AFAIK, it only worked with BASIC 1.0 though. And you had to make sure that you'll never need to access the code again because it was hard to recover from (you had to find that byte and overwrite it).

Another interesting side effect of this was that if you wrote '✓ directly, it would run the program. Magic! :)

What I want to know is if this technique was already discovered by someone else before 1989. Otherwise, I'd like to call dibs! :)

Johnny Olsen

I've never heard of that ctrl + f trick, but it's an easy way to remove the line length on the next line.
Congratulations with DIBS.  :)

ssg

Quote from: Johnny Olsen on 09:23, 16 August 20I've never heard of that ctrl + f trick, but it's an easy way to remove the line length on the next line. Congratulations with DIBS.  :)

Yay! :)

GUNHED

Remember that an similar thing was used to autorun programs after a CAT command. However it needed a slight ROM patch. Similar, but not the same technique IIRC.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Gryzor


TotO

I do remember to have see some protected commercial BASIC "loader" with some control chars into the listing, but not sure about the real usage.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Powered by SMFPacks Menu Editor Mod