Breaking Eggs And Making Omelettes

Topics On Multimedia Technology and Reverse Engineering


Archives:

Meta:

Meet mlbms

February 27th, 2006 by Multimedia Mike

Janusz Dziemidowicz has been making some nifty progress with his mlbms program for mounting game resource archive format (GRAF) files. Check this out:

$ mlbms bms/alg-lib.bms resource-files/alg-lib/maddog.lib mount/
$ ls -al mount/
total 1
dr-xr-xr-x  2 melanson users       0 Feb 26 23:05 .
drwxr-xr-x  7 melanson users    1120 Feb 26 19:07 ..
-r--r--r--  1 melanson users  305172 Feb 26 23:05 alg.mm
-r--r--r--  1 melanson users   24912 Feb 26 23:05 credits.mm
-r--r--r--  1 melanson users  314245 Feb 26 23:05 ibmlogo.mm
-r--r--r--  1 melanson users  338277 Feb 26 23:05 scen110a.mm
-r--r--r--  1 melanson users  278177 Feb 26 23:05 scen112a.mm
[... ad nauseum ...]

Slick, huh? I knew you’d think so. This command mounts the LIB GRAF from Mad Dog McCree as part of the normal filesystem.

Read the rest of this entry »

Posted in Open Source Multimedia | No Comments »

Graph Traversal Puzzle

February 26th, 2006 by Multimedia Mike

Pickover came through with a slightly more involved brute force challenge. As usual I’ll spare you the flowery setup (though I did find it curious that it involved a character named Ben trying to reach one named Jennifer) and distill the essential details. Given this graph of values:

 1  2  3  4  5
 6  7  8  9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

find a path from any square in column 1 to any square in column 5, moving up, down, left, or right, such that the sum of all squares traversed tallies 90.

I liked writing this program because it is the most algorithmically interesting thing I have done in a long time, even though I originally solved the wrong problem. The way I originally read the problem, the task was to move from node 1 -> node 5, traversing up, down, left, or right, and find a path where the values sum to 90.

Read the rest of this entry »

Posted in Pickover Puzzles | 2 Comments »

Send More Geese

February 23rd, 2006 by Multimedia Mike

Pickover’s puzzle for the weekend of February 4-5 challenged the reader to find 8 numbers to stand in for the letters D, E, G, M, N, O, R, and S such that the equation SEND + MORE = GEESE would be true. Again, there are multiple solutions. I’m pleased to report that I found 3 orders of magnitude more solutions than the big brain himself.

Read the rest of this entry »

Posted in Pickover Puzzles | 4 Comments »

Another Pickover Puzzle

February 22nd, 2006 by Multimedia Mike

Cliff Pickover’s puzzle from 2006-02-22 queries the reader to come up with 3 pairs, or possibly more, of numbers, m and n, which satisfy the equation n! + 1 = m2. I didn’t think too hard about it. I just went straight to code which turned out to be a good thing because one of the solutions is quite large. Click more to see the reasoning I went through and the solutions output from my program.

Read the rest of this entry »

Posted in Pickover Puzzles | 4 Comments »

SDL Corruption Corrected

February 22nd, 2006 by Multimedia Mike

When I do presentations on multimedia technology I make the point that data is more important than code which is to say that understanding data formats is more useful than being able to run binary code. This little exercise is a good illustration of that. Initially, if someone wanted to see the multimedia, they needed access to an original IBM PC to run it as it was originally intended. It is also apparently possible to run it under DOSBox. In that case you are still running the original binary code to interpret the data. Now along comes this third solution which throws out the original code and just interprets the data with portable, open code.

Download Trixter’s original 8088 Corruption package from his site. Download the sdl_corruption.c program and the CGA_FONT.8X8 font file from http://multimedia.cx/sdl-corruption/. Make sure you have SDL. Compilation is straightforward on Unix. At the very least, it works on x86 and AMD64 machines running Linux. You are on your own for other platforms.


Corrected Eiffel Breakdancer Image
There, that looks correct, or as correct as it is supposed to look.

I did not bother to add sound output because I was lazy. Hey, I solved the harder problem of rendering the font vectors. I also added a few spiffy features such as allowing the user to seek and pause the video.

Posted in Open Source Multimedia | 3 Comments »

SDL Corruption

February 21st, 2006 by Multimedia Mike

