ROM Hack Discussion Creating Mods From Unity Based Switch Games From Source code

DaRockLobsta

Member
OP
Newcomer
Joined
Jan 10, 2019
Messages
15
Trophies
0
Age
41
XP
106
Country
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,

xXDungeon_CrawlerXx

Well-Known Member
Member
Joined
Jul 29, 2015
Messages
2,092
Trophies
1
Age
28
Location
Liverpool
XP
3,720
Country
@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?
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
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.
 

DaRockLobsta

Member
OP
Newcomer
Joined
Jan 10, 2019
Messages
15
Trophies
0
Age
41
XP
106
Country
Bangladesh
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.

@Falo

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

--------------------- MERGED ---------------------------
@xXDungeon_CrawlerXx
@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?

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,
  • Like
Reactions: xXDungeon_CrawlerXx

xXDungeon_CrawlerXx

Well-Known Member
Member
Joined
Jul 29, 2015
Messages
2,092
Trophies
1
Age
28
Location
Liverpool
XP
3,720
Country
@Falo
@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

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.png


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

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
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.
 

xXDungeon_CrawlerXx

Well-Known Member
Member
Joined
Jul 29, 2015
Messages
2,092
Trophies
1
Age
28
Location
Liverpool
XP
3,720
Country
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.
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.
 

DaRockLobsta

Member
OP
Newcomer
Joined
Jan 10, 2019
Messages
15
Trophies
0
Age
41
XP
106
Country
Bangladesh
Last edited by DaRockLobsta,
  • Like
Reactions: xXDungeon_CrawlerXx

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: An FPGA could probably replicate the chip's functionality without buying donor parts.