How did Apple ][ basic programs protect against listing?
up vote
1
down vote
favorite
I seem to recall from my high-school days that certain Apple ][ programs protected themselves from being listed and therefore modified.
If you tried to do it, the machine would simply reboot.
How did they achieve this, and can it be bypassed to get at the code?
apple-ii copy-protection
|
show 12 more comments
up vote
1
down vote
favorite
I seem to recall from my high-school days that certain Apple ][ programs protected themselves from being listed and therefore modified.
If you tried to do it, the machine would simply reboot.
How did they achieve this, and can it be bypassed to get at the code?
apple-ii copy-protection
1
Mind to explain why you write a question when you already seam to know the answer?
– Raffzahn
6 hours ago
3
@Raffzahn, because that's actually accepted practice and has been for quite a while (I suggest you have a read of retrocomputing.stackexchange.com/help/self-answer) - the idea of SE is to create a repository of good questions and answers for future searchers, not just to get your immediate problems solved. It appears that you yourself have taken advantage of this (retrocomputing.stackexchange.com/questions/6006/…) so I'm unsure why you think that makes it a bad question..
– paxdiablo
6 hours ago
2
In addition, as you extended the comment, yes, I did answer my own question but if you take a closer look, I didn't do so to answer a fake question, but I waited about three month and then published my own findings during that time. The question is still open for a real answer. As before, research does help before typing.
– Raffzahn
5 hours ago
1
There are no personal attacks here, I'm calling out your behaviour and how it differs from accepted practice. If you see that as personal, that's on you. I would do the same to Atwood, Spolsky or Jon Skeet :-) Have the last word if you wish, I think the best thing I can do is move on.
– paxdiablo
5 hours ago
2
I think I need a drink after reading this...
– manassehkatz
5 hours ago
|
show 12 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I seem to recall from my high-school days that certain Apple ][ programs protected themselves from being listed and therefore modified.
If you tried to do it, the machine would simply reboot.
How did they achieve this, and can it be bypassed to get at the code?
apple-ii copy-protection
I seem to recall from my high-school days that certain Apple ][ programs protected themselves from being listed and therefore modified.
If you tried to do it, the machine would simply reboot.
How did they achieve this, and can it be bypassed to get at the code?
apple-ii copy-protection
apple-ii copy-protection
asked 6 hours ago
paxdiablo
1,088730
1,088730
1
Mind to explain why you write a question when you already seam to know the answer?
– Raffzahn
6 hours ago
3
@Raffzahn, because that's actually accepted practice and has been for quite a while (I suggest you have a read of retrocomputing.stackexchange.com/help/self-answer) - the idea of SE is to create a repository of good questions and answers for future searchers, not just to get your immediate problems solved. It appears that you yourself have taken advantage of this (retrocomputing.stackexchange.com/questions/6006/…) so I'm unsure why you think that makes it a bad question..
– paxdiablo
6 hours ago
2
In addition, as you extended the comment, yes, I did answer my own question but if you take a closer look, I didn't do so to answer a fake question, but I waited about three month and then published my own findings during that time. The question is still open for a real answer. As before, research does help before typing.
– Raffzahn
5 hours ago
1
There are no personal attacks here, I'm calling out your behaviour and how it differs from accepted practice. If you see that as personal, that's on you. I would do the same to Atwood, Spolsky or Jon Skeet :-) Have the last word if you wish, I think the best thing I can do is move on.
– paxdiablo
5 hours ago
2
I think I need a drink after reading this...
– manassehkatz
5 hours ago
|
show 12 more comments
1
Mind to explain why you write a question when you already seam to know the answer?
– Raffzahn
6 hours ago
3
@Raffzahn, because that's actually accepted practice and has been for quite a while (I suggest you have a read of retrocomputing.stackexchange.com/help/self-answer) - the idea of SE is to create a repository of good questions and answers for future searchers, not just to get your immediate problems solved. It appears that you yourself have taken advantage of this (retrocomputing.stackexchange.com/questions/6006/…) so I'm unsure why you think that makes it a bad question..
– paxdiablo
6 hours ago
2
In addition, as you extended the comment, yes, I did answer my own question but if you take a closer look, I didn't do so to answer a fake question, but I waited about three month and then published my own findings during that time. The question is still open for a real answer. As before, research does help before typing.
– Raffzahn
5 hours ago
1
There are no personal attacks here, I'm calling out your behaviour and how it differs from accepted practice. If you see that as personal, that's on you. I would do the same to Atwood, Spolsky or Jon Skeet :-) Have the last word if you wish, I think the best thing I can do is move on.
– paxdiablo
5 hours ago
2
I think I need a drink after reading this...
– manassehkatz
5 hours ago
1
1
Mind to explain why you write a question when you already seam to know the answer?
– Raffzahn
6 hours ago
Mind to explain why you write a question when you already seam to know the answer?
– Raffzahn
6 hours ago
3
3
@Raffzahn, because that's actually accepted practice and has been for quite a while (I suggest you have a read of retrocomputing.stackexchange.com/help/self-answer) - the idea of SE is to create a repository of good questions and answers for future searchers, not just to get your immediate problems solved. It appears that you yourself have taken advantage of this (retrocomputing.stackexchange.com/questions/6006/…) so I'm unsure why you think that makes it a bad question..
– paxdiablo
6 hours ago
@Raffzahn, because that's actually accepted practice and has been for quite a while (I suggest you have a read of retrocomputing.stackexchange.com/help/self-answer) - the idea of SE is to create a repository of good questions and answers for future searchers, not just to get your immediate problems solved. It appears that you yourself have taken advantage of this (retrocomputing.stackexchange.com/questions/6006/…) so I'm unsure why you think that makes it a bad question..
– paxdiablo
6 hours ago
2
2
In addition, as you extended the comment, yes, I did answer my own question but if you take a closer look, I didn't do so to answer a fake question, but I waited about three month and then published my own findings during that time. The question is still open for a real answer. As before, research does help before typing.
– Raffzahn
5 hours ago
In addition, as you extended the comment, yes, I did answer my own question but if you take a closer look, I didn't do so to answer a fake question, but I waited about three month and then published my own findings during that time. The question is still open for a real answer. As before, research does help before typing.
– Raffzahn
5 hours ago
1
1
There are no personal attacks here, I'm calling out your behaviour and how it differs from accepted practice. If you see that as personal, that's on you. I would do the same to Atwood, Spolsky or Jon Skeet :-) Have the last word if you wish, I think the best thing I can do is move on.
– paxdiablo
5 hours ago
There are no personal attacks here, I'm calling out your behaviour and how it differs from accepted practice. If you see that as personal, that's on you. I would do the same to Atwood, Spolsky or Jon Skeet :-) Have the last word if you wish, I think the best thing I can do is move on.
– paxdiablo
5 hours ago
2
2
I think I need a drink after reading this...
– manassehkatz
5 hours ago
I think I need a drink after reading this...
– manassehkatz
5 hours ago
|
show 12 more comments
2 Answers
2
active
oldest
votes
up vote
4
down vote
One way was to place an in-line reboot command into the actual listing.
Apple ][ DOS had a feature that would monitor the output stream and, if it found a special character, the rest of the line would be treated as a command. This character was a CTRL-D, meaning you could get a disk listing from your program with something like:
PRINT CHR$(4);"CATALOG"
You could also use the slot activation command IN#6
which would generally reboot the machine, assuming your disk controller was in slot 6 (it usually was).
But, of course, that would only work with a print
command if you were running your program. For protecting against someone listing it, an extra layer of trickery was required.
You would create a line at the start of your program:
10 REM XIN#6
and then use POKE 99999, 4
to change the X
into a CTRL-D, adjusting the 99999
to point to the actual X
character of course.
After that, an attempt to LIST
the program would result in the machine rebooting. So this is probably something you wanted to do once development was done, just before shipping :-)
In order to bypass it, it's a simple matter of working out the errant line and just deleting it. In the case above, that would be acheived by just entering the stand-alone:
10
on the command line and, voila, the program is unprotected. To stop this, some developers started numbering the programs with less "normal" line numbers such as 2718
. However, since the line numbers are stored in memory as well, you could PEEK
at the program to work out what the first line number was, and then delete that one.
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.
– supercat
4 hours ago
add a comment |
up vote
0
down vote
IIRC, there were lots of variations to implement this scheme. Besides embedding characters in the listing that would reboot, or clear the screen every so often, a particular one I remember worked roughly like this:
The listing only consisted of a single CALL
. The internal structure of the BASIC rogram was carefully changed so the listing was stopped there, but there was a lot of stuff after this single command. This call would be to an embedded machine program somewhere in the BASIC listing, which would re-arrange the structure to make the whole program visible, and also register itself with some hooks to make it invisible again. You could defeat this protection by disassembling the machine code and running part of it. Or even by pressing RESET or something at a proper time, I forgot the details.
Not all BASIC programs that consisted of a single CALL
were like this. There were also pure machine programs which disguised itself as BASIC programs in this way for some reason I never understood.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
One way was to place an in-line reboot command into the actual listing.
Apple ][ DOS had a feature that would monitor the output stream and, if it found a special character, the rest of the line would be treated as a command. This character was a CTRL-D, meaning you could get a disk listing from your program with something like:
PRINT CHR$(4);"CATALOG"
You could also use the slot activation command IN#6
which would generally reboot the machine, assuming your disk controller was in slot 6 (it usually was).
But, of course, that would only work with a print
command if you were running your program. For protecting against someone listing it, an extra layer of trickery was required.
You would create a line at the start of your program:
10 REM XIN#6
and then use POKE 99999, 4
to change the X
into a CTRL-D, adjusting the 99999
to point to the actual X
character of course.
After that, an attempt to LIST
the program would result in the machine rebooting. So this is probably something you wanted to do once development was done, just before shipping :-)
In order to bypass it, it's a simple matter of working out the errant line and just deleting it. In the case above, that would be acheived by just entering the stand-alone:
10
on the command line and, voila, the program is unprotected. To stop this, some developers started numbering the programs with less "normal" line numbers such as 2718
. However, since the line numbers are stored in memory as well, you could PEEK
at the program to work out what the first line number was, and then delete that one.
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.
– supercat
4 hours ago
add a comment |
up vote
4
down vote
One way was to place an in-line reboot command into the actual listing.
Apple ][ DOS had a feature that would monitor the output stream and, if it found a special character, the rest of the line would be treated as a command. This character was a CTRL-D, meaning you could get a disk listing from your program with something like:
PRINT CHR$(4);"CATALOG"
You could also use the slot activation command IN#6
which would generally reboot the machine, assuming your disk controller was in slot 6 (it usually was).
But, of course, that would only work with a print
command if you were running your program. For protecting against someone listing it, an extra layer of trickery was required.
You would create a line at the start of your program:
10 REM XIN#6
and then use POKE 99999, 4
to change the X
into a CTRL-D, adjusting the 99999
to point to the actual X
character of course.
After that, an attempt to LIST
the program would result in the machine rebooting. So this is probably something you wanted to do once development was done, just before shipping :-)
In order to bypass it, it's a simple matter of working out the errant line and just deleting it. In the case above, that would be acheived by just entering the stand-alone:
10
on the command line and, voila, the program is unprotected. To stop this, some developers started numbering the programs with less "normal" line numbers such as 2718
. However, since the line numbers are stored in memory as well, you could PEEK
at the program to work out what the first line number was, and then delete that one.
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.
– supercat
4 hours ago
add a comment |
up vote
4
down vote
up vote
4
down vote
One way was to place an in-line reboot command into the actual listing.
Apple ][ DOS had a feature that would monitor the output stream and, if it found a special character, the rest of the line would be treated as a command. This character was a CTRL-D, meaning you could get a disk listing from your program with something like:
PRINT CHR$(4);"CATALOG"
You could also use the slot activation command IN#6
which would generally reboot the machine, assuming your disk controller was in slot 6 (it usually was).
But, of course, that would only work with a print
command if you were running your program. For protecting against someone listing it, an extra layer of trickery was required.
You would create a line at the start of your program:
10 REM XIN#6
and then use POKE 99999, 4
to change the X
into a CTRL-D, adjusting the 99999
to point to the actual X
character of course.
After that, an attempt to LIST
the program would result in the machine rebooting. So this is probably something you wanted to do once development was done, just before shipping :-)
In order to bypass it, it's a simple matter of working out the errant line and just deleting it. In the case above, that would be acheived by just entering the stand-alone:
10
on the command line and, voila, the program is unprotected. To stop this, some developers started numbering the programs with less "normal" line numbers such as 2718
. However, since the line numbers are stored in memory as well, you could PEEK
at the program to work out what the first line number was, and then delete that one.
One way was to place an in-line reboot command into the actual listing.
Apple ][ DOS had a feature that would monitor the output stream and, if it found a special character, the rest of the line would be treated as a command. This character was a CTRL-D, meaning you could get a disk listing from your program with something like:
PRINT CHR$(4);"CATALOG"
You could also use the slot activation command IN#6
which would generally reboot the machine, assuming your disk controller was in slot 6 (it usually was).
But, of course, that would only work with a print
command if you were running your program. For protecting against someone listing it, an extra layer of trickery was required.
You would create a line at the start of your program:
10 REM XIN#6
and then use POKE 99999, 4
to change the X
into a CTRL-D, adjusting the 99999
to point to the actual X
character of course.
After that, an attempt to LIST
the program would result in the machine rebooting. So this is probably something you wanted to do once development was done, just before shipping :-)
In order to bypass it, it's a simple matter of working out the errant line and just deleting it. In the case above, that would be acheived by just entering the stand-alone:
10
on the command line and, voila, the program is unprotected. To stop this, some developers started numbering the programs with less "normal" line numbers such as 2718
. However, since the line numbers are stored in memory as well, you could PEEK
at the program to work out what the first line number was, and then delete that one.
answered 6 hours ago
paxdiablo
1,088730
1,088730
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.
– supercat
4 hours ago
add a comment |
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.
– supercat
4 hours ago
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing
:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.– supercat
4 hours ago
My recollection is that you could simply type the control-D as part of the input line. No need for poking about. One could list a program without processing such things by typing
:PR#0
with a colon before it to ensure it's processed as a BASIC command rather than a DOS one.– supercat
4 hours ago
add a comment |
up vote
0
down vote
IIRC, there were lots of variations to implement this scheme. Besides embedding characters in the listing that would reboot, or clear the screen every so often, a particular one I remember worked roughly like this:
The listing only consisted of a single CALL
. The internal structure of the BASIC rogram was carefully changed so the listing was stopped there, but there was a lot of stuff after this single command. This call would be to an embedded machine program somewhere in the BASIC listing, which would re-arrange the structure to make the whole program visible, and also register itself with some hooks to make it invisible again. You could defeat this protection by disassembling the machine code and running part of it. Or even by pressing RESET or something at a proper time, I forgot the details.
Not all BASIC programs that consisted of a single CALL
were like this. There were also pure machine programs which disguised itself as BASIC programs in this way for some reason I never understood.
add a comment |
up vote
0
down vote
IIRC, there were lots of variations to implement this scheme. Besides embedding characters in the listing that would reboot, or clear the screen every so often, a particular one I remember worked roughly like this:
The listing only consisted of a single CALL
. The internal structure of the BASIC rogram was carefully changed so the listing was stopped there, but there was a lot of stuff after this single command. This call would be to an embedded machine program somewhere in the BASIC listing, which would re-arrange the structure to make the whole program visible, and also register itself with some hooks to make it invisible again. You could defeat this protection by disassembling the machine code and running part of it. Or even by pressing RESET or something at a proper time, I forgot the details.
Not all BASIC programs that consisted of a single CALL
were like this. There were also pure machine programs which disguised itself as BASIC programs in this way for some reason I never understood.
add a comment |
up vote
0
down vote
up vote
0
down vote
IIRC, there were lots of variations to implement this scheme. Besides embedding characters in the listing that would reboot, or clear the screen every so often, a particular one I remember worked roughly like this:
The listing only consisted of a single CALL
. The internal structure of the BASIC rogram was carefully changed so the listing was stopped there, but there was a lot of stuff after this single command. This call would be to an embedded machine program somewhere in the BASIC listing, which would re-arrange the structure to make the whole program visible, and also register itself with some hooks to make it invisible again. You could defeat this protection by disassembling the machine code and running part of it. Or even by pressing RESET or something at a proper time, I forgot the details.
Not all BASIC programs that consisted of a single CALL
were like this. There were also pure machine programs which disguised itself as BASIC programs in this way for some reason I never understood.
IIRC, there were lots of variations to implement this scheme. Besides embedding characters in the listing that would reboot, or clear the screen every so often, a particular one I remember worked roughly like this:
The listing only consisted of a single CALL
. The internal structure of the BASIC rogram was carefully changed so the listing was stopped there, but there was a lot of stuff after this single command. This call would be to an embedded machine program somewhere in the BASIC listing, which would re-arrange the structure to make the whole program visible, and also register itself with some hooks to make it invisible again. You could defeat this protection by disassembling the machine code and running part of it. Or even by pressing RESET or something at a proper time, I forgot the details.
Not all BASIC programs that consisted of a single CALL
were like this. There were also pure machine programs which disguised itself as BASIC programs in this way for some reason I never understood.
answered 14 mins ago
dirkt
8,26812344
8,26812344
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f8364%2fhow-did-apple-basic-programs-protect-against-listing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Mind to explain why you write a question when you already seam to know the answer?
– Raffzahn
6 hours ago
3
@Raffzahn, because that's actually accepted practice and has been for quite a while (I suggest you have a read of retrocomputing.stackexchange.com/help/self-answer) - the idea of SE is to create a repository of good questions and answers for future searchers, not just to get your immediate problems solved. It appears that you yourself have taken advantage of this (retrocomputing.stackexchange.com/questions/6006/…) so I'm unsure why you think that makes it a bad question..
– paxdiablo
6 hours ago
2
In addition, as you extended the comment, yes, I did answer my own question but if you take a closer look, I didn't do so to answer a fake question, but I waited about three month and then published my own findings during that time. The question is still open for a real answer. As before, research does help before typing.
– Raffzahn
5 hours ago
1
There are no personal attacks here, I'm calling out your behaviour and how it differs from accepted practice. If you see that as personal, that's on you. I would do the same to Atwood, Spolsky or Jon Skeet :-) Have the last word if you wish, I think the best thing I can do is move on.
– paxdiablo
5 hours ago
2
I think I need a drink after reading this...
– manassehkatz
5 hours ago