Pursuant to Alex’s challenge to write a Unix player for Trixter’s 8088 Corruption data file, combined with an interest in re-learning the Simple DirectMedia Layer (SDL) API, I wrote a basic program that takes said data file, a font file, and the hardwired colors in the CGA card and renders the video using SDL. I don’t think the font vectors I scavenged are 100% the same as the ones in Trixter’s IBM model 5150 PC:


Eiffel Tower Breakdancer

In particular, I’m not sure about all of those box characters. I think the box is supposed to be one flat color. Anyway, here is another shot, only from the “Tron light cycles” section of video:


Tron Light Cycles

Followed up in SDL Corruption Corrected.

Posted in Outlandish Brainstorms, Reverse Engineering | 1 Comment »

For The Uninitiated

February 20th, 2006 by Multimedia Mike

Upon observing my ‘multimedia.cx’ domain name, someone recently inquired what kind of work I do in ‘multimedia’. I responded with a generic explanation of “digital multimedia technology” since multimedia can be kind of a broad field. When pressed to expound upon that term for the benefit of a non-technical person I responded with this:

Digital multimedia technology… you probably know that computers operate in bits– ones and zeros. 8 bits combine to make a byte. Computers store data as bits, retrieve the data as bits, and communicate with each other as bits. My field deals with taking pictures and sounds and converting them into as few bits as possible, and then turning them back into pictures and sounds again.

How’s that? How would you explain “digital multimedia technology” in the simplest terms?

Posted in General | No Comments »

SNES FMV

February 19th, 2006 by Multimedia Mike

After sorting out Trixter’s 8088 Corruption details sometime ago I started to wonder about FMV on other relatively low-power systems. Let’s consider the Super Nintendo Entertainment System (SNES).


Super Nintendo Entertainment System

The SNES came out quite some time after the original IBM PC (10 years?). Still, the original IBM PC targeted in Trixter’s experiment had several advantages such as more capacity (10 megabytes of HD space), a marginally more powerful CPU (Intel 8088 @ 4.77 MHz), and a pre-defined vector codebook for the FMV hack.

Let’s start with a modest goal: 1 full minute (60 seconds) of full motion video and audio on the regulation Super Nintendo Entertainment System hardware.

Read the rest of this entry »

Posted in Outlandish Brainstorms | 3 Comments »

AVS Implementation

February 16th, 2006 by Multimedia Mike

Thanks to Aurelien Jacobs for implementing a complete FFmpeg playback system for the AVS format. And thanks again to VAG for reverse engineering the system in the first place. It takes dedication to work on such a format that was used in one known game, Creature Shock. Well, more than one if you count the DOS, 3DO, Sega Saturn, and CD-i versions separately, and even more than that if you count the special “director’s” edition (I still need to log that one into MobyGames).

To be fair, the people behind Creature Shock went on to make a few other video games that you likely never heard of, like Alien Odyssey and FX Fighter. Both of these games contained FMV (the former being another FMV-driven game) and the formats are suspected to be influenced by AVS.

Posted in Open Source Multimedia | No Comments »

Basic FFmpeg Hacking

February 15th, 2006 by Multimedia Mike

A few more people have expressed interest in writing file demuxers and audio/video decoders for the FFmpeg project. I present herewith a brief guide to creating both demuxers and decoders for that project.

Start with the demuxer:

  • copy one of the simpler formats (libavformat/idcin.c or idroq.c) to a new file and start modifying the key parts
  • edit libavformat/allformats.c and libavformat/avformat.h and add the proper _init() function
  • edit libavformat/Makefile and add the new file to the end of the OBJS list

You should be able to build the new demuxer module into the project now. Check ‘ffmpeg -formats’ to make sure. You can use printf()’s or gdb along with the ffmpeg for debugging.

Next is the video decoder:

  • copy one of the simpler video decoders (libavcodec/msrle.c or msvideo1.c) to a new file and start modifying the key parts
  • edit libavcodec/avcodec.h and add a new CODEC_ID; also add the new data structure declared at the end of the new file
  • edit libavcodec/allcodecs.c and add the new data structure there as well
  • edit libavcodec/Makefile and add the new file to the end of the OBJS list

It helps to recompile the entire project after adding a new CODEC_ID just to make sure it “takes”. ‘ffmpeg -formats’ should now report the new format. Proceed with development and debugging. Note that in libavcodec, printf()s are forbidden. Use av_log(NULL, AV_LOG_INFO, …) instead.

Posted in Open Source Multimedia, Programming | 2 Comments »

« Previous Entries