Author Topic: A novel way to protect BASIC programs on CPC464  (Read 598 times)

0 Members and 2 Guests are viewing this topic.

Offline ssg

  • Supporter
  • CPC664
  • *
  • Posts: 68
  • Country: tr
  • NOP
  • Liked: 22
  • Likes Given: 29
A novel way to protect BASIC programs on CPC464
« on: 00:52, 16 August 20 »
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! :)

Offline Johnny Olsen

  • Supporter
  • CPC6128
  • *
  • Posts: 285
  • Country: dk
  • Liked: 213
  • Likes Given: 401
Re: A novel way to protect BASIC programs on CPC464
« Reply #1 on: 11:23, 16 August 20 »
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.  :)

Offline ssg

  • Supporter
  • CPC664
  • *
  • Posts: 68
  • Country: tr
  • NOP
  • Liked: 22
  • Likes Given: 29
Re: A novel way to protect BASIC programs on CPC464
« Reply #2 on: 22:31, 17 August 20 »
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.  :)

Yay! :)

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.081
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 940
  • Likes Given: 2343
Re: A novel way to protect BASIC programs on CPC464
« Reply #3 on: 02:46, 18 August 20 »
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 (Recent update: 2020.11.28)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.106
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3504
  • Likes Given: 6318
Re: A novel way to protect BASIC programs on CPC464
« Reply #4 on: 14:18, 18 August 20 »
Send it in to AA :D

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.810
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2914
  • Likes Given: 1753
Re: A novel way to protect BASIC programs on CPC464
« Reply #5 on: 14:47, 18 August 20 »
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)