massin's "Game Header"

Talk about everything else that isn't related to No-Intro or emulation here.
Post Reply
root
Site Admin
Posts: 738
Joined: 19 May 2008 09:26

massin's "Game Header"

Post by root »

Rif: 1111-1 massin's "Game Header" \ massin on 17th January 2007, 06:36 wrote:

Here's my entry to the contest :P Please be gentle. This is only a preview version.

I had some long description but then closed my browser by accident and now its gone :cry: Coded in C# from scratch with borrowed code for Crc calculations and Zip operations.

Basically here's the rundown:

- Reads NDS and GB/C headers.
- Can read from zips.
- Calculates CRCs against the internal CRCs.
- Lists other information

Missing:

- Unable to parse the last part of the NDS serial, i.e NTR-XXXX-??? where ??? is the unknown part. Would like to know how this info can be extracted.
- List of manufacturers/licensees for both systems.
- Cannot detect if an NDS game has been decrypted (like NDSTS can) although if someone knows how I'd be interested in knowing.
- No NDS icon.
- Probably some other things I can't think of right now.
- MD5/SHA1 (but that's fairly easy to add since its built into .NET)

Motivation behind this program was that I don't like using ucon64 for all this wiki work ;)

---

New in version 0.2:

- Some N64 and NES support
- N64 Support has all the important information is there but can't calculate the CRC1 and CRC2 because each boot code provides a different method and I don't know those methods.
- NES support is mainly based off reading the iNES header which is know is not really internal rom information. As a little note, the iNES headers included in the no-intro versions do not make use of the PAL/NTSC bit or the RAM byte.
- There is an internal header for NES game however only 25-50% of the games actually have it and the data is a little "iffy". Its basically a 32byte header at the end of the PRG ROM.
-- I have identified the title string to be 16Bytes in ASCII and from the Maker Codes provided by Flubba on his site, there is a maker code.
-- Only issue is that this header was taken very liberally since I'm assuming it was not a format requirement.
-- Some internal names have no ascii padding or garbage characters and sometimes the maker code appears to be wrong. I say appears because the NES maker codes may be completely different from the current ones and/or companies had different names.
-- If you view view a NES game you will see the HEX output from the region where the header would be even if it doesn't exist. At this time I don't know how to differentiate so I left it in there to be seen. If anyone has more information on this header that would be useful.
- Directory support! You can now parse a whole directory at a time. All supported formats will be used. Btw, if you don't wanna wait for it to finish you can press the "X" to stop it in progress.
- Some info provided by 3210123 has also been included.
- MD5/SHA1 added
- Fixed (hopefully) a reading logic error.

---

New in version 0.3:

- Added support for GBA games and some support for SNES games
- SNES support "works" however the auto-detecting Lo/Hi/BS roms is broken at this moment so most roms will not be read properly unless forced.
- MD5/SHA1 calculations are broken into 4 byte chunks.
- N64 support improved. Can now correctly identify the boot chip and calculate the correct CRC1 and 2 for all games (including Lylat Wars).
- NES information now displays a CRC32 for the file and a CRC32/MD5/SHA1 for the Rom without the header. This may be useful for BigFred.
- Some imformation is now standardized:
--- All "original" values are displayed first and interpreted values are displayed in brackets. Ex. Version: 0x00 (v1.0).
--- All Rom and Ram sizes are displayed primarily in Bit sizes and sometimes a secondary size in bytes.
--- All Hex values are preceded by a 0x with the exception of CRC16/32/MD5/SHA1 values.
--- "Important" rom information like Internal Title and Serials are toward the top of the list. "Other Info" is in the middle. Checksums/Hash Checks are at the bottom.
- GB/C information should be "complete".
- Some information is now stored in an INI. Including, maker codes, Serial Regions, etc.
- Game serials will not be interpreted past what is found in the rom. For example, NDS roms will not have NTR- and -YYY interpretations added on to the internal serial.
- Tweaks here and there.
- Thanks to Carmina for the tip on using Shift-JIS decoding on SNES/N64 titles.
- Thanks to Y~K for providing me with the information I needed to calculate N64 CRC1 and 2.

---

Keep reading below for more release notes.

---

Please try it out and post your comments/suggestions.

Enjoy.

===============================================

Re: massin's "Game Header" program \ Yakushi~Kabuto on 17th January 2007, 06:41 wrote:

looks very promising
It's not too late to use your tool for the wiki, with you permission :)

===============================================

Re: massin's "Game Header" program \ 3210123 on 19th January 2007, 15:05 wrote:
- Unable to parse the last part of the NDS serial, i.e NTR-XXXX-??? where ??? is the unknown part. Would like to know how this info can be extracted.
This has probably been commented on several times...

In GBA and NDS, the true serial is only 4 characters long, not the 10 characters (12 including hyphens) that most clients report. [As a consequence, I laugh every time a debate over P-EUR vs P-UKV comes up, as neither are truly part of the serial, GBA and NDS-wise]

The first character of the 4 tells what kind of cartridge/game it is.

Code: Select all

A = Normal Game ROM (Early in life)
B = Normal Game ROM (Later in life)
F = Famicom Mini/Classic NES ROM
K = Tilt Sensor Cartridge
M = Movie/Video ROM
P = Program ROM (Not a game, but an application of some sort)
R = Motion Sensor Cartridge
T = TV Tuner
U = Light Sensor Cartridge
V = Rumble Cartridge
Z = SD-card accepting (Play-Yan/MP3 Player)
The first 3 characters (cart type + 2 characters that each game is assigned) are the actual game ID, to which each game's ID is unique from any other, and the same game of different versions or regions are *generally* the same (a notable exception is Super Mario Advance 1, which I believe was AMAJ and AMZE for Japan and America, respectfully)

The last character is the region, which determines the 3 letter suffix

Code: Select all

C = CHN (China), though there are exceptions (Ham-Ham Games, I believe, is one)
D = NOE (Germany [Nintendo Of Europe])
E = USA (America)
F = NOE (France [Nintendo Of Europe])
H = DUT (Netherlands [Dutch])
I = ITA (Italy)
J = JPN (Japan)
K = KOR (Korea)
P = EUR [UKV is an acceptable, though seldom-used, alternative] (Europe; generally England)
S = SPA (Spain)
U = AUS (Australia)
X = EUU (European Union)
Y = EUU (European Union)
Z = EUU (European Union)

There are a few others, but they're most likely unofficial and could be safely ignored.
All GBA games have the prefix 'AGB-'. All NDS games have the prefix 'NTR-'.

Of course, unofficial carts generally don't have serials, which is why they often come up as "xxx--" - there's no serial to display or generate a suffix off of.

Hope this helps...perhaps you can add a 'type of ROM' field in there as well, working off of the first letter.

PS: This is all original research :P - Just ask Sir VG, I bored the hell out of him explaining it all when I finished figuring it out a month or two ago.

===============================================

Re: massin's "Game Header" program \ massin on 19th January 2007, 15:22 wrote:

Thank You. Btw, I did know the true serial is just the four letters. I was just wondering how other header viewers can report those last 3 when its technically "packaging" information and not part of the rom. It seems like its just a guess :P

===============================================

Re: massin's "Game Header" program \ Devis0r on 20th January 2007, 03:49 wrote:

It's not guessing, it's just using a generic set, it was programed to read the serial and add those last three laters.

So when you open an ***P rom, it'll always say EUR.

I agree with 3210123, whenever these stupid little arguments about the last three values, it's hard not to laugh (and cry because you didn't learn anything) :P

