Register - Login
Views: 99791590
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 04:37:30 AM
Jul - General Game/ROM Hacking - changing formats (age old question) .srl to .nds New poll - New thread - New reply
Pages: 1 2Next newer thread | Next older thread
davemon
Random nobody
Level: 8


Posts: 1/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 09-30-10 04:38:13 PM Link | Quote
Title says it all. Working on finding a way to run a "clean rom" .srl in an .nds compatible environment like the R4. They're nearly the same, except for the header. Doesn't matter to me if there's a way to make it run as an .srl or if the file is converted to .nds. The fantastic no$gba ds emulator runs .srl files extremely well, but the goal is to have the files run on a DS.
dirbaio
For future reference, "Responsible disclosure" isn't "acting like a douche about an exploit and demanding compensation".
Level: NaN


Posts: 882/-1288
EXP: NaN
For next: 0

Since: 07-28-09

From: Spain

Since last post: 10.8 years
Last activity: 9.9 years

Posted on 09-30-10 05:44:06 PM Link | Quote
As far as I know, they are both exactly the same format. The only difference is that .srl is used by Nintendo's devkit, and .nds is the standard used on all the rom sites and homebrew users.

Have you tried renaming it to .nds and copying it to the flashcart?

____________________
davemon
Random nobody
Level: 8


Posts: 2/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 09-30-10 06:49:24 PM Link | Quote
Hehe, I ALMOST mentioned this in the original post because it's the first thing everyone says. No, renaming doesn't work because of the difference in the header for .nds vs .srl, allowing the .nds to work on rom carts etc. And yes, that's exactly right about the devkit. Trouble is, we're a small company and our license only gives us 1 devkit, and many of us are in different states. I've gotten around it by using no$gba and running the .srl builds there as I update the levels. I'd really like to be able to test it out on my DS, though without having to travel a few hundred miles. =)
dirbaio
For future reference, "Responsible disclosure" isn't "acting like a douche about an exploit and demanding compensation".
Level: NaN


Posts: 884/-1288
EXP: NaN
For next: 0

Since: 07-28-09

From: Spain

Since last post: 10.8 years
Last activity: 9.9 years

Posted on 10-01-10 08:34:50 AM Link | Quote
Hm....
Are you compiling it for the debug version, or the release version?
There's a debug version of the DS that has some extra RAM. If you've compiled your rom for it, you cant run it on a "standard" ds. I think no$gba supports the debug version too...
Does it work in desmume?

____________________
krutomisi
2480
Level: 94


Posts: 950/2481
EXP: 8265382
For next: 91275

Since: 02-01-10


Since last post: 241 days
Last activity: 181 days

Posted on 10-01-10 12:24:01 PM Link | Quote


I hate to say it,
but it is possible you could take the header off of a NDS game and stick it onto the SRL file?


that miiiight work  

____________________

950 / 60 / 241
davemon
Random nobody
Level: 8


Posts: 3/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-01-10 03:30:52 PM Link | Quote
dirbaio: the version I'm compiling is the demo build for any standard DS. Normally, I'd pick up one of the writable ds cards with the demo loaded from our lead coder (who has the dev kit), and from there it could be played or transmitted to another DS via wireless like you would at any game store. I'm dropping new level .bins into the build from home, however, and it would be a lot easier to find a way to run it as an .nds than to go out of state to pick up the ds-playable version. I'm headed to NYCC next week to demo it, and I'll be picking up the DS card version on the way, but it adds a lot of hours to my trip.

krutomisi: I was thinking something along those lines, but I'm not sure which files I'd be looking for. There are very fiew files that are standard from game to game, most are named with extensions made up by the designers having to do with the game title. Our level files, for instance, are extended with the game's initials before they get exported to a .bin file, which is just a place for any kind of data.

I've seen a lot of people wondering how to do this for a while, but surprisingly, no one's really tackled it head on.
Ninji

Birdo
Why did my user title say I'm a toaster anyway
Level: 88


