News: 11 March 2016 - Forum Rules

Author Topic: [PC/PS1] Need help translating Looney Tunes - Sheep Raider / Sheep, Dog 'n' Wolf  (Read 5157 times)

The_Reaper_CooL

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Hey there boys and girls, dude and dudettes!

I want to translate a game called Looney Tunes - Sheep Raider, or Sheep, Dog 'n' Wolf, as some of you know it. It's an older game where you control Ralph, a coyote, and you have to steal lots of sheep while avoiding Sam, the shephard dog.

Now the text can be found in the MLT files in their respective folder. My problem is that when I modify even one bit of the file, then it wouldn't load, so no text will be displayed in the game. It doesn't matter if the file is exactly the same in size as before.

Does anyone know a solution for this? Note that I'm trying to translate the PC version, but I thought I'd translate the PS1 version too, but that's for another story :)

Also if it's okay, here are the level 00's files from the PC version -> https://drive.google.com/file/d/0B2kV4DFRb2cIQmtIVU01bDhmTTA/view

I've come to the conclusion that the game might use checksum checks on these files, and that's why I can't edit the files.

By this I mean if I change the ingame text like this: Apple -> apple (so into a smaller "a"), then the game won't load the text files for that level.

So I might need a program or method for this, then I'll translate the game on PC, and maybe on PS1 as well.

Any ideas? :D

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7436
  • *sigh* A changed avatar. Big deal.
    • View Profile
Are you sure the files you are trying to edit are actually ONLY text files?

