#[NDS] Kageyama Math Training

143 messages · Page 1 of 1 (latest)

graceful mantle
muted acorn
#

These games are so painful to rip i swear. Let me take a real quick look at the files.

graceful mantle
#

Ikr, each time is a different format

#

Only think I can really see is the header

muted acorn
#

Ah,seems .mza file is bunch of NUE files without compression applied.

graceful mantle
#

ah not NUE?

muted acorn
#

I've corrected it,thanks for correction.

graceful mantle
#

oh, interesting...

#

the mzc is like a sort of list/map

muted acorn
#

Try cutting file from the big archive and open it in Tinke. If table is correct,it's all Nitro based with custom headers.

#

Now either that or it has custom compression built by some depressed random.

graceful mantle
#

ok I think I have extracted a raw file

#

the length matches the one in the list

#

since it's 921 bytes long as per tinke says

#

but it's compressed

#

will dsdecmp do the work? 🤔

muted acorn
#

I guess finding out isn't painful.

graceful mantle
#

nope, it's compressed

muted acorn
#

Try QuickBMS compression scanner.

graceful mantle
#

it has outputted a lot of different files in dmp format

muted acorn
#

Open them all in Tinke and start viewing one by one until you (hopefully) get the image.

graceful mantle
#

none of them worked

#

i will try again because it froze at some point

#

ok it terminated successfully this time

#

the only interactable dmp-s are these

#

Bizzarre_Skip

#

Slz_03

#

fact5lz

#

hypatia_mariel

#

and nothing else

#

I will try again with a generic dat extension I guess

#

nope

#

nothing changed

muted acorn
#

I'd guess it's either custom engine or some very random LZ compression.

graceful mantle
#

maybe they are not graphics

#

because here is what the file title is in the map

#

FN_A_01_01_LEFT_NSCR_NUE

#

nscr is a typical format for tilemaps, not assets

#

.....

#

I am stupid

#

there is this additional file I am sending rn

#

aaand I think I figured it out

#

the file order is weird as hell

#

We have tilemap-graphic-palette

#

all compressed

#

and tiled up

#

please ping me if a decompression method is found

graceful mantle
#

I have discovered something else

#

The mzc and mzh files contain readable code. mzc is localized and directly connected to the mza's offsets (c file), the mzh is shared for all versions (h file)

graceful mantle
#

@smoky narwhal Any ideas? Sorry for the ping, but I am out of options.
No rush tho.

smoky narwhal
#

hmmmm

#

yea mzc is plaintext
mza looks compressed

graceful mantle
#

it is
a giant blob of compressed nue files

#

I have tried dsdecmp, quickbms compression scanner... nothing

smoky narwhal
#

i see

#

yeah i see
the mzc explicitly tells the addresses and sizes of the data inside the mza

#

there's some small files and big files inside

#

doesn't look too complex though

graceful mantle
#

Yes, the files are simple stacked on top of each other, and with the mzc I can rip each one out with ease

#

The problem is they are all compressed in this nue format

smoky narwhal
#

yeah
differential analysis should be enough

#

i'm at work so i can't look at this in-depth, but the first thing i'd do is get some uncompressed data and compare it with the compressed data

#

see how they line up and work my way up from there

graceful mantle
#

You mean, an uncompressed nclr?

#

Even from another game?

smoky narwhal
#

No

#

Play the game in an emulator and make a save state

#

Inside the save state, the game state is stored in its uncompressed form. RAM as it is, VRAM as it appears, etc.

graceful mantle
#

Ok, do I send one here?

smoky narwhal
#

There is some uncompressed data in there at all times, by definition
Problem is finding the match. thankfully filenames are preserved, so things like FN_STAFFROLL2_BG_NAME_01_LEFT_NSCR_NUE are very likely tilemaps you'd find from the game ending, i.e. the Staff Roll

#

so a save state from the staff roll section is likely to contain an uncompressed representation of that particular file (or one of the others named like it)

graceful mantle
smoky narwhal
#

comparing these is the key. At least that's the one-size-fits-all/platform agnostic solution i've always used,

smoky narwhal
#

