From 79ba7b783def208893d13fe785e7d8bde76740a2 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 24 May 2024 04:22:02 -0400 Subject: unprotbas: add -p/-pc/-pv to docs, plus verbose operation for them. --- unprotbas.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'unprotbas.c') diff --git a/unprotbas.c b/unprotbas.c index 8540e6a..a95e9a6 100644 --- a/unprotbas.c +++ b/unprotbas.c @@ -239,7 +239,8 @@ void breakcode(void) { } data[oldpos + 2] = 0; - fprintf(stderr, "set invalid line pointer at line %d\n", lineno); + if(verbose) + fprintf(stderr, "set invalid line length 0 at line %d, file offset %04x\n", lineno, oldpos + 2); } /* sometimes the variable name table isn't large enough to hold @@ -579,6 +580,9 @@ void scramble_vars(void) { for(i = vnstart; i < vvstart - 1; i++) data[i] = '\x9b'; + + if(verbose) + fprintf(stderr, "replaced %d byte variable name table with EOLs.\n", i); } void print_help(void) { @@ -704,6 +708,15 @@ int main(int argc, char **argv) { if(lomem) die("This doesn't look like an Atari BASIC program (no $0000 signature)"); if(protect_code || protect_vars) { + if(verbose) { + fprintf(stderr, "%s: protecting program, ", self); + if(protect_vars && !protect_code) + fprintf(stderr, "variables only.\n"); + else if(protect_code && !protect_vars) + fprintf(stderr, "code only.\n"); + else + fprintf(stderr, "both code and variables.\n"); + } if(protect_vars) scramble_vars(); if(protect_code) breakcode(); } else { -- cgit v1.2.3