===============================================

Re: massin's "Game Header" program \ massin on 20th January 2007, 04:26 wrote:

Haha, when was the last time i had an argument about those three letters? :P

Anyway I'll just blindly add them in ;)

Anyone have any infor on the rest of the stuff I'm missing. Not so much about the icon thing. That's just for me to learn how to program that in. More about detecting decrypted roms and such.
- What actually encryption algorithm is used on NDS roms?
- I've seen lists for nintendo licensees. Are these the same across all nintendo consoles?

===============================================

Re: massin's "Game Header" program \ 3210123 on 20th January 2007, 09:19 wrote:
- I've seen lists for nintendo licensees. Are these the same across all nintendo consoles?
If you're talking about the list of manufacturer codes used in the ROM headers, yes, the same list is used for all the handhelds (GB, GBC, GBA, and NDS). Not too sure about Nintendo's consoles, though, or at least the ones with ROMs that store a manufacturer code in the ROM.

BTW, as addition to my above post dissecting the serial, it should be noted that "officially" early titles may be 3 letters long...this is due to omitting the cart type, which is generally 'A' (normal game ROM). It's fairly easy to see why some games from 2001 omit it - there was no 'B' yet, or any other cart type letter...though looking at a lot of GB/GBC reports here, they did have 4-letter serials too, which seem to work the same way as GBA/NDS serials above (I suppose game companies can act like n00bs too).

