Skip to content

Commit

Permalink
Load IL2CPP package and create model
Browse files Browse the repository at this point in the history
  • Loading branch information
djkaty committed Aug 9, 2020
1 parent 568708b commit 4fd94c2
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions FallGuysProtoDumper/Program.cs
@@ -1,12 +1,39 @@
using System;
using Il2CppInspector;
// This is an example showing how to use the .NET type model in Il2CppInspector
// to re-construct .proto files for applications using protobuf-net

// Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty

// This example uses "Fall Guys: Ultimate Knockout" as the target:
// Steam package: https://steamdb.info/sub/369927/
// Game version: 2020-08-04
// GameAssembly.dll - CRC32: F448429A
// global-metadata.dat - CRC32: 98DFE664

// Il2CppInspector: https://github.com/djkaty/Il2CppInspector
// protobuf-net: https://github.com/protobuf-net/protobuf-net

using System;
using Il2CppInspector.Reflection;

namespace FallGuysProtoDumper
{
class Program
{
// Set the path to your metadata and binary files here
public static string MetadataFile = @"F:\Source\Repos\Il2CppInspector\Il2CppTests\TestBinaries\FallGuys\global-metadata.dat";
public static string BinaryFile = @"F:\Source\Repos\Il2CppInspector\Il2CppTests\TestBinaries\FallGuys\GameAssembly.dll";

static void Main(string[] args) {
Console.WriteLine("Hello World!");

// First we load the binary and metadata files into Il2CppInspector
// There is only one image so we use [0] to select this image
Console.WriteLine("Loading package...");
var package = Il2CppInspector.Il2CppInspector.LoadFromFile(BinaryFile, MetadataFile, silent: true)[0];

// Now we create the .NET type model from the package
// This creates a .NET Reflection-style interface we can query with Linq
Console.WriteLine("Creating type model...");
var model = new TypeModel(package);
}
}
}

0 comments on commit 4fd94c2

Please sign in to comment.