Separate project from Il2Cpp2Proto

This commit is contained in:
Katy Coe
2017-03-17 11:29:54 +01:00
parent 75fb3d6c67
commit 9ced0b6c56
21 changed files with 1588 additions and 1 deletions

52
Il2CppDumper/Program.cs Normal file
View File

@@ -0,0 +1,52 @@
// Copyright (c) 2017 Katy Coe - https://www.djkaty.com - https://github.com/djlaty
// All rights reserved
using System;
using System.IO;
namespace Il2CppInspector
{
public class App
{
static void Main(string[] args) {
// Command-line usage: dotnet run [<binary-file> [<metadata-file> [<output-file>]]]
// Defaults to libil2cpp.so or GameAssembly.dll if binary file not specified
string imageFile = "libil2cpp.so";
string metaFile = "global-metadata.dat";
string outFile = "types.cs";
if (args.Length == 0)
if (!File.Exists(imageFile))
imageFile = "GameAssembly.dll";
if (args.Length >= 1)
imageFile = args[0];
if (args.Length >= 2)
metaFile = args[1];
if (args.Length >= 3)
outFile = args[2];
// Check files
if (!File.Exists(imageFile)) {
Console.Error.WriteLine($"File {imageFile} does not exist");
Environment.Exit(1);
}
if (!File.Exists(metaFile)) {
Console.Error.WriteLine($"File {metaFile} does not exist");
Environment.Exit(1);
}
// Analyze data
var il2cpp = Il2CppProcessor.LoadFromFile(imageFile, metaFile);
if (il2cpp == null)
Environment.Exit(1);
// Write output file
var dumper = new Il2CppDumper(il2cpp);
dumper.WriteFile(outFile);
}
}
}