entropia / tip-toi-reveng

Trying to understand the file format of Tip Toi
http://tttool.entropia.de/
MIT License
644 stars 121 forks source link

Support both `.yml` and `.yaml` file extension #262

Closed cstuder closed 2 years ago

cstuder commented 2 years ago

Assembling a .yml file seems to work, but trying to play a .yml file fails with the error message

tttool: Trying to read from offset 0x646F7270, mentioned at 0x00000000, which is after the end of the file!
 when reading segment Header

The official YAML FAQ asks to use .yaml, but the reality is that .yml seems to be more popular.

I propose that tttool should be able to handle both file extension version.

nomeata commented 2 years ago

Reasonable. Care to submit a patch? Only this line needs to be changed: https://github.com/entropia/tip-toi-reveng/blob/master/src/Commands.hs#L142

cstuder commented 2 years ago

I don't speak Haskell, but I can have a look. (As soon as I manage to reliably print my OID codes....)

maehw commented 2 years ago

I can't get the build toolchain run on my current machine (running Mac OS).

Just a guess (no Haskell programmer, too) which I cannot test:

Replace

        if ".yaml" `isSuffixOf` file

by

        if (".yaml" `isSuffixOf` file) || (".yml" `isSuffixOf` file)

?

I could submit a pull request for that if that helps reducing the effort for you.

nomeata commented 2 years ago

Actually

        if ".yaml" `isSuffixOf` file || ".yml" `isSuffixOf` file

should work.

I’ll just do it, simpler that way.