Kasuromi / GTFO-API

GNU General Public License v3.0
9 stars 7 forks source link

Use Cecil on Unhollowed assemblies for interface wrappings #28

Open Kasuromi opened 2 years ago

Kasuromi commented 2 years ago

The current system uses a simple json file and outputs the strings fed to it. A much better solution would be to use Cecil (during build) on the unhollowed assemblies and have a much cleaner interface wrapper.

CaffeineBytes commented 2 years ago

Besides naming convention, is there another way to determine if a class in the unhollowed assemblies is an interface and should be included in the wrapper? Briefly looking through the assemblies, they all inherit Il2CppObjectBase.

CaffeineBytes commented 2 years ago

Also, what would be the advantage of Cecil vs using reflection to load the assembly and reading through the classes? I don't have experience with Cecil so just wanted some insight about it.

Kasuromi commented 2 years ago

Besides naming convention, is there another way to determine if a class in the unhollowed assemblies is an interface and should be included in the wrapper? Briefly looking through the assemblies, they all inherit Il2CppObjectBase.

That's a really good point, I keep forgetting unhollower strips the interface flag from the type. I might PR something into unhollower to add an attribute to specify that a class is an interface proxy... or we just use Il2CppDumper

Kasuromi commented 2 years ago

Also, what would be the advantage of Cecil vs using reflection to load the assembly and reading through the classes? I don't have experience with Cecil so just wanted some insight about it.

We can accomplish the same thing with both methods, however Cecil doesn't require us loading the assemblies into the AppDomain and we can just analyze them.