Posts: 1784/2014
EXP: 6638512
For next: 12152

Since: 07-26-07

Pronouns: he/him or they/them
From: Glasgow, Scotland

Since last post: 113 days
Last activity: 6 days

Posted on 10-01-10 04:06:20 PM Link | Quote
I don't know if it would work (I don't have any .srl files on hand) but you could try DarkFader's ndstool: http://darkfader.net/ds/files/ndstool.exe

It's a command-line tool that can unpack/repack DS ROMs -- I'm pretty sure it also extracts .srl files, since DF's other tools can work with them. Try unpacking your .srl file, replacing the files, then repacking it as a .nds.



However, note that if you're using FS_OpenFileFast and hardcoding file IDs (as some games do) it most likely won't work properly, since ndstool rebuilds the filesystem and doesn't sort files in the exact same way as Nintendo's NitroROM packer. (I had that issue when hacking New Super Mario Bros.)

If your code uses FS_OpenFile (or FS_ConvertPathToFileID) then you should be fine, since these functions read directly from the filesystem in the ROM.

____________________
Jul · The Left Mouse Button · RVLution.net
dirbaio
For future reference, "Responsible disclosure" isn't "acting like a douche about an exploit and demanding compensation".
Level: NaN


Posts: 885/-1288
EXP: NaN
For next: 0

Since: 07-28-09

From: Spain

Since last post: 10.8 years
Last activity: 9.9 years

Posted on 10-01-10 04:20:12 PM Link | Quote
Whoa... Sounds complicated.

If you want, post the header of the rom here (the first 0x170 bytes of the .srl file) and i'll try to see if there's something weird...

____________________
davemon
Random nobody
Level: 8


Posts: 4/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-01-10 06:53:47 PM Link | Quote
Treeki I tried that a while back without much luck. The unpacked size is over 1gb and repacking does not reduce the size again. Even so, the larger file acts just like the original .srl. What I didn't do was edit the header, I simply replaced it. I can't upload any part of the .srl without breaking the NDA I'm under, but I can show you some differences in the header I found. (This way, our dev tags stay offline).

Almost all the differences were in the .srl header, some extra data --completely opposite what I would have expected. (I assumed the .nds header would have the extra data that allows it to run from a flashcart.)

Here's the extra data in my file that's not found on the .nds header (I chose a small .nds file to speed things up; Windy X Windam)

My.srl (partial) :

0x84 ROM header size 0x00004000
0x88 ? 0x00001000
0x8C ? 0x00000600
0x90 ? 0x00040004
0x15C Logo CRC 0xCF56 (OK)
0x15E Header CRC 0xE8EE (OK)
0x180 ? 0x8D898581
0x184 ? 0x8C888480
0x188 ? 0x9C989490
0x18C ? 0x8C888480
0x190 ? 0x9C989490
0x198 ? 0x07C03740
0x19C ? 0x07403700
0x1A0 ? 0x00403000
0x1A4 ? 0x07C03740
0x1A8 ? 0x07403700
0x1AC ? 0x0300000F
0x1B0 ? 0xFFFFFFFF
0x1B4 ? 0x00006008
0x1B8 ? 0x00040406
0x1BC ? 0x81000000
0x1C0 ? 0x00203000
0x1C8 ? 0x02400000
0x1CC ? 0x00002DB4
0x1D0 ? 0x00207000
0x1D4 ? 0x03030CEC
0x1D8 ? 0x02E80000
0x1DC ? 0x000493C4
0x1E0 ? 0x00004000
0x1E4 ? 0x001BB400
0x1E8 ? 0x00203000
0x1EC ? 0x0004D400
0x1F0 ? 0x001BF400
0x1F4 ? 0x0000A500
0x1F8 ? 0x001C9A00
0x1FC ? 0x00000528

Banner CRC 0x4668 (OK)
English banner text, line 1 NINTENDO DSi?
English banner text, line 2 Demonstration

File CRC32: 5204E726

SMT dumper v1.0 curruption check: OK

