diff options
-rw-r--r-- | unprotbas.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/unprotbas.c b/unprotbas.c index cfdcf75..acbbecf 100644 --- a/unprotbas.c +++ b/unprotbas.c @@ -159,10 +159,8 @@ int fixline(int linepos) { /* this works for lines with multiple statements (colons): */ while(!done) { - fprintf(stderr, "offset was %02x\n", offset); offset = data[linepos + offset]; token = data[linepos + offset - 1]; - fprintf(stderr, "offset %02x token %02x\n", offset, token); if(token != 0x14) done++; } @@ -171,7 +169,6 @@ int fixline(int linepos) { next-statement offset. */ if(!offset) { offset = data[linepos + 3]; - fprintf(stderr, "offset now %02x\n", offset); } data[linepos + 2] = offset; @@ -196,7 +193,7 @@ int fixcode(void) { offset = data[pos + 2]; /* fprintf(stderr, "pos %d, line #%d, offset %d\n", pos, lineno, offset); */ if(offset < 6) { - if(verbose) fprintf(stderr, "Found invalid offset %d (<6) at line %d\n", offset, lineno); + if(verbose) fprintf(stderr, "Found invalid offset %d (<6) at line %d, file offset %04x\n", offset, lineno, pos); offset += fixline(pos); result++; } @@ -584,6 +581,11 @@ void apply_var_map(void) { void scramble_vars(void) { int i; + if(!vntable_ok()) { + fprintf(stderr, "%s: program already was variable-protected.\n", self); + exit(2); + } + for(i = vnstart; i < vvstart - 1; i++) data[i] = '\x9b'; |