{"id":28994036,"url":"https://github.com/binarymelodies/msbasic-savefile-re","last_synced_at":"2026-02-14T19:32:32.739Z","repository":{"id":300371117,"uuid":"1005999716","full_name":"BinaryMelodies/msbasic-savefile-re","owner":"BinaryMelodies","description":"Reverse engineering Microsoft BASIC binary save formats","archived":false,"fork":false,"pushed_at":"2025-06-24T16:36:11.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T19:45:04.378Z","etag":null,"topics":["basic","microsoft-basic","qb","quickbasic","reverse-engineering","vbdos"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BinaryMelodies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-21T09:05:37.000Z","updated_at":"2025-06-24T16:36:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"0bb81a41-4a72-4372-9bcd-8a987d0f0d82","html_url":"https://github.com/BinaryMelodies/msbasic-savefile-re","commit_stats":null,"previous_names":["binarymelodies/msbasic-savefile-re"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BinaryMelodies/msbasic-savefile-re","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMelodies%2Fmsbasic-savefile-re","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMelodies%2Fmsbasic-savefile-re/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMelodies%2Fmsbasic-savefile-re/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMelodies%2Fmsbasic-savefile-re/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryMelodies","download_url":"https://codeload.github.com/BinaryMelodies/msbasic-savefile-re/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMelodies%2Fmsbasic-savefile-re/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29453435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","microsoft-basic","qb","quickbasic","reverse-engineering","vbdos"],"created_at":"2025-06-25T03:10:24.198Z","updated_at":"2026-02-14T19:32:32.734Z","avatar_url":"https://github.com/BinaryMelodies.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reverse engineering the binary save formats of Microsoft BASIC\n\nThis repository will be a collection of documents and scripts that help reverse engineering binary save formats of various Microsoft BASIC versions.\n\n## QuickBASIC\n\nThe folder `qb` contains the current work for QuickBASIC versions 4.0, 4.5, 7.0, 7.1 as well as Visual Basic for MS-DOS.\nIt contains `doc.html`, documenting the file format as it is known, and a script `qb.py` that takes as argument the file name of a BASIC file, saved in binary format, and outputs a textual representation.\nThe output should be as close to the text format saved by QuickBASIC.\n\n## Macintosh BASIC\n\nUnlike the MS-DOS versions, QuickBASIC for Macintosh uses a tokenized file format, similar to GW-BASIC.\nLike QuickBASIC, line numbers are optional, and variable names are stored in a table.\nThe script `mac.py` in the folder `mac` converts a Macintosh binary file into text output.\n\n### Format of QuickBASIC binary files\n\nThe first byte is `F1` (hexadecimal) for tokenized files (`F0` for protected files, format unknown).\nIt is then followed by a series of lines.\n\nEach line starts with a 16-bit big endian word, encoding the length of the line in bytes (including this 16-bit word).\nThe most significant bit is set if the line starts with a line number.\nThen a single byte encodes the number of spaces (one less if it starts with a line number) preceding the first non-space character.\nIf the line has a line number (that is, the most significant bit of the initial 16-bit word is set), then a 16-bit big endian word follows, storing the number.\nThe line body then follows as a token stream, with bytes `20` to `7E` (hexadecimal) encoding their ASCII values.\nEach line is then terminated by a null byte.\n\nThe last line is followed by a 16-bit null word, an impossible byte length for a line (it is always at least 2 bytes long).\nThen the section containing identifier names follows.\nIt always starts on an even address, with a single null byte, followed by the identifiers.\nEach identifier begins with a single byte, encoding the length of the identifier, followed by the characters of the identifier.\n\nIdentifiers are indexed by their number in the sequence: the first identifier is accessed as identifier 0, the second one as identifier 1, and so on.\n\nFor the various token types, see `mac.py` under the `mac` folder.\n\n# Disclaimer\n\nThis work is done without any access to disassembly or internal documentation to the BASIC executables.\nAll information is provided as-is, with no warranty as to its correctness or usability.\nHowever, the author believes the code produces generally correct output.\n\n# Useful links\n\nGW-BASIC, the predecessor to QuickBASIC, uses its own binary format, already documented in other places:\n* [Documentation of the binary format](http://www.chebucto.ns.ca/~af380/GW-BASIC-tokens.html)\n* [PC-BASIC documentation of the binary format](http://robhagemans.github.io/pcbasic/doc/2.0/#technical)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarymelodies%2Fmsbasic-savefile-re","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarymelodies%2Fmsbasic-savefile-re","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarymelodies%2Fmsbasic-savefile-re/lists"}