===============================================

Re: massin's "Game Header" program \ massin on 22nd January 2007, 05:20 wrote:

Cool. Sounds good. Btw, I'm working on adding your info into the program.

Some new developments:

- Can parse whole directories! Although this may not sound like a huge feat, it was for me since I'm still new to C# programming and it was a bitch to get the program to do the parsing without making it (and the OS) unresponsive.
- Looking into N64, NES, SNES headers. Mainly N64 and NES though. If anyone has links to comprehensive resources on the internal headers for these roms, that would be greatly appreciated

-------

New version is available :)

===============================================

Re: massin's "Game Header" program \ michal99 on 22nd January 2007, 17:50 wrote:
New version is available.
I found an error in the new version. When a rom does not have the right extension the program is not able to display the informations and I got only this:

*******************************************
Header data from PokemonMonsterTrading.cgb
*******************************************
*******************************************

When I rename it to *.gbc I got the right header.

===============================================

Re: massin's "Game Header" program \ massin on 20th February 2007, 08:31 wrote:

It is meant to be used with the extensions used by the no-intro dats. If there is a cgb in the dat then i'll have to include the extension. At this moment it does not autodetect the file. It works off extensions.

-------------

New version 0.3. Try it out ;)

===============================================

Re: massin's "Game Header" program \ Yakushi~Kabuto on 20th February 2007, 10:45 wrote:

tested...

help > about doesn't work
tools > view nds icon doesn't seem to work
supported roms misses sfc, gba, nes & n64 ;)

otherwise great improvements!!
this is the best rom header tool ever!!

dude you must fix the about box and add a readme quickly or some bastards will steal the credits from you!!

===============================================

Re: massin's "Game Header" program \ massin on 20th February 2007, 17:07 wrote:

To load games that are "not" supported just use the "All Files" choice. The NDS Icon thing doesn't work because I don't know how to do that yet ;) and the About is not that cause I'm really lazy to put it in, but I guess I should next time.

===============================================

Re: massin's "Game Header" program \ massin on 25th February 2007, 00:28 wrote:

Notes for 0.3.5:

Fixed:
- Version for GBx games is not what it should have been (v1.x).
- SNES detection significantly improved. Only issues exists with a handful of roms.
- fixed the case issue where it would display "Bit" instead of "bit"

Changed:
- GBx games now only show one Licensee code at a time. If there is a 0x in front, its the old 1 Byte code, otherwise it's the new 2 Byte ASCII code.

New:
- Ability to Pause/Resume. If you pause, it will complete the current file and then wait.
- New icon, for now.

GBx and GBA processors are considered stable and "Final" in terms of use for the wiki. There are size checks for these processors to make sure the game is at least large enough to contain a header so that the program does not crash.

So now the question for everyone is this, what should I call this program? Game Header is obviously lame ;) Any suggestions?

===============================================

Re: massin's "Game Header" program \ Yakushi~Kabuto on 25th February 2007, 00:55 wrote:

suggested names:

World Domination Header General WDHG
Mutliple System Header Viewer / MSHV
Mutliple System Header Analyzer / MSHA
Mutliple System Header Doctor / MSHD
Mutliple System Header Expert / MSHE

Anyway, greatest header tool ever ;) Add a readme file with package!
The wiki templates will be modified to be compatible with that tool ;)

===============================================

Re: massin's "Game Header" program \ kazumi213 on 25th February 2007, 13:04 wrote:

