NULL

Discussion Creating Mods From Unity Based Switch Games From Source code

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by DaRockLobsta, Feb 12, 2019.

  1. DaRockLobsta
    OP

    DaRockLobsta Member

    Newcomer
    1
    Jan 10, 2019
    Bangladesh
    There are Several Games made with unity, as you know it is very easy to view the source code of a unity game and mod it, in my research i have learned, that it uses il2cpp, i have managed to decompile a game "Farm Together". unlike older unity games that exposed the dll files for easy access you have to parse the "global_metadata.dat" file, after that all code is exposed.

    https://github.com/Perfare/Il2CppDumper
     
    Last edited by DaRockLobsta, Mar 19, 2019
  2. xXDungeon_CrawlerXx

    xXDungeon_CrawlerXx GBAtemp Addict

    Member
    10
    Jul 29, 2015
    Liverpool
    @DaRockLobsta did you get that global_metadata.dat parsing to work?
    I've xtracted all the files of "Final Fantasy IX" (Nintendo Switch), which was also made with Unity.
    There's no DLL but a global_metadata.dat.

    How can I use this file now to get the Source code?
     
  3. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    All Switch Unity games use il2cpp.

    il2cpp converts unity (.net) games to native code, or in other words C/C++, you cannot recover the source code from that.
    You can restore some framework, like function names and offsets from global_metadata.dat, but thats it, what you want is simple not possible.

    The only way is a combination of IDA Pro, an il2cpp parser (no one made one for switch yet) and a loooooooot of work.
     
  4. DaRockLobsta
    OP

    DaRockLobsta Member

    Newcomer
    1
    Jan 10, 2019
    Bangladesh
    @Falo

    there is a program called devxunity using the demo version, it parses the metadata file.

    — Posts automatically merged - Please don't double post! —
    @xXDungeon_CrawlerXx
    there is a program called devxunity using the demo version, it parses the metadata file. load up the metadata file in the program.
    there is also a metadata loader for IDA that does work for The switchs metadata file google github nevermoe unity_metadata_loader use that inconjection with github pgarba SwitchIDAProLoader
     
    Last edited by DaRockLobsta, Feb 14, 2019
    xXDungeon_CrawlerXx likes this.
  5. xXDungeon_CrawlerXx

    xXDungeon_CrawlerXx GBAtemp Addict

    Member
    10
    Jul 29, 2015
    Liverpool
    GREAT!
    Gonna test this out tomorrow!
    Thank you very much mate

    EDIT:
    @DaRockLobsta I'm currently at Step 6, getting this error:
    upload_2019-2-14_22-55-41.

    Do you have an Idea how to fix that?
    I'm not THAT familiar with python and IDA
     
    Last edited by xXDungeon_CrawlerXx, Feb 14, 2019
  6. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    These tools are designed for android and ios, not Switch.

    Switch uses compressed binaries -> unity_decoder.exe will fail unless you manually decompresss it first.
    unity_loader.py will also fail, because it expects an android/ios elf, but it gets a nintendo nso and certain stuff is missing for it to work.

    Also none of these tool will recover the source code needed to install mods.
     
  7. xXDungeon_CrawlerXx

    xXDungeon_CrawlerXx GBAtemp Addict

    Member
    10
    Jul 29, 2015
    Liverpool
    If @DaRockLobsta stated that this method will work, I believe he tried it out already.
    So if it work, it's enough to change variables. Probably not ADDING stuff, but changing stuff more easily.
     
  8. DaRockLobsta
    OP

    DaRockLobsta Member

    Newcomer
    1
    Jan 10, 2019
    Bangladesh
    Last edited by DaRockLobsta, Mar 19, 2019
    xXDungeon_CrawlerXx likes this.
  9. xXDungeon_CrawlerXx

    xXDungeon_CrawlerXx GBAtemp Addict

    Member
    10
    Jul 29, 2015
    Liverpool
  10. DaRockLobsta
    OP

    DaRockLobsta Member

    Newcomer
    1
    Jan 10, 2019
    Bangladesh
Loading...