Space Quest II Disk Leak: Sierra’s AGI Source Code Exposed

BYMark Howell 2 years ago4 MINS READ
Space Quest II Disk Leak: Sierra’s AGI Source Code Exposed

We want to talk about the hidden treasures found in old floppy disks from Sierra On-Line's Space Quest II (versions 2.0D and 2.0F). These seemingly ordinary disks hold a special secret that even the developers were unaware of. Stored within these disks, which were part of many Sierra adventure game collections, is a treasure trove of source code that was never meant to see the light of day.

Copy link Hidden Treasures in Floppy Disks

When you list the files within these disks, there's nothing unusual that stands out initially. Everything looks standard, with timestamps from mid-March 1988. However, upon closer examination using a hex editor such as the HxD Hex Editor, it becomes evident that over half of the disk space, marked as "free", contains what appears to be C source code.
Instead of the expected 0xF6 byte (the DOS default filler byte), the sectors are filled with a large amount of source code, suggesting that these disks were repurposed without proper formatting. Essentially, the data of previously used files persisted because merely deleting files does not erase the underlying data in the DOS FAT file system.

Copy link Discovery of AGI Interpreter Source Code

Image Description: Analyzing Space Quest II Disk 1 using HxD Hex Editor.
This secret stash of data revealed several functions, including DisplayStatusLine and StatusLineOn, crucial parts of the AGI interpreter responsible for displaying game status. Exploring further, it was found that the data included about 70% of the source code for Sierra On-Line’s AGI (Adventure Game Interpreter), which powered their early graphic adventure games.
By splitting the data into distinct C source files, 93 files were identified, including:

  • 75 C source files
  • 16 Assembly language source files
  • 2 DOS BAT files
    All combined for over 15,000 lines of code, offering a substantial look into the workings of AGI during its heyday.
Edworking
All your work in one place
All-in-one platform for your team and your work. Register now for Free.
Get Started Now

Copy link Behind the Scenes: Source File Change History and Memory Map

A fascinating find within the source files is the detailed change history in the header comments. This history includes details like date, time, and initials of the developers involved, such as Jeff Stephenson and Chris Iden, key figures in the development of AGI games.
Additionally, a memory map of the AGI.EXE executable from October 1987 was discovered. This map, combined with the most recent change history comments from September 1987, aligns the source files’ timeline and confirms the authenticity of the data.

Copy link Sierra’s Intellectual Property Blunder

The AGI system was a crucial part of Sierra On-Line’s success, particularly after a rough patch in 1984 where they had to lay off numerous employees. Games developed using AGI, like King’s Quest, were instrumental in reviving the company's fortunes.
Unfortunately, a preparation error for the Space Quest II 2.0D and 2.0F master disks led to a substantial lapse in protecting this valuable source code. The disk duplication process used by their FormMaster machine copied every byte—used or not—resulting in hundreds of thousands of game copies containing confidential interpreter source code.

Copy link An Unintentional Leak

Ultimately, it appears that no one at Sierra, nor its customers or competitors, realized the lapse. This remained undetected until an online user, NewRisingSun, uncovered it in October 2016. By then, Sierra had already transitioned to their new SCI adventure game system, reducing the potential impact of the leaked AGI code.
For those interested, the extracted AGI interpreter source code can be explored further in the following GitHub repository. Additionally, a web-based AGI interpreter implementation, guided in part by the original source code, can be found at AGILE.
Edworking is the best and smartest decision for SMEs and startups to be more productive. It is a FREE superapp of productivity that includes all you need for work powered by AI in the same superapp, connecting Task Management, Docs, Chat, Videocall, and File Management. Save money today by not paying for Slack, Trello, Dropbox, Zoom, and Notion.

Edworking
All your work in one place
All-in-one platform for your team and your work. Register now for Free.
Get Started Now

Copy link Remember these 3 key ideas for your startup:

  1. Data Security is Crucial: Always ensure sensitive data is entirely removed before repurposing any storage medium. Simply deleting files is not sufficient.
  2. Understand Your Tools: Familiarize yourself with tools like hex editors which can be invaluable in data analysis and troubleshooting.
  3. Learning from Mistakes: Even large companies can make significant errors. Continuous monitoring and checks can prevent minor oversights from becoming major issues.

  • Feel free to dive deeper into the rich history of AGI interpreter and discover how these early innovations paved the way for modern-day gaming. For more details, see the original source.
  • Mark Howell

    About the Author: Mark Howell

    LinkedIn

    Mark Howell is a talented content writer for Edworking's blog, consistently producing high-quality articles on a daily basis. As a Sales Representative, he brings a unique perspective to his writing, providing valuable insights and actionable advice for readers in the education industry. With a keen eye for detail and a passion for sharing knowledge, Mark is an indispensable member of the Edworking team. His expertise in task management ensures that he is always on top of his assignments and meets strict deadlines. Furthermore, Mark's skills in project management enable him to collaborate effectively with colleagues, contributing to the team's overall success and growth. As a reliable and diligent professional, Mark Howell continues to elevate Edworking's blog and brand with his well-researched and engaging content.

    Startups

    Try Edworking Background

    A new way to work from anywhere, for everyone for Free!

    Get Started Now