ARM7 binary hash : C70BEE9E6FFA3234BDE0650E8912F2FFF98E36D9
WARNING! ARM7 binary is NOT verified!

WARNING! ARM7 RAM address does not point to shared memory!

----------

Compared to

wxw.nds header (from the same address down):

0x84 ROM header size 0x00004000
0x88 ? 0x00004B9C
0x15C Logo CRC 0xCF56 (OK)
0x15E Header CRC 0x5FD5 (OK)
0x1BC ? 0x60000000

Banner CRC 0x5A6C (OK)
English banner text, line 1 WINDY WINDAM
English banner text, line 2 Graffiti Entertainment

ARM9 footer found.

1000 2000 4FA54
DS Download Play(TM) / Wireless MultiBoot signature: INVALID
header hash : EF95604E1CAF497620B392648F920D0D802F81F1
ARM9 hash : 8B1EF3DB1BA6AA353C9BDB848D1CE34501449C21
ARM7 hash : A64C309486C205043DCEFBECA3183334D827BD0D
combined hash : 14AC85320F636EE6847C9185EE92BDB1F52204E5
signature hash : 32C066EA0992164CE004B495E28EA366220FA063

File CRC32: 054C8007

SMT dumper v1.0 curruption check: OK

ARM7 binary hash : A64C309486C205043DCEFBECA3183334D827BD0D
WARNING! ARM7 binary is NOT verified!

WARNING! ARM7 RAM address does not point to shared memory!

-------

Notice all the extra addresses in the .srl. The only thing the .nds has that is extra is the footer, which seems to add download play for two players with one card. Honesty unsure about the rest of the footer (if it does anything different). The trouble is, I can's actually edit the headers, only view and replace them. These are just text file dumps of the header info, but I have no way to inject info back into the .bin. I could replace the header entirely by re-packing, but that's about it.

The current way I work with the .srl is to use a NFS explorer to view the game's files (completely different than what the unpacked rom shows). With an unpack, you see the game's arm, y, banner, and header bin files. Browsing through nitro, I see the game's files themselves (all the assets, levels, etc.) Once I create a level with the editor our lead coder created, I export it to a .bin with a title I come up with based on the level (IE: pants.bin) and insert it. There is virtually no build compilation on my end. I only use the editor to compile a level and drop it into the build with the nitro browser. The header info is not located in this data. Unfortunately, my job isn't the coding part. I do the initial design docs, concept art, a good deal of in-game art and promotional illustrations, writing, story and level design.

What I'm hoping we'll eventually come up with is a way to patch the actual .srl file into working as an .nds file, or convert it. They're so similar, I'm really surprised it hasn't been done already. I wish I could supply the .srl to work on, but we really could have our license revoked if it ever got out. Our tags are in the header (and I can't change that from here.) I know there are .srl files out there though. Hmmm...
dirbaio
For future reference, "Responsible disclosure" isn't "acting like a douche about an exploit and demanding compensation".
Level: NaN


Posts: 889/-1288
EXP: NaN
For next: 0

Since: 07-28-09

From: Spain

Since last post: 10.8 years
Last activity: 9.9 years

Posted on 10-01-10 07:31:37 PM Link | Quote
Whoa...
Those values on 0x180 and up are *really* weird...
On all the released roms, they are all 0-filled.

3 questions:
- Are you building the source for FINAL ROM? If not, that might help.
- The rewritable flash cartridge thing you were talking about: Does it use a specific program/utility to transfer the ROM? In that case, it might be converting it to a standard .nds rom on the fly.
- Are you developing for DS or DSi? Current flashcarts can't play DSi games at all.

____________________
Ninji

Birdo
Why did my user title say I'm a toaster anyway
Level: 88


Posts: 1786/2014
EXP: 6638512
For next: 12152

Since: 07-26-07

Pronouns: he/him or they/them
From: Glasgow, Scotland

Since last post: 113 days
Last activity: 6 days

