From abdafc3fdf75b92a7a46eac6e0747f9a536a0447 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 29 May 2024 15:09:09 -0400 Subject: unprotbas: improve -s option. --- unprotbas.1 | 6 +++--- unprotbas.c | 12 +++++++++--- unprotbas.rst | 6 +++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/unprotbas.1 b/unprotbas.1 index 0f34aec..c103ed5 100644 --- a/unprotbas.1 +++ b/unprotbas.1 @@ -122,9 +122,9 @@ codes. Do not put a space between the \fB\-x\fP and the hex digits or \fBr\fP\&. This option only works if \fB\-p\fP or \fB\-pv\fP is used. .TP .B \fB\-s\fP -Shrink variable name table to one byte per variable name, with \fB\-p\fP or -\fB\-pv\fP\&. Cannot be used with \fB\-xr\fP\&. Programs protected this way are -very similar to ones protected with \fBPROTECT.BAS\fP\&. +Shrink variable name table to one byte per variable name, with +\fB\-p\fP or \fB\-pv\fP\&. Programs protected this way are very similar to +ones protected with \fBPROTECT.BAS\fP\&. .UNINDENT .SH EXIT STATUS .INDENT 0.0 diff --git a/unprotbas.c b/unprotbas.c index 8c8651f..bf1fb7e 100644 --- a/unprotbas.c +++ b/unprotbas.c @@ -652,10 +652,15 @@ void scramble_vars(void) { if(verbose) { i -= vnstart; - if(i) - fprintf(stderr, "replaced %d byte variable name table with EOLs.\n", i); - else + if(i) { + fprintf(stderr, "replaced %d byte variable name table with ", i); + if(varname_char == -1) + fprintf(stderr, "random characters.\n"); + else + fprintf(stderr, "character $%02x\n", varname_char); + } else { die("can't protect variables because there are no variables."); + } } } @@ -670,6 +675,7 @@ void print_help(void) { fprintf(stderr, "-w: write variable names to varnames.txt\n"); fprintf(stderr, "-r: read variable names from varnames.txt\n"); fprintf(stderr, "-pc/-pv/-p: protect code/variables/both\n"); + fprintf(stderr, "-s: shrink variable name table to min size, with -p/-pv\n"); fprintf(stderr, "-xNN: hex code NN for variable names, with -p/-pv\n"); fprintf(stderr, "-xr: random variable names, with -p/-pv\n"); fprintf(stderr, "Use - as a filename to read from stdin and/or write to stdout\n"); diff --git a/unprotbas.rst b/unprotbas.rst index 1840e71..5722880 100644 --- a/unprotbas.rst +++ b/unprotbas.rst @@ -103,9 +103,9 @@ Protection Options This option only works if **-p** or **-pv** is used. **-s** - Shrink variable name table to one byte per variable name, with **-p** or - **-pv**. Cannot be used with **-xr**. Programs protected this way are - very similar to ones protected with **PROTECT.BAS**. + Shrink variable name table to one byte per variable name, with + **-p** or **-pv**. Programs protected this way are very similar to + ones protected with **PROTECT.BAS**. EXIT STATUS =========== -- cgit v1.2.3