How about Header Reader EX (HEREX)? lol
root
Site Admin
Posts: 738
Joined: 19 May 2008 09:26

Re: massin's "Game Header"

Post by root »

Rif: 1111-2 Re: massin's "Game Header" program \ RENI on 25th February 2007, 14:42 wrote:

Mutliple System Header Analyzer / MSHA looks nice. :D

===============================================

Re: massin's "Game Header" program \ massin on 2nd March 2007, 07:21 wrote:

I was working on FDS support and I've found out that its a really big shame that the FDS format used by the dat does not include the start and stop bytes for each block :cry: That means all the internal CRCs are not included in the dump and there is nothing to verify the image with :cry: The best I can do is just make sure the number of files and size of files match.

===============================================

Re: massin's "Game Header" program \ Yakushi~Kabuto on 2nd March 2007, 08:05 wrote:
I was working on FDS support and I've found out that its a really big shame that the FDS format used by the dat does not include the start and stop bytes for each block :cry: That means all the internal CRCs are not included in the dump and there is nothing to verify the image with :cry: The best I can do is just make sure the number of files and size of files match.
We do know about that problem. Your post sounded harsh to me. You seem to imply that I choosed the wrong format. :lol:

There is, to my knowledge, no way to dump those crc and GAP data bytes... if you can build a new copier hardware + software that can dump these bytes I will gladly use that new format...

===============================================

Re: massin's "Game Header" program \ Connie on 2nd March 2007, 09:28 wrote:

I've recently used UCON64 to get info to create my GBAfront database. Isn't the following what you are aiming to achieve:

x:\xxxx\Druid - Kyoufu no Tobira (J).zip
(Druid - Kyoufu no Tobira (J).fds)

Famicom Disk System file (diskimage)

