Page 1 of 1

Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 10:27 am
by Pantzmaster
Hello all

I've recently been doing a little hex editing to the graphics.dat file in the DM2 directory and just wondering if someone can give me any tips or reading material (or just an outright explanation) on how people previously have managed to actually extract images from it so they're able to be viewed outside the game itself. It seems to be very difficult to find information on, as most information regarding this matter resides on dmweb.free.fr and I haven't seen that website up for a long time now (well, all the download links there are anyway if I view the page as cached. Still can't really find anything though.)

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 12:38 pm
by Gambit37
dmweb.free.fr is not down, it's running perfectly. Check again, all the info you need is on there... it sounds like you may have some local internet block or proxy server issues with your ISP.

This page on dmweb lists lots of useful tools: http://dmweb.free.fr/?q=taxonomy/term/47,80

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 12:52 pm
by Pantzmaster
Strange, it's been down literally for months for me. Thanks for the page and I'll try to work out why I can't go to the website.

Edit: I visited the website through a proxy, and it worked. Huh...

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 1:21 pm
by Gambit37
Glad you got to it in the end.
It could be that your ISP runs sites through its own proxy which is broken and caching very old pages, or is caching the site at a point when it was genuinely down.
I'd speak to them about it and see what's up, hopefully they can improve it for you.

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 1:28 pm
by Pantzmaster
Yeah, might do that. Even if I can only access it through a proxy though, that's fine with me. Found some neat utilities on that page and looking into them now. Thank you very much! :D

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 1:30 pm
by Gambit37
You're welcome. By the way, there's no need to quote a full message when you're replying directly after: just use "Reply", saves on screen space and database size ;-)

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 1:34 pm
by Pantzmaster
Alright, will do!

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Oct 03, 2012 6:46 pm
by ChristopheF
Unless you've already downloaded it, the best extractor for DM2 data files (all versions) is sck, available here: http://greatstone.free.fr/dm/

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Thu Oct 04, 2012 3:57 am
by Pantzmaster
Thanks Christophe, fantastic link.

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Thu Oct 04, 2012 11:18 am
by Pantzmaster
Still having trouble finding any really specific information on what I'm trying to accomplish. Maybe I'm just not good at searching for this sort of stuff lol, has anyone actually had experience doing this sort of thing?

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Thu Oct 04, 2012 11:47 am
by Gambit37
Do you just want to view the graphics, or are you trying to write your own code to extract them?

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Thu Oct 04, 2012 11:57 am
by Pantzmaster
Well, first find out actually where in the hex values an image (or images) are found, and then if need be write something to extract them into a readable format such as JPEG or PNG. Though a list of offsets would be nice, I was more looking for something that actually ran through the steps of getting to that point. Maybe I'm asking the wrong question considering my limited knowledge of hex editing lol :? just not sure what the next step would be.

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Thu Oct 04, 2012 12:44 pm
by Gambit37
Hex editing isn't programming ;-) Are you a programmer? You'll need some programming basics to write an extractor and image converter.

Greatstone, author of SCK mentioned above, and ChristopheF have both accomplished reverse engineering of the DM data structures. Hopefully one of them can help, or you can look at the various pages on DMweb that detail the formats:
http://dmweb.free.fr/?q=taxonomy/term/39 -- DM2 stuff is at the bottom.

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Thu Oct 04, 2012 12:57 pm
by Pantzmaster
I know a little C# and C++ so I'm fine with that part, it's just the whole hex aspect that is new to me. I'll check out the link and get in contact with those guys if I need to, thanks again! You've been a big help :)

Using some of those documents, I managed to decode TORHAMS name and replace it with some of my own characters!

Re: Extracting graphics from GRAPHICS.DAT?

Posted: Wed Dec 19, 2012 7:43 am
by Sphenx
I am not sure to understand what you're trying to do ?

Did you try DM2GDED http://dmweb.free.fr/?q=node/721 ? With this tool you will be able to extract/edit/replace images (and other resources) within the GRAPHICS.DAT file.

For technical details on how to read a graphics.dat file, Gambit pointed the right place on dmweb; altough as I wrote my own DM2 graphics.dat file generator I can be of some help :)

I won't say you do "hex editing" on graphics.dat file since the file is structured : it has a header, a table with sizes of all items, then encoded data for all items -- and because all of these can be of different sizes, you must understand the structure before editing properly any item.