[3DS] DGS2 .gmd formats [Dai Gyakuten Saiban 2]

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

[3DS] DGS2 .gmd formats [Dai Gyakuten Saiban 2]

Post by smiler »

Hello, I need help with a few file formats. From the game Dai Gyakuten Saiban 2: Naruhodou Ryuunosuke no Kakugo.
They're an encrypted form of .gmd file used for MT Frameworks. I need a way to decrypt them, and re-encrypt them back.
Help would be much appreciated.

Link to the sample file:
https://drive.google.com/file/d/0B_S0wg ... sp=sharing
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

Re: [3DS] DGS2 .gmd formats

Post by smiler »

Anyone? It seems like some sort of XOR but I'm uneducated on the subject of decryption.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [3DS] DGS2 .gmd formats

Post by aluigi »

Upload more gmd files.
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

Re: [3DS] DGS2 .gmd formats

Post by smiler »

aluigi wrote:Upload more gmd files.

Here you go. Should be almost all of them.
https://my.mixtape.moe/lzzxie.7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [3DS] DGS2 .gmd formats

Post by aluigi »

Do you have also the executable of the game?
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

Re: [3DS] DGS2 .gmd formats

Post by smiler »

aluigi wrote:Do you have also the executable of the game?


I'll give you the .cia of the game.
https://drive.google.com/file/d/0B_S0wg ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [3DS] DGS2 .gmd formats

Post by aluigi »

ctrtool doesn't extract it
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

Re: [3DS] DGS2 .gmd formats

Post by smiler »

aluigi wrote:ctrtool doesn't extract it

Packhack worked for it, so I'll just give you the extracted form.
https://drive.google.com/file/d/0B_S0wg ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [3DS] DGS2 .gmd formats

Post by aluigi »

I have found the key:
http://aluigi.org/bms/3ds_gmd_mt.bms

Long story short: the script simply dumps the decrypted data without handling the GMD format (because they are text strings, not files). You can use the reimport mode to put the edited data back but pay attention to not change the length of the strings (use spaces if yours are shorter)
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

Re: [3DS] DGS2 .gmd formats

Post by smiler »

aluigi wrote:I have found the key:
http://aluigi.org/bms/3ds_gmd_mt.bms

Long story short: the script simply dumps the decrypted data without handling the GMD format (because they are text strings, not files). You can use the reimport mode to put the edited data back but pay attention to not change the length of the strings (use spaces if yours are shorter)

Thanks a lot!
smiler
Posts: 15
Joined: Sat Aug 05, 2017 6:01 am

Re: [3DS] DGS2 .gmd formats [Dai Gyakuten Saiban 2]

Post by smiler »

Sorry for the bump, but how do you reimport it back with the two XOR strings using the same script? Reimporting using the same script doesn't work. It gets stuck on the first line of idstring "GMD/0" because the decrypted scripts no longer actually have the GMD magic number.