Code: Select all

  
 Nintendo Entertainment System/NES/Famicom/Game Axe (Redant)
 DRD 
  
 Japan
 131000 Bytes (0.9995 Mb)
  
 Padded: Maybe, 12704 Bytes (0.0969 Mb)
 Interleaved/Swapped: No
 Backup unit/emulator header: No
  
 Disk: 'DRD '  Side: A  Files: 11  Maker: 0x0a  Version: 0x00
 000 $00 'KYODAKU-' $2800-$28df [Picture]
 001 $00 'JALECO  ' $7500-$893e [code
 002 $1c 'OPEN    ' $8000-$a0c6 [code
 003 $1c 'DRV     ' $6af8-$7526 [code
 004 $11 'WORK    ' $0400-$057f [code
 005 $19 'ENDING  ' $a000-$c99e [code
 006 $18 'SKULL2  ' $a455-$c5b3 [code
 007 $1e 'RAT4    ' $9f78-$bc16 [code
 008 $11 'GAMEA   ' $ce24-$dbe3 [code
 009 $00 'QDOS    ' $dd50-$dfff [code
 010 $1d 'NAME    ' $6000-$604f [code
  
 Disk: 'DRD '  Side: B  Files: 14  Maker: 0x0a  Version: 0x00
 000 $13 'BG1     ' $1240-$1fff [Tiles]
 001 $14 'BG2     ' $1900-$1fff [Tiles]
 002 $15 'BG3     ' $1900-$1fff [Tiles]
 003 $16 'BG4     ' $1900-$1fff [Tiles]
 004 $13 'OBJ1    ' $0000-$0fff [Tiles]
 005 $14 'OBJ2    ' $0940-$0fff [Tiles]
 006 $15 'OBJ3    ' $0940-$0fff [Tiles]
 007 $16 'OBJ4    ' $0940-$0fff [Tiles]
 008 $12 'MENU    ' $2a80-$2bff [Picture]
 009 $13 'MAP1    ' $6000-$6aeb [code
 010 $14 'MAP2    ' $6000-$6ac2 [code
 011 $15 'MAP3    ' $6000-$6ada [code
 012 $16 'MAP4    ' $6000-$6aea [code
 013 $12 'GAMEB   ' $7500-$ce1f [code


Checksum (CRC32): 0x59e777dc

I did bring up the issue of having Disk 1/2, Side A/B images separate for the purpose of datting in another thread and suggested that we have a simple binary 'adding' tool that could add the separate images together for the purpose of emulation.

===============================================

Re: massin's "Game Header" program \ massin on 2nd March 2007, 15:05 wrote:

That part is already done... well almost. But on the actual disks, there is more information that is stored than in the dumps :cry: . Each block has a start byte and a 2 byte crc at the end. Those would allow us to give a more accurate evaluation of the dump. Anyway I apologize if I sounded harsh. I must have misunderstood the material I was reading as it seemed to imply there was a single side format that include this extra information will the double side format does not. Maybe neither of them include it.

===============================================

Re: massin's "Game Header" program \ Connie on 2nd March 2007, 23:52 wrote:

The only 'thing' that confuses me is why we can't have a full 64 KB per side, i.e. pad out each 'side' with the remaining space '0x00'

===============================================

Re: massin's "Game Header" program \ xuom2 on 15th April 2007, 08:39 wrote:

please add support to .IDS ext.. :)

===============================================

Re: massin's "Game Header" program \ NGEfreak on 15th April 2007, 10:18 wrote:

I've found two bugs:

Code: Select all

----------------------------------------------------------------
Filename: Dragon Quest Monsters - Terry no Wonderland (J) (v2.0).gbc
System: Nintendo Game Boy Color
----------------------------------------------------------------
Internal Name:      DQ/MONSTERS
Serial Code:        N/A
Licensee:           B4 (Enix)
Region:             0x00 (Japan)
Version:            0x10 (v1.16)
SGB Support:        0x03 (Yes)
Compatibility:      0x80 (GBC & GB Compatible)
Cartridge Type:     0x03 (ROM + MBC1 + RAM + BATTERY)
ROM Size:           0x06 (16 Mbit; 2097152 Bytes; Ok)
Save RAM:           0x02 (64 Kbit)
Logo Code:          Ok
Header Checksum:    0x61 (Ok)
Global Checksum:    0xFAB4 (Ok)
CRC32:              D263D88D
MD5:                B28C999D 1B43E8E3 9998827F F39965CC
SHA1:               A32198D1 64574197 9E24956A FD6479B6 4C258647
----------------------------------------------------------------

Version is displayed wrong. The header entry is a bcd value.
Version: 0x10 (v1.16)
should be
Version: 0x10 (v2.0)

All Nintendo systems use this method (expect for NES).

--------------------------------------------

Code: Select all

----------------------------------------------------------------
Filename: Soreike! Anpanman - 5tsu no Tou no Ousama (J) [WITHHEADER].gbc
System: Nintendo Game Boy Color
----------------------------------------------------------------
Internal Name:      
Serial Code:        N/A
Licensee:           0x00 (Unknown)
Region:             0x00 (Japan)
Version:            0x00 (v1.0)
SGB Support:        0x00 (No)
Compatibility:      0x00 (Unknown)
Cartridge Type:     0x00 (ROM ONLY)
ROM Size:           0x00 (256 Kbit; 1049088 Bytes; Bad)
Save RAM:           0x00 (None)
Logo Code:          Bad
Header Checksum:    0x00 (Bad)
Global Checksum:    0x0000 (Bad)
CRC32:              7ECBCD39
MD5:                D7431C78 CAC43F4C AA67AF16 FD5FC320
SHA1:               A0B40138 06698256 87E5A748 738693C9 CE4C25DF
----------------------------------------------------------------

----------------------------------------------------------------
Filename: Soreike! Anpanman - 5tsu no Tou no Ousama (J).gbc
System: Nintendo Game Boy Color
----------------------------------------------------------------
Internal Name:      ANPANMAN2
Serial Code:        BS2J (Game Cart; Japan)
Licensee:           2L (Tam)
Region:             0x00 (Japan)
Version:            0x00 (v1.0)
SGB Support:        0x00 (No)
Compatibility:      0xC0 (GBC Only)
Cartridge Type:     0x1B (ROM + MBC5 + RAM + BATTERY)
ROM Size:           0x05 (8 Mbit; 1048576 Bytes; Ok)
Save RAM:           0x02 (64 Kbit)
Logo Code:          Ok
Header Checksum:    0xC7 (Ok)
Global Checksum:    0x7DB4 (Ok)
CRC32:              C9A25B0C
MD5:                F09214D1 7150911A F6AACBE5 D89BC00F
SHA1:               E3E4D1E2 D1FE6D06 83DB9D17 35608054 2E1A6905
----------------------------------------------------------------

GB/GBC roms with Super Smart Card copier header are not detected properly.

--------------------------------------------

I've also a feature request. Can you add drag & drop support?

===============================================

Re: massin's "Game Header" program \ massin on 23rd July 2007, 07:34 wrote:

Just for fun I'd like to let everyone know that a new version of the header program is in the works. At the moment it had a big overhaul of the underlying reader. Some of the new things are as follows:

- The reader now streams files by default.
- As a result of the above change, it can now read any type of file of any length and show hashes, etc, without crashing your computer
- Parts of game data are saved in memory (optionally) so that you could potentially do more work on them.
- GUI is somewhat changed. Progress bar is no longer a separate window. A classic "GUI" implementation (like GBATA) will probably be added eventually.
- Configurable ini for settings.

And last but not least I'm proud to announce that with the help of Lukeage and his keen eye as well as Darkfader's original C++ code, we will have the first and only header program that can calculate the encrypted CRC16 from a decrypted NDS game!

On the downside I have to redo all the rom parsers because of the new reader. But what I will do is release them one by one so that it won't be next year before the new version is released ;)

Oh and I'm going under the idea that might call it Massin's Rom Reader (MR2). Any other suggestions? I wasn't completely satisfied with the "Multi-System" names suggested before.

===============================================

Re: massin's "Game Header" program \ FitzRoy on 24th August 2007, 04:04 wrote:

Great to see this excellent program improving all the time.

===============================================

Re: massin's "Game Header" program \ xuom2 on 24th August 2007, 12:43 wrote:

even with the option "Parse Unknown Files" active, it is not able to scan the .NDS files packed in:

DS_Download_Station_Demos_Vol2_Uncompressed_USA_NDS-iND

===============================================

Re: massin's "Game Header" program \ massin on 24th August 2007, 14:47 wrote:

I think I already fixed that one but I don't know if I released that version yet.

Soon... soon...

===============================================

Re: massin's "Game Header" program \ Dege on 24th August 2007, 16:38 wrote:

thank you for this great program!!
i love the clean gui :)

===============================================

Re: massin's "Game Header" \ michal99 on 24th October 2007, 22:55 wrote:

Found a bug when try to verify Nintendo DS Browser.

Code: Select all

Internal Name:      DSBROWSER
Game Code:          UBRP (Light Sensor; Europe)
===============================================

Re: massin's "Game Header" \ JumpJump69 on 26th October 2007, 21:10 wrote:

Thanking you for the great program. ;)
Keep up the good work!!!! :lol:
J.J.
Last edited by root on 02 Oct 2008 21:54, edited 1 time in total.
User avatar
xuom2
High Council
Posts: 861
Joined: 22 May 2008 18:45

Re: massin's "Game Header"

Post by xuom2 »

added SHA256.

the software still crashes while trying to open big zipfiles, because they are loaded in RAM, and not extracted to disk.

(attachment reuploaded due to a tiny bug in hash size)
You do not have the required permissions to view the files attached to this post.
relax
High Council
Posts: 943
Joined: 27 May 2008 17:52

Re: massin's "Game Header"

Post by relax »

Thanks, that's cool. :D It would useful to have SHA256 for the headerless data of NES and FDS, since that's what we add to DoM. And if I may ask for another feature, headerless size, a feature that the original Game Header never had.
User avatar
xuom2
High Council
Posts: 861
Joined: 22 May 2008 18:45

Re: massin's "Game Header"

Post by xuom2 »

Trying, I'm not expert ^^
The attached version should do both (SHA256 should be ok, but Size is... dunno).
(need some files to test)
You do not have the required permissions to view the files attached to this post.
relax
High Council
Posts: 943
Joined: 27 May 2008 17:52

Re: massin's "Game Header"

Post by relax »

Both headerless SHA256 and size works great with NES and FDS. :D
Post Reply