Testers wanted for 3DS ROM Patcher

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by evandixon, Dec 24, 2015.

  1. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    Applying ROM hacks isn't the easiest of things to do. First you have to unpack everything, then play around with files, then repack everything, and if you're going to use HANS, you have to trim the first 0x1000 bytes.

    I plan to simplify the process. I've been working on a ROM editor of sorts that outputs a distributable ROM patcher. This patcher can patch decrypted .3DS ROMs and romfs.bin files outputted by braindump. It can output to Gateway compatible .3DS files or to hans. Cia support might come in the future.

    The patcher works for me, but things always tend to go wrong when someone else uses it. So, I've made patchers for Pokemon Rutile Ruby and Pokemon Star Sapphire by @Dio_Vento. I'm looking for people with either a Gateway or the ability to use HANS to try either patcher, and let me know if things break. Be sure to make regular backups. I'm not liable if your computer explodes.

    In order to use this, you must have the .Net Framework 4.6 installed. Also, ctrtool needs msvcr120.dll, which comes with the Visual C++ Redistributable for Visual Studio 2013.

    Instructions:
    -Download your choice of zip. Don't forget to unblock it (Right-click > Properties > General > Security > Unblock.
    -Extract the zip using your favorite archive tool.
    -Run DSPatcher.exe
    -Choose a ROM. 3DS, CXI, and romfs.bin are supported. If you choose romfs.bin, an exefs.bin file will be used if it is in the same directory as romfs.bin.
    -Press patch.
    -Wait. Sorry about the UI hanging, I'll fix this sometime before an official, non-alpha/beta release.
    -If you're using a .3DS file, you'll be given the option to output to Hans or .3DS. Braindump users will only be able to output to Hans. If you're using a .CXI file made using Braindump, select Hans, because if you choose .3DS, it will not run.
    -Choose an output path. Either a .3DS file (for gateway), or the root of your SD card (for Hans)
    -Wait until the progress bar says "Ready".
    -Try the game out, see if it works.

    Downloads:
    Star Sapphire 2.0 - Legit Build (Patcher Alpha 4)
    Star Sapphire 2.0 - Leveled Build (Patcher Alpha 4)
    Star Sapphire 2.0 - 679 Build (Patcher Alpha 4)
    Star Sapphire 1.3 (Patcher Alpha 4)
    Rutile Ruby 1.2 (Patcher Alpha 3)
    Star Sapphire 1.2 (Patcher Alpha 3)

    The crossed out ones are older, but should properly output Gateway compatible ROMs.


    Credits:
    @SciresM for writing 3DS Builder, which I modified to add command-line argument support.
    Neimod, for writing ctrtool.
    Joshua MacDonald, for writing xdelta.

    If you're curious, the "alpha 3" in the filename is the version of the patcher. It will be changed to "alpha 4" or higher if I update the patcher.

    [Edit 4/5/16 (that's m-d-yy format btw)]
    I've released a newer version of the Star Sapphire patcher which should resolve issues with the newer version of Hans. Additionally, it should preserve the source game's private header if it has one.
    This is a newer version of the patcher included with Sky Editor 4 Beta 2, but it should also have better Hans compatibility. Please try it out and let me know if it works. I think this could make making ROM hacks significantly easier in the future, so help me help you help us all.

    [Edit 4/7/16]
    Added new modpacks for each build of Star Sapphire 2.
     
    Last edited by evandixon, Apr 8, 2016
    Ridge, AtlasFontaine and cvskid like this.
  2. Henning B

    Henning B Advanced Member

    Newcomer
    93
    28
    Aug 18, 2014
    Norway
    i would have helped, untill i read .net bla bla.
     
  3. fafaffy

    fafaffy GBAtemp Fan

    Member
    331
    160
    Sep 1, 2012
    United States
    What's wrong with .net? It streamlines the process of creating an application, and with mono you can't say compatibility is an issue.
     
  4. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    After I pressed No so it would output to a 3ds or CIA file, it pulled up a 3ds builder tool. Finding the romfs and exheader were a pain but I found them and got those areas filled in. Both of the exefs folders are "missing something essential" according to the tool. One has nothing in it and one has 3 xdelta files inside. I can't progress any more. Also, when I choose the save location, nothing is filled in in the save as type box, nor is there anything in the drop down box.
     
  5. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    That's strange. 3DS Builder shouldn't have been shown. It's supposed to run in the background, doing everything for you. Maybe the command line args are being weird. Where did you extract the zip, and where did you save the .3DS file?

    And if you want to do it manually, the proper folders are in Tools/ndstemp. The xdelta files are only used to patch the files in Tools/ndstemp.
     
  6. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    I extracted the zip to a new folder on my desktop named "Rom Hack". The original 3ds file (Omega Ruby) was on the desktop. I set the one it should have made to the desktop too. I just tried to use the files you said in Tools/ndstemp and it said it was missing something essential. I'm dumping my own exefs right now with Braindump.

    EDIT: The exefs files that I dumped with braindump don't work with the tool either, they're "missing something essential".
     
    Last edited by Boogieboo6, Dec 24, 2015
  7. AtlasFontaine

    AtlasFontaine GBAtemp Maniac

    Member
    1,081
    633
    Jul 18, 2015
    Venezuela
    Venezuela-Zulia.
    I'll wait for the .cia compatible version, gj tho.
     
  8. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    Deleted
     
    Last edited by Boogieboo6, Dec 24, 2015
  9. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    I tested it out on a Windows 7 x86 VM, and found that the issue is probably Tools/ctrtool.exe. Try running it to see if you get a message about missing msvcr120.dll. If so, installing this should fix it:
    https://www.microsoft.com/en-us/download/details.aspx?id=40784

    Adding that to the list of requirements in the OP.
     
  10. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    That worked ok. I played around a bit after successfully making a hans compatible game. During the process of making the hans game, I had to move a romfs folder from one part of the extracted files to another. Your shortcut immediately crashed and loading through hans was no better. (I copied the Rruby romfs and renamed them into 0011c400.romfs so hans would load them.)
     
  11. anhminh

    anhminh Pirate since 2010

    Member
    659
    402
    Sep 30, 2010
    Does this work on 32bit window xp?
     
  12. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    It's untested, but I doubt it. It depends on whether or not the .Net Framework 4.6, ctrtool, and xdelta are compiled to work in XP.
     
  13. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,559
    8,911
    Oct 27, 2002
    France
    Engine room, learning
    There are versions of ctrtool for 32bit, but there were so much self builds from different users that it was hard follow who did what and I think nobody made an easy place to find these different builds.

    Xdelta works fine on XP.

    There's no way to run .Net 4.5 on XP, it's 4.0 max.
    A lot of 4.5 .net application works fine on 4.0, it's just that developers don't change the "min ver" value, but it usually doesn't use exclusive 4.5 functions.
    I don't know if this app require 4.5 function, I'm just saying it's usually a compilation value to change to support XP.
    PS: I'm searching where I read that, for sources and to help users. (because maybe I mixed it with Visual Studio, not netframework)
    edit :
    I don't know if it helps, I found only this : http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx
    it's for visual studio (I guess you are using that to compile C# ?)
     
    cvskid likes this.
  14. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    Why did you have to move a romfs folder? Was there an error message?
     
  15. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    I ran the installer again just now, I had to move the romfs folder again because it wasn't there to begin with. A .net framework box tells me that part of the file path is missing in ndstemp/romfs. After moving it so I could complete an installation, I looked inside the folder again and the romfs were gone yet again from ndstemp.
     
  16. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    Try running just ctrtool in the Tools directory. See if an error dialog is shown. Since the romfs directory is not being made, it might be ctrtool's fault.
     
  17. Ridge

    Ridge The Queen Anemone

    Member
    373
    289
    Sep 10, 2015
    Norway
    Lunatea
    This seems really promising! I'd give it a go if I had either ORAS game... Just a question tho, since I use HANS and Braindump, what exactly would it help me with? Just trimming the first 0x1000 bytes and replacing data in a .romfs?
     
    Last edited by Ridge, Dec 26, 2015
  18. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    There was no error message when I ran ctrtool, just a command prompt window that flashed for a split second.
     
  19. evandixon
    OP

    evandixon PMD Researcher

    Member
    1,685
    806
    May 29, 2009
    United States
    It will unpack your romfs (and exefs if you have one), apply patches to certain files, repack the romfs, trim the first 0x1000 bytes, copy it to your SD, and create a shortcut to it in the homebrew menu. It also reduces the distribution download from ~60MB to ~4MB.

    If you want to try it out with another ROM Hack, just give me a link to it, and I can make another patcher.
    What version of Windows are you running? Also, is it 32 bit or 64 bit?
     
    Last edited by evandixon, Dec 26, 2015
    Ridge likes this.
  20. Boogieboo6

    Boogieboo6 @realDonaldTrump

    Member
    956
    1,309
    Jul 30, 2015
    United States
    Windows 10 64 bit