Posted on 10-01-10 08:24:27 PM Link | Quote
Actually, now that I think about it -- I've got a few SRL files (Animal Crossing: City Folk contains two, for the DS connectivity) but I can't test any of them out at the moment because I don't have my DS right now.

That weird data seems to be related to the DSi (Twilight) SDK -- I just checked Pokemon Black (which is a DSi game) and it also has that data in the header. Some of the values are the same as yours, but not all.



Also, check this -- you should see something like this in the output:

0x6C Secure area CRC 0x29D4 (OK, decrypted)


If it doesn't say that it's decrypted, then try running: ndstool -sd file.nds to decrypt it. I don't know if it matters or not, but it's worth a try.


One thing I should probably mention, though: as far as I know, SRL and NDS files are the same thing. I'm suspecting that the available ROM dumper tools decrypt the secure area upon dumping, which might be the reason why it works for retail games but not for yours (if my theory is correct).

____________________
Jul · The Left Mouse Button · RVLution.net
davemon
Random nobody
Level: 8


Posts: 5/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-01-10 08:42:09 PM Link | Quote
Dir: I know! I thought that too!

Tree: I think you're on to something there, I've heard a lot of people attempting to create .nds files running into trouble with un-encrypted roms, and encrypting them to work. I'll give it a shot. In the mean time, here's some more info:

