Road To El Dorado reversing video

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

dimi.t.d
Posts: 8
Joined: Mon Aug 18, 2014 5:34 am

Road To El Dorado reversing video

Post by dimi.t.d »

Hi guys,
I've had an idea of making a video tutorials on reverse engineering a game and adding it as a new engine for ResidualVM. So I've started a video series on youtube about reversing The Road To El Dorado game by Revolution Software, I'll be happy to hear you comments and suggestions about this.

Thanks.
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Re: Road To El Dorado reversing video

Post by Botje »

Thanks for the video.
I only had the time to watch the first twenty minutes so far, but could you add a rough table of contents (ideally with time stamps) to the description?
dimi.t.d
Posts: 8
Joined: Mon Aug 18, 2014 5:34 am

Re: Road To El Dorado reversing video

Post by dimi.t.d »

Botje, thanks for the comment. I'll try to add some links in the description. I'm sorry if the videos are too long, but I'm trying to keep about 1 hour, because I've noticed that this is about the right amount of time to cover a single step of the process and there is a lot of work to cover.

By the way a little bit off topic. I have a game called "In Cold Blood" also by Revolution software, which was released about the same year that "Road To El Dorado" was and I've noticed, that the engine there is the same, so as a bonus in reversing the Road To El Dorado we might be getting "In Cold Blood" running in Residual also.
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: Road To El Dorado reversing video

Post by bgK »

Thanks for the video. It's always interesting to see how fellow reversers proceed. I'd be interested in seeing more.
User avatar
somaen
ScummVM Developer
Posts: 376
Joined: Thu Apr 21, 2011 7:31 pm
Location: Trondheim, NO

Re: Road To El Dorado reversing video

Post by somaen »

I just sat through the entire thing, and I found it a good and steady introduction. You were mostly carefull to mention the hotkeys you used (which of course is important as the viewers can't see your keyboard), and corrected yourself when you forgot to mention them.

The first part, where you looked through the files to get an overview, was a bit interesting, and had a very nice flow in it, which became a bit less easy to follow when you jumped into IDA, I think that was a bit because you weren't completely sure how much you wanted to cover various things. Covering the few functions you did there was a good start though, demonstrating how far you can get with renaming and function prototype modification in IDA/Hex Rays, and how much help that information is when it "trickles back up" to the calling functions.

Two small things I noticed:
The while-loop you were looking at in Set_string seems to be a search for the '\0'-character, I was tripped up a bit by the decompiled code when I saw it, so I stared at it a bit while you talked (specifically the -1), it is counting down from -1, and counting the pointer up, comparing the dereferenced pointer to 0. Anyhow, the result is visibly used in the last few lines. I do wonder why the strlen-result wasn't used for this purpose though.

Also, I noticed that those memory-allocated variables you named, shouldn't really have kB behind them, they are shifted in the argument to the function, so the actual content in the variables would be in bytes, but the value passed to debugPrint would be kiloBytes.

I really appreciate your effort in creating such videos, thanks a lot.
dimi.t.d
Posts: 8
Joined: Mon Aug 18, 2014 5:34 am

Re: Road To El Dorado reversing video

Post by dimi.t.d »

Thank you for your comments, I really appreciate them. I've tried to follow your advices and I think my second video is better structured. It got longer than the first one, but I think I've managed to cover a lot of stuff there, so I've just uploaded it as it is. I've fixed the issues somaen mentioned, and I've tried to follow Botje advice to have a table of contents overview of the video.
User avatar
JohnnyWalker2001
Posts: 405
Joined: Mon Oct 16, 2006 1:27 pm
Location: London, UK

Re: Road To El Dorado reversing video

Post by JohnnyWalker2001 »

I also watched the first 20 mins. Very interesting stuff. I really like that you took the time to mention the keyboard commands you used, as it helps people like me who are new to IDA.

Also, it'd be great if we got IN COLD BLOOD, too. That was an underrated game!
dimi.t.d
Posts: 8
Joined: Mon Aug 18, 2014 5:34 am

Re: Road To El Dorado reversing video

Post by dimi.t.d »

Hey guys. I just want to share that In my 4th video I've managed to reverse the CLU files format, so I now have some tools for extracting the data files from the game. So if anyone is interested here's a command line tool for extracting the game data files: https://gist.github.com/idimiter/8e9c6c987b3862c920eb/

* First argument is CLU archive and the second is the index of the file you need extracted.
* Also in there I've included make_hash.c which is a tool implementing the strings hashing algorithm used for the engine. Its based on the make_hash subroutine in the reversed code

This is for the CLU file format used in both Road To El Dorado and In Cold Blood games.

Next time maybe I want to focus are the image formats used there. From first glance I can see that most of the 2dart files have .bitmap_pc file extension, and they start with the magic sequence "PCB" (Which I'm guessing stands for PCBitmap or something like that). If someone knows something about those please let me know. For now I see they contain a colour palette in the header.
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Re: Road To El Dorado reversing video

Post by Botje »

You could add the CLU extractor to your own fork of residualvm/residualvm-tools.
Keep up the good work!
User avatar
JohnnyWalker2001
Posts: 405
Joined: Mon Oct 16, 2006 1:27 pm
Location: London, UK

Re: Road To El Dorado reversing video

Post by JohnnyWalker2001 »

Great job!
dimi.t.d
Posts: 8
Joined: Mon Aug 18, 2014 5:34 am

Re: Road To El Dorado reversing video

Post by dimi.t.d »

Hey guys, sorry if this looks like a spam, but I go too excited, and I want to share it with you that I now have the bitmap_pc format fully reversed and the scripting system almost reversed. I've updated the gist repository with an pcb2ppm.c converter (In my 5th video you can see the steps I took to reverse the PCB format) . And of course once I'm done with those I'll send a PR for the ResidualVM tools. I want to tank all of you for your support here and in the irc chat.

I am now focusing on the 3d formats and I'm hoping that soon we may have something to test in residualVM.
JenniBee
Posts: 95
Joined: Fri Sep 17, 2010 5:22 am

Re: Road To El Dorado reversing video

Post by JenniBee »

Thanks for posting this. I always enjoy reading about people reverse engineering games, and I really enjoy how you've taken it a step further by detailing the process in video. Congratulations on how far you've come so far, and do keep us updated. It's been a fascinating glimpse into your process.
User avatar
JohnnyWalker2001
Posts: 405
Joined: Mon Oct 16, 2006 1:27 pm
Location: London, UK

Re: Road To El Dorado reversing video

Post by JohnnyWalker2001 »

Hardly spam. Keep them coming! (Where are the links?)
dimi.t.d
Posts: 8
Joined: Mon Aug 18, 2014 5:34 am

Re: Road To El Dorado reversing video

Post by dimi.t.d »

Hey guys. Thanks for the nice comments, I really appreciate them. I think I've managed to reverse most of the graphic formats now.The nice thing is that the fonts are also in PCB format, so with the pcb2ppm.c we can extract those too.

I've updated my gist files file with the rtx2ppm.c and pcb2ppm.c files used to convert them to a known format (PPM).

I'm working on the 3d formats now, before returning to the script logic and the code reversing.
User avatar
Longcat
Posts: 1061
Joined: Sat Sep 23, 2006 3:15 pm

Re: Road To El Dorado reversing video

Post by Longcat »

Thank's for working on this, I love Gold and Glory and never in my wildest dreams imagined it might be included in ResidualVM!

Antia-aliasing on those models would be fantastic.
Post Reply