Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Corrupted QB45 saved program
#1
So a guy over on the other discord was asking for some help trying to salvage an old program he pulled off a floppy disk.
QB45 errors out "Bad File Mode" when trying to open it there to convert to plain text
and the QB64 converter runs for a while then errors out.

program is attached if anybody else wants to take a hack at getting any data out of it.


Attached Files
.bas   MAM.BAS (Size: 35.25 KB / Downloads: 86)
Reply
#2
Starting at line 24xx, there are error messages about exceeding a range. It could be that it doesn't fit within the variable's range — maybe.

The only way I see to solve the problem is to install the original Quick Basic 4.5 and then see what's going wrong.

Well, Quick Basic 4.5 still worked for me under Windows XP. Someone should try it.
Reply
#3
Glancing at the file in hex viewer it doesn't seem to be a pure QB45 compressed file.  The beginning looks like QB45 data, but most of the file looks like chunks of other disk data.  I suspect the floppy contained some file/data errors.  It may be possible to rip out and save the QB45 stuff from this file, but I'd have to dig into it deeper.  Perhaps the person could run a disk check/repair on the floppy and recopy the file?

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#4
(06-09-2025, 08:25 PM)Kernelpanic Wrote: Starting at line 24xx, there are error messages about exceeding a range. It could be that it doesn't fit within the variable's range — maybe.

The only way I see to solve the problem is to install the original Quick Basic 4.5 and then see what's going wrong.

Well, Quick Basic 4.5 still worked for me under Windows XP. Someone should try it.

I have qb45 still on an old laptop, I will try to open this up in it and see it it can recover any source.

EDIT: Nope.  QB45 says 'Bad file mode', like Cobalt said the discord guy said it did for him.  I have a couple home-brew tools that handles compressed BAS files, will run those on it and see what happens.  

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#5
Quote:which he downloaded from a floppy disk
The Discord user said it worked for him (Where?)
Contradictory!

The most obvious explanation would be that the source code on the disk is corrupted—because the disk itself is corrupted.
Looks like a bitter end.  Confused

Reply
#6
(06-09-2025, 08:44 PM)Dav Wrote:
(06-09-2025, 08:25 PM)Kernelpanic Wrote: Starting at line 24xx, there are error messages about exceeding a range. It could be that it doesn't fit within the variable's range — maybe.

The only way I see to solve the problem is to install the original Quick Basic 4.5 and then see what's going wrong.

Well, Quick Basic 4.5 still worked for me under Windows XP. Someone should try it.

I have qb45 still on an old laptop, I will try to open this up in it and see it it can recover any source.

EDIT: Nope.  QB45 says 'Bad file mode', like Cobalt said the discord guy said it did for him.  I have a couple home-brew tools that handles compressed BAS files, will run those on it and see what happens.  

- Dav
Well he said that anything that could be salvaged from it would be appreciated. I was going to try to hack the QB64 converter so it capped any erroneous values and forced an output so at least there would be something but, if you have something already that might do that all the better.
Reply
#7
(06-11-2025, 02:17 PM)Cobalt Wrote:
(06-09-2025, 08:44 PM)Dav Wrote:
(06-09-2025, 08:25 PM)Kernelpanic Wrote: Starting at line 24xx, there are error messages about exceeding a range. It could be that it doesn't fit within the variable's range — maybe.

The only way I see to solve the problem is to install the original Quick Basic 4.5 and then see what's going wrong.

Well, Quick Basic 4.5 still worked for me under Windows XP. Someone should try it.

I have qb45 still on an old laptop, I will try to open this up in it and see it it can recover any source.

EDIT: Nope.  QB45 says 'Bad file mode', like Cobalt said the discord guy said it did for him.  I have a couple home-brew tools that handles compressed BAS files, will run those on it and see what happens.  

- Dav
Well he said that anything that could be salvaged from it would be appreciated. I was going to try to hack the QB64 converter so it capped any erroneous values and forced an output so at least there would be something but, if you have something already that might do that all the better.

That sounds like the best bet, @Cobalt.  On the plus side, the start of the MAM.BAS file does look like it has a right header size (when I compared it to other QB45 fast load&save BAS files byte-by-byte).  The file data looks like it goes wonky after 450 bytes.  You may could grab a piece of the source.  Looks like this may be a thanksgiving program from looking at the keywords.  My other tools didn't help, btw.

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#8
The best that I can recover is
Code: (Select All)
DECLARE SUB WALK () 
DECLARE SUB MAP ()
DECLARE SUB SELL ()
DECLARE SUB WOOD ()
DECLARE SUB SOR ()
DECLARE SUB FOOD ()
DECLARE SUB SAVE ()
DECLARE SUB TENT ()
DECLARE SUB INDIANS ()
DECLARE SUB STAT ()
DECLARE SUB TITLE ()
DECLARE SUB DEL ()
DECLARE SUB FILE ()
COMMON SHARED CB, D, OPG, SK, R, BET, A$, AA, AE, AX, BB, BF, BI, CC, CK, DD
COMMON SHARED DW, FA, FT, HH, LT, LU, NH, RR, SS, SH, T$, TH, TP, WT, F, M, S
COMMON SHARED T, W, Z, AQ$, ART, AXT, BDW, BQ$, CQ$, DWT, PAE, WCT, FM, FS
COMMON SHARED DB, LB, SP, BK, KA, BOD, DT, KF, OD
DIM SHARED ZZ(1 TO 4000)
RANDOMIZE TIMER
OPEN "RAN.DAT" FOR INPUT AS #1
IF EOF(1) = -1 THEN
  CLOSE #1
  GOTO BEGINING
END IF
INPUT #1,KA, OD, KF, DT, BOD, OPG, SK, A$, AA, AE, AX, BB, BF, BI, CB, CC, CK, DD, DW, FA, FT, HH, LT, LU, NH, RR, SS, SH, T$, TH, TP, WT, F, M, T, W, Z, AQ$, ART, AXT, BDW, BQ$, CQ$, DWT, PAE, WCT, FM, FSDB;LB, SP
Reply
#9
Rest of the data is from another file. Probably an executable PCShell. Looks like 3rd party dosshell type thing.
Reply
#10
I loaded the file into a hex editor, and something about a PC shell appears. Maybe someone knows something like that? - Is the file possibly encrypted?

[Image: MAM-Bas-Hexeditor.jpg]

IDA offers a free disassembler, maybe that will help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Corrupted printing PhilOfPerth 3 573 07-08-2025, 04:57 AM
Last Post: PhilOfPerth
  Oldest QB45 bug ever known eoredson 13 2,419 07-31-2024, 03:07 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)