in an ironic twist, i think Desmume save states are zlib compressed, so I need to decompress that too first

graceful mantle
#

I can use melon if it helps

smoky narwhal
#

i'm not too caught up on DS emulation but I'm sure there are emulators that do raw save states too

#

but i don't know which ones. no$gba probably, at least no$psx has an option in the settings to choose save state format

#

but idk, like i said i'm at work so i can't focus on this 100%.
I'll get back to this

graceful mantle
smoky narwhal
#

that one's better

#

From which scene is that from?

graceful mantle
#

main menu after selecting save file

smoky narwhal
#

hmmm

graceful mantle
#

I took it here

#

I could do a nogba one if it helps, but I can't change the language

#

and the graphics are language localized

muted acorn
#

I wish MelonDS had debug options,only thing it needs at the moment.

graceful mantle
#

Ok I think I did it

#

Are the savestates in nogba known as snapshots, with SNA format?

smoky narwhal
#

Yes

#

But there should be a setting in there somewhere that determines compression level

graceful mantle
#

which one

smoky narwhal
#

Unbelievable
It seems its not a setting after all, but a line you must add to the INI file.

graceful mantle
smoky narwhal
#

Compressed to raw
I guess <:D

#

What does your current ini say

graceful mantle
#

SNA compressed

#

Gonna convert

smoky narwhal
#

I never went home yesterday sorry

#

Still haven't had a chance to look at it in detail

graceful mantle
#

its k, I just want to get to the bottom of this no matter the time

graceful mantle
#

I wonder if there is an option that doesn't involve reverse-engineering the entire rom
Because I don't have rn the time and effort required to put into that kind of project

smoky narwhal
#

We don't need to reverse engineer the entire ROM, no

#

Just differential analysis

#

Have you seen my video about the subject?
https://youtu.be/LASE8IiGB9Q

This time we're taking a deep dive back into 2018 and the methods we used to reverse engineer the GAM file format Whoopee Camp used to compress Tomba 1 data. We had no debugger but as it turns out, sometimes just eyeballing the compressed data and the decompressed data is enough to draw enough insight to figure out what the scheme is all about.
...

▶ Play video
#

I do my best to explain the LZ compression differential analysis visually

#

The method works on many cases, LZ is just the most common one

graceful mantle
#

Will look at the video this evening

graceful mantle
#

Ok, that's actually insane

#

So practically, the savestate is supposed to contain the vram, which has the decompressed file

#

And from there, you figure out an algorithm, write it in python, and screw the compressed nue

#

I guess I will start comparing snapshot and mza

smoky narwhal
#

Yeah that's the gist of it
The problem here though is that we don't know what the uncompressed data is
We've got a bunch of files but what's what is the problem. The filenames give some hints sure but idk

#

Filenames like "nönnönnöö_ending" are extremely likely to be related to the ending.
Or stuff like "whatever_mainmenu" is likely to be stuff from the main menu, you know

#

The key is finding the compressed&raw "pairs"

#

I still haven't visited home

#

I wish I could just get back and have a good session with this at my computer but alas I'm stuck here, far from home, on my phone

graceful mantle
#

Ok, I may not be able to look further and compare the data as of now, but in a few weeks I should have a little more free time and get on this properly. In any case, please send a ping if you discover something interesting.

graceful mantle
#

I discovered a tool called GLintercept

#

Currently it doesn't work for my version of Desmume, but can it work?

#

I mean, even if the tiles are compressed like that

#

Oh well would you look at that, I tried another game and it worked!

#

It's like Dolphin Texture Dumper ahah

#

Holy smokes this tool is insane

#

I will test it with Math Training now

#

WAIT A

#

interesting

#

I can't rip everything with the layer method, but it surely does help to get backgrounds and buttons 🎉

#

Why didn't I think of this sooner

smoky narwhal
#

I can't find any samples, god damn

graceful mantle
#

I don't know if I should close this or not.
at the end of the day, Desmume did the trick but it's pretty limited.

#

I will leave it here anyways tbh

graceful mantle
#

Came back into this
Been a loong while but now I have better instruments