From ffeba14c10e1cf7f2936cd9249a352474c0e9526 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 19 May 2024 05:11:11 -0400 Subject: unprotbas: exit status 2 for unprotected program; add -c (check only). --- unprotbas.rst | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'unprotbas.rst') diff --git a/unprotbas.rst b/unprotbas.rst index 557d27d..b3a9926 100644 --- a/unprotbas.rst +++ b/unprotbas.rst @@ -33,7 +33,7 @@ OPTIONS ======= **-v** - Verbose operation. + Verbose operation. TODO: it's always verbose right now... **-f** Force the variable name table to be rebuilt, even if it looks OK. @@ -46,10 +46,22 @@ OPTIONS Remove any "garbage" data from the end of the file. By default, it's left as-is, in case it's actually data used by the program. +**-c** + Check only. Does a dry run. Loads the program, unprotects it in + memory, but doesn't write the result anywhere. In this mode, there + is no **output-file**. + EXIT STATUS =========== -Exit status is zero for success, non-zero for failure. +0 + **input-file** was protected, unprotection was successful. + +1 + I/O error, or **input-file** isn't a valid BASIC program. + +2 + **input-file** is already an unprotected BASIC program. DETAILS ======= @@ -99,10 +111,13 @@ Variable name table scrambling require human intelligence to figure out what each variable is for, since the names are meaningless. - The **output-file** may be larger than the **input-file** was, since - some types of variable-name scrambling shrink the variable name - table to the minimum size (one byte per name); the rebuilt table - will be larger. + The **output-file** may not be the exact size that the + **input-file** was. Some types of variable-name scrambling shrink + the variable name table to the minimum size (one byte per name), so + the rebuilt table will be larger. Other types of scrambling leave + the variable name table at its original size, but **unprotbas** + generates only one- and two-character variable names, so the rebuilt + table might be smaller. Bad next-line pointer Generally, this is done with line number 32768. Yes, this line -- cgit v1.2.3