I am trying to figure out how il2cpp load strings and method names from global-metadata.dat but I got nothing as il2cpp is not open source. All I know is that il2cpp will call LoadMetadataFile to load the file, but what it will do afterwards? how to map the strings in the file to the variables in the memory?
IL2CPP uses the platform-specific memory-mapped file support to load the global-metadata.dat file into read-only memory. Once that is done, each string is accessed via an index into a big table of strings loaded into memory from that file.
Although IL2CPP is not open source, the source code for libil2cpp (the runtime) is shipped with recent versions of Unity. Try building a Unity project targeting Windows Store and IL2CPP. You should be able to step into the libil2cpp code in Visual Studio then.
You can see my friend’s github : GitHub - nevermoe/unity_metadata_loader
This project will load strings and method/class names in global-metadata.dat to IDA.