aboutsummaryrefslogtreecommitdiff
path: root/unprotbas.rst
diff options
context:
space:
mode:
Diffstat (limited to 'unprotbas.rst')
-rw-r--r--unprotbas.rst20
1 files changed, 15 insertions, 5 deletions
diff --git a/unprotbas.rst b/unprotbas.rst
index 9a9a47d..d0ba0dc 100644
--- a/unprotbas.rst
+++ b/unprotbas.rst
@@ -175,8 +175,8 @@ Bad next-line pointer
after LOADing such a file, *nothing* will work (even pressing RESET
won't get you out of it). The only way to use such a program is to
use the RUN command with a filename, and if the program ever exits
- (due to END, STOP, an error, or the Break key), BASIC will get stuck
- again.
+ (due to END, STOP, an error, Break key, or even System Reset), BASIC
+ will get stuck again.
This doesn't *have* to be done with the last line in the
program. The "poisoned" line could be followed by more lines of
@@ -186,9 +186,16 @@ Bad next-line pointer
the STMCUR pointer used by BASIC, which holds the address of the
line of tokenized code currently being executed.
- **unprotbas** fixes this simply by calculating what the pointer
- should be (based on the tokens in the line) and changing it. No
- information is lost by doing this.
+ Each statement in the line also has a statement-length byte. For
+ lines with only one statement, its value is the same as the line
+ length. For lines with multiple statements (separated by *:*), it's
+ a pointer to the next statement, counting from the start of the
+ current line. For the last statement on a line, it's a pointer to
+ the next line of code, meaning it's identical to the line length.
+
+ **unprotbas** fixes bad line lengths by setting the line length to
+ the statement length of the last statement. No information is lost
+ by doing this.
The program **UNPROTEC**, from the *Pirate's Treasure Chest*, can
fix bad pointers in protected programs, though it doesn't do
@@ -227,6 +234,9 @@ longer exist. **unprotbas** will generate them, according to these rules:
The first 26 array variables will be *A(* to *Z(*, then *A1(* to
*A9(*, *B1(* to *B9(*, etc.
+Note that array variables have only the *(* as part of the name. The
+closing *)* is "cosmetic" and not part of the actual name.
+
To properly reverse-engineer the protected program, it's necessary to assign
meaningful variable names. **unprotbas** isn't smart enough to do this for you,
but it can semi-automate the process.