Author Archives: Multimedia Mike

Quake 3 Source Code Available (and RoQ engine too!)

Little by little, proprietary multimedia codecs become open source, one way or another. Sometimes, the originating companies release the code. Eric Lasota tipped me off that id recently saw fit to release the source code for Quake III under the GNU GPL, just as they have previously done for their Doom 1 & 2 and Quake 1 & 2 engines. You can download the source code file (quake3-1.32b-source.zip) from this FTP directory. What makes this development particularly pertinent to multimedia hacking is that the file quake3-1.32b/code/client/cl_cin.c contains the formal decode engine for the RoQ file format, which is the FMV format used in Quake III and games derived from the Q3 engine (such as Jedi Knight II, Return To Castle Wolfenstein, and American McGee’s Alice).

So anything that may have been confusing should be clear upon looking at the official source code. Dr. Tim Ferguson originally reverse engineered the format. From the official source it appears that there were some other features perhaps planned and not implemented, or omitted from the final version. These features apparently include a JPEG encoding mode. In fact, there are 4 extra chunk types that go largely unused (ROQ_QUAD = 0x1000, ROQ_QUAD_JPEG = 0x1012, ROQ_QUAD_HANG = 0x1013, and ROQ_PACKET = 0x1030). The context in which the JPEG mode is defined implies that a frame could be encoded using a JPEG or JPEG-like method. I am not entirely sure what HANG means but it could indicate that the current frame is unchanged from the previous frame.

Eric also points out that the code does, in fact, immediately decode the codebooks from YUV -> RGB16 and everything is processed in that colorspace. I have long suspected that this is a holdover from The 11th Hour which is where the RoQ format got its start. The FMV needed to be played back on 1995-vintage PCs which were not very capable of playing YUV data directly, and converting full frames of YUV data -> RGB would not have been plausible.

Kostya’s Wild Codec Blog

I am pleased to announce that Kostya Shishkov has opened a new blog: Kostya’s Wild Codec World. Kostya is a talented codec hacker who has sorted out the details of the QPEG, TechSmith Screen Capture Codec (TSCC), IBM Ultimotion, Autodesk RLE (AASC), and Indeo 2, among other audio and video codecs, and has helped implement open source decoders for the FFmpeg project. His current target is Duck/On2’s old TrueMotion v2 codec. Soon we may finally be able to natively view the movies from the Final Fantasy VII PC game.

Head over to his blog and keep up with his progress.

Going About This All Wrong

So the people who make movies are making a movie about Doom. Forgive this brief digression but I must get something off my chest. Have you downloaded the trailer(s) for this movie? Here is the QuickTime file for the second Doom trailer (25 MB, 640×352, SVQ3 video, MP3 audio). What I would like to draw attention to is a feature of the movie that is prominently showcased in the second trailer:


FPS Movie

Why does this irk me so much?

Continue reading →

Java Deobfuscation In Use; Eclipse For Refactoring

Believe it or not, other people actually are using my Java de-obfuscation via RetroGuard solution. Further, they are finding a lot of problems with my basic solution and have contributed a number of patches to make the program stronger. I hope to incorporate the patches in the next few days and also maybe figure out how to release an actual .jar file so that using the program will be simpler.

On a Java-related topic, there is the Eclipse project. I am not especially familiar with it but apparently it is supposed to be God’s gift to software engineering. The reason I bring it up is that one of the Java de-obfuscator contributors passed along that Eclipse can help refactor Java code (automatically searching for and replacing identifier names throughout an entire project). The catch, it seems, is that the source code needs to be compilable. The de-obfuscator did not always meet that requirement which is why this particular individual needed the program fixed.

Anyway, I just thought I would mention it since I have not seen a tool that can do this. The refactoring support would be useful for reverse engineering/de-obfuscation work.