Windy X Windam nds : 0x6C Secure area CRC 0x9F01 (DON'T KNOW, decrypted)
(It actually says that in the header. This game runs fine on the R4)

my.srl: 0x6C Secure area CRC 0xFE12 (OK, multiboot)

I'm using an ordinary R4 with a 2GB flashcard. All I do is copy the .nds files to the flashcard and run them from the R$ bios on the DS. Runs every .nds I've tested, old and new.

All the builds are for the demo, but should work the same for the release. I'm not compiling the builds, though, as I don't have the devkit. I'm just using a nitro file system browser to overwrite the working level.bin with newer versions to test.

Whether we get this working or not, it's very interesting to chat about. Thanks for the help input, I love a challenge. =)
davemon
Random nobody
Level: 8


Posts: 6/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-01-10 09:09:20 PM Link | Quote
Just tried messing with secure area encryption. (And realized I've been using an older version of ndstool, thanks for the updated link!) ndstool returns that the file does not appear to have a secure area to encrypt/decrypt. I also ran the "header fix" which changed absolutely nothing in the new header. Process of elimination progress, though.
Ninji

Birdo
Why did my user title say I'm a toaster anyway
Level: 88


Posts: 1787/2014
EXP: 6638512
For next: 12152

Since: 07-26-07

Pronouns: he/him or they/them
From: Glasgow, Scotland

Since last post: 113 days
Last activity: 6 days

Posted on 10-01-10 09:49:12 PM Link | Quote
Originally posted by davemon
Just tried messing with secure area encryption. (And realized I've been using an older version of ndstool, thanks for the updated link!) ndstool returns that the file does not appear to have a secure area to encrypt/decrypt. I also ran the "header fix" which changed absolutely nothing in the new header. Process of elimination progress, though.

That's strange... although it's also possible that Nintendo applies the encryption themselves once you send the final game off to them. :\

I just checked the untouched .srl files I have (from City Folk), and they have a secure area -- but it's marked as "OK, multiboot" by ndstool. Using ndstool -se or ndstool -sd returns "File doesn't appear to have a secure area!".

Also, reading through the ndstool source code, it seems that the "multiboot" ROM type is defined by the game not having a secure area -- at all. That may be why it's refusing to boot.


The No$GBA tech specs back that up -- check out the "avoiding encryption" section here: http://nocash.emubase.de/gbatek.htm#dscartridgesecurearea
I'm suspecting that the software on whatever flashcart you're using doesn't actually deal with these properly ... which makes sense, seeing as their main goals are not accuracy, but ability to run pirated commercial games.

I wonder if there's a way to get around that...

Of course it has to be possible (since Nintendo can do it) but I can't see any easy way :/

____________________
Jul · The Left Mouse Button · RVLution.net
plushifoxed

King Yoshi
la chica dijo...

Mood: The current mood of roxiemika at www.imood.com
Level: 119


Posts: 3486/3990
EXP: 18465650
For next: 463641

Since: 08-22-07

Pronouns: it/its or she/her
From: kamihama city

Since last post: 2 days
Last activity: 22 hours

Posted on 10-01-10 09:59:00 PM Link | Quote
Supakitsune
Just a quick question: What might this game that you're demoing at NYCC be? I'm going to be there, you see, and I'm curious...
If you can't tell me, that's fine; NDAs and all. Just wondering.

____________________
krutomisi
2480
Level: 94


Posts: 953/2481
EXP: 8265382
For next: 91275

Since: 02-01-10


Since last post: 241 days
Last activity: 181 days

Posted on 10-01-10 10:31:05 PM Link | Quote


Might it be possible to make a homebrew preloader kind of thing?


so it'll skip the whole header thing and just boot the game

____________________

953 / 60 / 242
davemon
Random nobody
Level: 8


Posts: 7/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-01-10 10:45:16 PM Link | Quote
Tree: that's exactly what my .srl has, and ndstool returns the exact same message. The flashcard is a simple R4, but I've never heard of anything that can run an .nds also running an .srl other than no$gba (as you said). no$gba does indeed run it quite well (when I'm not overloading my system with other stuff ^^).

Supakitsune: We're calling the project "Starpony" right now, a 3d space rail shooter lovingly molded after the golden age of the starfox genra. I'll have the official cart for download play, but I'll be all over the place. I'm most likely goiong to be around the Darkhorse booth and the Paradigm Shift table.

Krut: either that or a utility to patch the .srl. I'm sure there are at least a few creative ways around this. If we can get the AC:WW srl working, we should be good. Headin out of the studio for the night to get sushi with the wife and little one. =) I'll check back later tonight. ^^
Ninji

Birdo
Why did my user title say I'm a toaster anyway
Level: 88


Posts: 1788/2014
EXP: 6638512
For next: 12152

Since: 07-26-07

Pronouns: he/him or they/them
From: Glasgow, Scotland

Since last post: 113 days
Last activity: 6 days

Posted on 10-01-10 11:02:18 PM Link | Quote
The issue with patching the .srl to include a secure area is that the ARM9 binary needs to be modified to include it, and I'm not sure if it's possible to do this without recompiling the entire game from source code.

I'm curious -- have you tried booting the game with YSMenu and/or Wood R4 (alternative firmwares for the R4)? I haven't used them so I'm not sure how they work, but if they use different ROM loading code, then it might work...




____________________
Jul · The Left Mouse Button · RVLution.net
davemon
Random nobody
Level: 8


Posts: 8/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-02-10 03:28:48 AM Link | Quote
I'll look those up, try em, and get back to you. =)
davemon
Random nobody
Level: 8


Posts: 9/9
EXP: 1756
For next: 431

Since: 09-30-10


Since last post: 11.6 years
Last activity: 11.6 years

Posted on 10-02-10 04:43:03 AM Link | Quote
Success! Wood R4 did the trick, and best of all, with no editing to the file beyond renaming it to .nds. =) I haven't tried Yasu's bios yet, but WR4 runs it perfectly. You have no idea how much time this will save us! Thanks so much, I honestly didn't expect to find a solution so quickly! As soon as I'm able to give more info on this and other games we're developing, I'll definitely let you know. Keep an eye out for a new space shooter and a new rpg from Majesco TBR in 2011 on the DSi and 3DS. =)

I hope this solution will help others, I see this question pop up a lot.

Dave Lister
http://paradox-lost.com (site migrating, new updates soon).
Pages: 1 2Next newer thread | Next older thread
Jul - General Game/ROM Hacking - changing formats (age old question) .srl to .nds New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

30 database queries, 11 query cache hits.
Query execution time: 0.086706 seconds
Script execution time: 0.033924 seconds
Total render time: 0.120630 seconds