Have you used a hex editor to compare the files before and after the change to make sure that one byte is the only difference?
(or better a file comparison tool, such as the DOS program (fc /b oldfile newfile, then the output should ideally display only one result for the one byte you changed in that example)

I still wouldn't use any text editor to directly edit any game files. Using a hex editor is better to ensure data isn't changed unexpectedly.
"My watch says 30 chickens" Google, 2018

The_Reaper_CooL

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Okay, this might be a bit long, but I'll write down what I'm doing.

So I know that the very first level's text is in the Lvl-00.MLT file, no other file contains strings that match.

I opened it up with Hex Workshop, and searched for the very first hint's text, which begins with the word "Attention".

I changed this into "Attentoon", and saved the file (I made a backup of it into a separate folder, of course).

I started up the game, and everything was working fine until I got into the level, because then ALL strings disappeared (even the sign one).

Comparing both files shows that their length is the same, the size is the same, but there's a very interesting thing: Although I've changed the string there, it says that both files match, EVEN if I can see clearly they don't.

The_Reaper_CooL

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Any thoughts or ideas on this? I'm thinking of editing the game's memory, but that would take a LOT of time :D

Jorpho

  • Hero Member
  • *****
  • Posts: 5261
  • The cat screams with the voice of a man.
    • View Profile
Well, do all the MLT files start with the same four characters, i.e. before the "v1.2" ?  That would be an obvious place to store a checksum.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

The_Reaper_CooL

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Nope, they are all different (always 4 characters, but different ones).

I don't know about checksum storage, any idea where I could get help/read a tutorial on them?

Jorpho

  • Hero Member
  • *****
  • Posts: 5261
  • The cat screams with the voice of a man.
    • View Profile
So the "v1.2" is always the same, right?  Sounds like a good bet.

A standard CRC32 is four characters.  Here's what I tried just now:
-Open the file in a hex editor.
-Delete the first four characters.
-Save the file.
-Compress the file with a standard .zip archiver (I use IZArc).
-Open the .zip file and check the CRC32 of the file.  (Most archivers have an option to let you see this one way or another.)
-If the CRC32 is 5EE7D422, then that's how the checksum is calculated.
-If not, try deleting the next character at the start of the file (i.e., the "v" for starters) and repeat the process.

Unfortunately, repeating this for several iterations has not yielded any success so far, and I don't feel like knocking together a program to automate the process, especially since there's no way of knowing if it is in fact CRC32.  It could very well be an entirely custom algorithm, but that seems unlikely.  (I remember reading about how Final Fantasy V uses a custom algorithm for its checksum.)

Perhaps there are some generic DLLs included with the program?  If it uses some standard library (especially if it has a version number of "1.2"), perhaps that will be a good indicator of where to look.

The alternative to mucking around in the dark would be to somehow debug the program (OllyDbg, maybe?) and see if you can isolate whatever checksum function it tries to run when loading the file.  It might even be possible to just disable that function entirely, so the program will load files even with bad checksums.

Or maybe someone helpful will just step in here and tell me I'm completely wrong and solve everything.  :crazy:

ETA: Wikipedia links to this program which is advertised as supporting a bunch of different CRC checks, except it requires MSVCR110D.DLL to run which is apparently a debug version of the standard redistributable library and I don't think I want to follow this rabbit hole any further.

ETA2: Hex Workshop can probably calculate CRCs on its own; check the menus.  Whoopsies.

Perhaps you should upload another MLT for comparison?
« Last Edit: November 10, 2015, 09:12:43 pm by Jorpho »
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

The_Reaper_CooL

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Here are the first 5 levels in different folders (folder structure intact), and with all included files (not just MLT ones) -> https://drive.google.com/file/d/0B2kV4DFRb2cISG5sV2ZnS3NBa00/view?usp=sharing

Tried fiddling around with OllyDbg, but don't know where to start (not an assembly expert, either :D)

When I translated MediEvil 2 for PS1 it also had a Checksum, and a random guy helped me out on a different forum, but he wouldn't answer me, sadly :\

If needed I could also upload the exe file

EDIT:
Just tried out something: If I replace MLT files with each other, the game still runs and loads up the strings, although different ones (because for example I'm using level 01's MLT file in level 00). This means that the protection really can be (or really is) in the MLT files themselves.
« Last Edit: November 11, 2015, 04:37:52 pm by The_Reaper_CooL »

Jorpho

  • Hero Member
  • *****
  • Posts: 5261
  • The cat screams with the voice of a man.
    • View Profile
I was really just hoping there might be some bytes at the end of the file common to each .mlt, because it would make sense if those also had to be removed before calculating the checksum.  No such luck.

I've never used OllyDbg either, but I'm sure there are tutorials online.

No particular DLLs in the game folder, then?
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

The_Reaper_CooL

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Well there's only an exe file and two dll's, but those are for the setup file I guess. You can take a look at them here -> https://drive.google.com/file/d/0B2kV4DFRb2cIWTlWWm5aeW5Qb0U/view?usp=sharing

I still think that somewhere in the mlt files there's the CRC check (or maybe it's stored in the exe?)

Jorpho

  • Hero Member
  • *****
  • Posts: 5261
  • The cat screams with the voice of a man.
    • View Profile
Perhaps I was unclear: the first four characters (or rather, the first four bytes) in each .mlt file is almost certainly a checksum.  But knowing this is not helpful unless one can ascertain how the checksum is calculated.
« Last Edit: November 12, 2015, 08:41:45 am by Jorpho »
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Rancher

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
I found the Russian version of the game. I compared it to the English version and I noticed that .dav files are modified as well as .mlt files. DAV files contain graphics of the game (including the font), judging by this link: http://warsztat.gd/projects/sth_w_sdnw/info. All the files in the Russian version are of the same size as in the original. Also, the Russian translation inside .mlt files isn't in Cyrillic. It uses the combination of Latin characters and numbers, but it is rendered perfectly fine in game. I would recommend you to somehow get in touch with the Polish guy from the link above since he is working on dissembling the game. I already left him a comment hoping he would see it.

Jorpho

  • Hero Member
  • *****
  • Posts: 5261
  • The cat screams with the voice of a man.
    • View Profile
I was reading this article just now, which points out that there is now a utility called delsum for the specific purpose of reverse-engineering checksums. So I thought of this seven year old thread and thought I should add a modicum of closure.

https://github.com/8051Enthusiast/delsum
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!