C++: Significant iteration of scaffolding output (see commit description)
Generate pre-compiled headers for IL2CPP types and functions Resolved naming conflicts with functions and macros from windows.h IL2CPP app functions and TypeInfos were incorrectly placed in global namespace instead of 'app' Added /MP compiler option (multi-processor compilation) Split source files into folders Move GetBaseAddress() into helpers.cpp Add NewConsole() to helpers.cpp Move init_il2cpp() from IL2CPP declarations header to own source file Refactor some header files for consistency and duplicate elimination
This commit is contained in:
@@ -258,7 +258,7 @@ namespace Il2CppInspector.CLI
|
|||||||
|
|
||||||
// IDA Python script output
|
// IDA Python script output
|
||||||
using (new Benchmark("Generate IDAPython script")) {
|
using (new Benchmark("Generate IDAPython script")) {
|
||||||
new IDAPythonScript(appModel).WriteScriptToFile(options.PythonOutFile, options.CppOutPath + Path.DirectorySeparatorChar + "il2cpp-types.h");
|
new IDAPythonScript(appModel).WriteScriptToFile(options.PythonOutFile, Path.Combine(options.CppOutPath, "appdata/il2cpp-types.h"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// C++ output
|
// C++ output
|
||||||
|
|||||||
@@ -80,17 +80,24 @@ typedef size_t uintptr_t;
|
|||||||
writer.Close();
|
writer.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(string outputPath) {
|
public void Write(string projectPath) {
|
||||||
// Ensure output directory exists and is not a file
|
// Ensure output directory exists and is not a file
|
||||||
// A System.IOException will be thrown if it's a file'
|
// A System.IOException will be thrown if it's a file'
|
||||||
Directory.CreateDirectory(outputPath);
|
var srcUserPath = Path.Combine(projectPath, "user");
|
||||||
|
var srcFxPath = Path.Combine(projectPath, "framework");
|
||||||
|
var srcDataPath = Path.Combine(projectPath, "appdata");
|
||||||
|
|
||||||
|
Directory.CreateDirectory(projectPath);
|
||||||
|
Directory.CreateDirectory(srcUserPath);
|
||||||
|
Directory.CreateDirectory(srcFxPath);
|
||||||
|
Directory.CreateDirectory(srcDataPath);
|
||||||
|
|
||||||
// Write type definitions to il2cpp-types.h
|
// Write type definitions to il2cpp-types.h
|
||||||
WriteTypes(Path.Combine(outputPath, "il2cpp-types.h"));
|
WriteTypes(Path.Combine(srcDataPath, "il2cpp-types.h"));
|
||||||
|
|
||||||
// Write selected Unity API function file to il2cpp-api-functions.h
|
// Write selected Unity API function file to il2cpp-api-functions.h
|
||||||
// (this is a copy of the header file from an actual Unity install)
|
// (this is a copy of the header file from an actual Unity install)
|
||||||
var il2cppApiFile = Path.Combine(outputPath, "il2cpp-api-functions.h");
|
var il2cppApiFile = Path.Combine(srcDataPath, "il2cpp-api-functions.h");
|
||||||
var apiHeaderText = model.UnityHeaders.GetAPIHeaderText();
|
var apiHeaderText = model.UnityHeaders.GetAPIHeaderText();
|
||||||
|
|
||||||
using var fsApi = new FileStream(il2cppApiFile, FileMode.Create);
|
using var fsApi = new FileStream(il2cppApiFile, FileMode.Create);
|
||||||
@@ -110,7 +117,7 @@ typedef size_t uintptr_t;
|
|||||||
writer.Close();
|
writer.Close();
|
||||||
|
|
||||||
// Write API function pointers to il2cpp-function-ptr.h
|
// Write API function pointers to il2cpp-function-ptr.h
|
||||||
var il2cppFnPtrFile = Path.Combine(outputPath, "il2cpp-function-ptr.h");
|
var il2cppFnPtrFile = Path.Combine(srcDataPath, "il2cpp-function-ptr.h");
|
||||||
|
|
||||||
using var fs2 = new FileStream(il2cppFnPtrFile, FileMode.Create);
|
using var fs2 = new FileStream(il2cppFnPtrFile, FileMode.Create);
|
||||||
writer = new StreamWriter(fs2, Encoding.ASCII);
|
writer = new StreamWriter(fs2, Encoding.ASCII);
|
||||||
@@ -130,7 +137,7 @@ typedef size_t uintptr_t;
|
|||||||
writer.Close();
|
writer.Close();
|
||||||
|
|
||||||
// Write application type definition addresses to il2cpp-type-ptr.h
|
// Write application type definition addresses to il2cpp-type-ptr.h
|
||||||
var il2cppTypeInfoFile = Path.Combine(outputPath, "il2cpp-type-ptr.h");
|
var il2cppTypeInfoFile = Path.Combine(srcDataPath, "il2cpp-type-ptr.h");
|
||||||
|
|
||||||
using var fs3 = new FileStream(il2cppTypeInfoFile, FileMode.Create);
|
using var fs3 = new FileStream(il2cppTypeInfoFile, FileMode.Create);
|
||||||
writer = new StreamWriter(fs3, Encoding.ASCII);
|
writer = new StreamWriter(fs3, Encoding.ASCII);
|
||||||
@@ -145,7 +152,7 @@ typedef size_t uintptr_t;
|
|||||||
writer.Close();
|
writer.Close();
|
||||||
|
|
||||||
// Write method pointers and signatures to il2cpp-functions.h
|
// Write method pointers and signatures to il2cpp-functions.h
|
||||||
var methodFile = Path.Combine(outputPath, "il2cpp-functions.h");
|
var methodFile = Path.Combine(srcDataPath, "il2cpp-functions.h");
|
||||||
|
|
||||||
using var fs4 = new FileStream(methodFile, FileMode.Create);
|
using var fs4 = new FileStream(methodFile, FileMode.Create);
|
||||||
writer = new StreamWriter(fs4, Encoding.ASCII);
|
writer = new StreamWriter(fs4, Encoding.ASCII);
|
||||||
@@ -165,19 +172,24 @@ typedef size_t uintptr_t;
|
|||||||
writer.Close();
|
writer.Close();
|
||||||
|
|
||||||
// Write boilerplate code
|
// Write boilerplate code
|
||||||
File.WriteAllText(Path.Combine(outputPath, "il2cpp-init.h"), Resources.Cpp_IL2CPPInitH);
|
File.WriteAllText(Path.Combine(srcFxPath, "dllmain.cpp"), Resources.Cpp_DLLMainCpp);
|
||||||
File.WriteAllText(Path.Combine(outputPath, "helpers.h"), Resources.Cpp_HelpersH);
|
File.WriteAllText(Path.Combine(srcFxPath, "helpers.cpp"), Resources.Cpp_HelpersCpp);
|
||||||
File.WriteAllText(Path.Combine(outputPath, "dllmain.h"), Resources.Cpp_DLLMainH);
|
File.WriteAllText(Path.Combine(srcFxPath, "helpers.h"), Resources.Cpp_HelpersH);
|
||||||
File.WriteAllText(Path.Combine(outputPath, "main.cpp"), Resources.Cpp_MainCpp);
|
File.WriteAllText(Path.Combine(srcFxPath, "il2cpp-appdata.h"), Resources.Cpp_Il2CppAppDataH);
|
||||||
File.WriteAllText(Path.Combine(outputPath, "helpers.cpp"), Resources.Cpp_HelpersCpp);
|
File.WriteAllText(Path.Combine(srcFxPath, "il2cpp-init.cpp"), Resources.Cpp_Il2CppInitCpp);
|
||||||
File.WriteAllText(Path.Combine(outputPath, "dllmain.cpp"), Resources.Cpp_DLLMainCpp);
|
File.WriteAllText(Path.Combine(srcFxPath, "il2cpp-init.h"), Resources.Cpp_Il2CppInitH);
|
||||||
|
File.WriteAllText(Path.Combine(srcFxPath, "pch-il2cpp.cpp"), Resources.Cpp_PCHIl2Cpp);
|
||||||
|
File.WriteAllText(Path.Combine(srcFxPath, "pch-il2cpp.h"), Resources.Cpp_PCHIl2CppH);
|
||||||
|
|
||||||
|
File.WriteAllText(Path.Combine(srcUserPath, "main.cpp"), Resources.Cpp_MainCpp);
|
||||||
|
File.WriteAllText(Path.Combine(srcUserPath, "main.h"), Resources.Cpp_MainH);
|
||||||
|
|
||||||
// Write Visual Studio project and solution files
|
// Write Visual Studio project and solution files
|
||||||
var projectGuid = Guid.NewGuid();
|
var projectGuid = Guid.NewGuid();
|
||||||
var projectName = "IL2CppDLL";
|
var projectName = "IL2CppDLL";
|
||||||
var projectFile = projectName + ".vcxproj";
|
var projectFile = projectName + ".vcxproj";
|
||||||
|
|
||||||
File.WriteAllText(Path.Combine(outputPath, projectFile),
|
File.WriteAllText(Path.Combine(projectPath, projectFile),
|
||||||
Resources.CppProjTemplate.Replace("%PROJECTGUID%", projectGuid.ToString()));
|
Resources.CppProjTemplate.Replace("%PROJECTGUID%", projectGuid.ToString()));
|
||||||
|
|
||||||
var solutionGuid = Guid.NewGuid();
|
var solutionGuid = Guid.NewGuid();
|
||||||
@@ -189,7 +201,7 @@ typedef size_t uintptr_t;
|
|||||||
.Replace("%PROJECTFILE%", projectFile)
|
.Replace("%PROJECTFILE%", projectFile)
|
||||||
.Replace("%SOLUTIONGUID%", solutionGuid.ToString());
|
.Replace("%SOLUTIONGUID%", solutionGuid.ToString());
|
||||||
|
|
||||||
File.WriteAllText(Path.Combine(outputPath, solutionFile), sln);
|
File.WriteAllText(Path.Combine(projectPath, solutionFile), sln);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeHeader() {
|
private void writeHeader() {
|
||||||
|
|||||||
174
Il2CppInspector.Common/Properties/Resources.Designer.cs
generated
174
Il2CppInspector.Common/Properties/Resources.Designer.cs
generated
@@ -62,10 +62,12 @@ namespace Il2CppInspector.Properties {
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
///// DLL entry point
|
||||||
///
|
///
|
||||||
///#define WIN32_LEAN_AND_MEAN
|
///#define WIN32_LEAN_AND_MEAN
|
||||||
///#include "windows.h"
|
///#include <windows.h>
|
||||||
///#include "dllmain.h"
|
///#include "il2cpp-init.h"
|
||||||
|
///#include "main.h"
|
||||||
///
|
///
|
||||||
///// DLL entry point
|
///// DLL entry point
|
||||||
///BOOL APIENTRY DllMain( HMODULE hModule,
|
///BOOL APIENTRY DllMain( HMODULE hModule,
|
||||||
@@ -77,7 +79,7 @@ namespace Il2CppInspector.Properties {
|
|||||||
/// {
|
/// {
|
||||||
/// case DLL_PROCESS_ATTACH:
|
/// case DLL_PROCESS_ATTACH:
|
||||||
/// init_il2cpp();
|
/// init_il2cpp();
|
||||||
/// CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) Run, NULL, [rest of string was truncated]";.
|
/// CreateThread(NULL, 0, (LPTHREAD_S [rest of string was truncated]";.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Cpp_DLLMainCpp {
|
internal static string Cpp_DLLMainCpp {
|
||||||
get {
|
get {
|
||||||
@@ -87,35 +89,24 @@ namespace Il2CppInspector.Properties {
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
///
|
///// Helper functions
|
||||||
///// Entry point declaration for custom injected code
|
|
||||||
///void Run();
|
|
||||||
///
|
|
||||||
///// IL2CPP initializer
|
|
||||||
///void init_il2cpp();.
|
|
||||||
/// </summary>
|
|
||||||
internal static string Cpp_DLLMainH {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Cpp-DLLMainH", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
|
||||||
///// Logging functions
|
|
||||||
///
|
///
|
||||||
///#define WIN32_LEAN_AND_MEAN
|
///#define WIN32_LEAN_AND_MEAN
|
||||||
///#define WIN32_EXTRA_LEAN
|
|
||||||
///#include <windows.h>
|
///#include <windows.h>
|
||||||
|
///#include <string>
|
||||||
///#include "helpers.h"
|
///#include "helpers.h"
|
||||||
///
|
///
|
||||||
///// Write some text to the log file
|
///// Log file location
|
||||||
///void LogWrite(std::string text)
|
///extern const LPCWSTR LOG_FILE;
|
||||||
///{
|
|
||||||
/// HANDLE hfile = CreateFileW(LOG_FILE, FILE_APPEND_DATA, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
||||||
///
|
///
|
||||||
/// if (hfile == INVALID_HANDLE_VALUE)
|
///// Helper function to get the module base address
|
||||||
/// MessageBox(0, L"Could not open log file", 0, [rest of string was truncated]";.
|
///uintptr_t GetBaseAddress() {
|
||||||
|
/// return (uintptr_t) GetModuleHandleW(L"GameAssembly.dll");
|
||||||
|
///}
|
||||||
|
///
|
||||||
|
///// Helper function to append text to a file
|
||||||
|
///void LogWrite(std::string text) {
|
||||||
|
/// HANDLE hfile = CreateFileW(LOG [rest of string was truncated]";.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Cpp_HelpersCpp {
|
internal static string Cpp_HelpersCpp {
|
||||||
get {
|
get {
|
||||||
@@ -125,22 +116,24 @@ namespace Il2CppInspector.Properties {
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
///// Logging functions
|
///// Helper functions
|
||||||
///
|
///
|
||||||
///#pragma once
|
///#pragma once
|
||||||
|
///
|
||||||
///#include <string>
|
///#include <string>
|
||||||
///#include <sstream>
|
///#include <sstream>
|
||||||
///#include <iomanip>
|
|
||||||
///
|
///
|
||||||
///extern const LPCWSTR LOG_FILE;
|
///// Helper function to get the module base address
|
||||||
|
///uintptr_t GetBaseAddress();
|
||||||
///
|
///
|
||||||
///// Helper function to append text to a file
|
///// Helper function to append text to a file
|
||||||
///void LogWrite(std::string text);
|
///void LogWrite(std::string text);
|
||||||
///
|
///
|
||||||
|
///// Helper function to open a new console window and redirect stdout there
|
||||||
|
///void NewConsole();
|
||||||
|
///
|
||||||
///// Helper function to convert a pointer to hex
|
///// Helper function to convert a pointer to hex
|
||||||
///template<typename T> std::string to_hex_string(T i) {
|
///template<typename T> std::string to_hex_string(T [rest of string was truncated]";.
|
||||||
/// std::stringstream stream;
|
|
||||||
/// stream << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << [rest of string was truncated]";.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Cpp_HelpersH {
|
internal static string Cpp_HelpersH {
|
||||||
get {
|
get {
|
||||||
@@ -150,7 +143,7 @@ namespace Il2CppInspector.Properties {
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
///// IL2CPP application initializer
|
///// IL2CPP application data
|
||||||
///
|
///
|
||||||
///#pragma once
|
///#pragma once
|
||||||
///
|
///
|
||||||
@@ -163,18 +156,65 @@ namespace Il2CppInspector.Properties {
|
|||||||
///#include "il2cpp-function-ptr.h"
|
///#include "il2cpp-function-ptr.h"
|
||||||
///
|
///
|
||||||
///// IL2CPP APIs
|
///// IL2CPP APIs
|
||||||
|
///#define DO_API(r, n, p) extern r (*n) p
|
||||||
|
///#include "il2cpp-api-functions.h"
|
||||||
|
///#undef DO_API
|
||||||
|
///
|
||||||
|
///// Application-specific functions
|
||||||
|
///#define DO_APP_FUNC(a, r, n, p) extern r (*n) p
|
||||||
|
///namespace app {
|
||||||
|
/// #include "il2cpp-functions.h"
|
||||||
|
///} [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Cpp_Il2CppAppDataH {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Cpp-Il2CppAppDataH", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
///// IL2CPP application initializer
|
||||||
|
///
|
||||||
|
///#include "pch-il2cpp.h"
|
||||||
|
///
|
||||||
|
///#include "il2cpp-appdata.h"
|
||||||
|
///#include "il2cpp-init.h"
|
||||||
|
///#include "helpers.h"
|
||||||
|
///
|
||||||
|
///// IL2CPP APIs
|
||||||
///#define DO_API(r, n, p) r (*n) p
|
///#define DO_API(r, n, p) r (*n) p
|
||||||
///#include "il2cpp-api-functions.h"
|
///#include "il2cpp-api-functions.h"
|
||||||
///#undef DO_API
|
///#undef DO_API
|
||||||
///
|
///
|
||||||
///// Application-specific functions
|
///// Application-specific functions
|
||||||
///#define DO_APP_FUNC(a, r, n, p) r (*n) p
|
///#define DO_APP_FUNC(a, r, n, p) r (*n) p
|
||||||
|
///namespace app {
|
||||||
///#include "il2cpp-functions.h"
|
///#include "il2cpp-functions.h"
|
||||||
///#und [rest of string was truncated]";.
|
///}
|
||||||
|
///#undef DO_APP_FUNC
|
||||||
|
///
|
||||||
|
///// TypeInfo pointers
|
||||||
|
///#define DO_TYPEDEF(a, n [rest of string was truncated]";.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Cpp_IL2CPPInitH {
|
internal static string Cpp_Il2CppInitCpp {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("Cpp-IL2CPPInitH", resourceCulture);
|
return ResourceManager.GetString("Cpp-Il2CppInitCpp", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
///// IL2CPP application initializer
|
||||||
|
///
|
||||||
|
///#pragma once
|
||||||
|
///
|
||||||
|
///// IL2CPP application initializer
|
||||||
|
///void init_il2cpp();.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Cpp_Il2CppInitH {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Cpp_Il2CppInitH", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +222,12 @@ namespace Il2CppInspector.Properties {
|
|||||||
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
///// Custom injected code entry point
|
///// Custom injected code entry point
|
||||||
///
|
///
|
||||||
///#include "il2cpp-init.h"
|
///#include "pch-il2cpp.h"
|
||||||
|
///
|
||||||
|
///#define WIN32_LEAN_AND_MEAN
|
||||||
|
///#include <Windows.h>
|
||||||
|
///#include <iostream>
|
||||||
|
///#include "il2cpp-appdata.h"
|
||||||
///#include "helpers.h"
|
///#include "helpers.h"
|
||||||
///
|
///
|
||||||
///using namespace app;
|
///using namespace app;
|
||||||
@@ -190,13 +235,10 @@ namespace Il2CppInspector.Properties {
|
|||||||
///// Set the name of your log file here
|
///// Set the name of your log file here
|
||||||
///extern const LPCWSTR LOG_FILE = L"il2cpp-log.txt";
|
///extern const LPCWSTR LOG_FILE = L"il2cpp-log.txt";
|
||||||
///
|
///
|
||||||
///// Injected code entry point
|
///// Custom injected code entry point
|
||||||
///void Run()
|
///void Run()
|
||||||
///{
|
///{
|
||||||
/// LogWrite("Startup");
|
/// // If you would like to write to a log file, specify the name above and u [rest of string was truncated]";.
|
||||||
///
|
|
||||||
/// // Place your custom code here
|
|
||||||
///}.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Cpp_MainCpp {
|
internal static string Cpp_MainCpp {
|
||||||
get {
|
get {
|
||||||
@@ -204,6 +246,52 @@ namespace Il2CppInspector.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
///// Custom injected code entry point
|
||||||
|
///
|
||||||
|
///#pragma once
|
||||||
|
///
|
||||||
|
///// Custom injected code entry point
|
||||||
|
///void Run();.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Cpp_MainH {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Cpp-MainH", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to // pch.cpp: source file corresponding to the pre-compiled header
|
||||||
|
///
|
||||||
|
///#include "pch-il2cpp.h"
|
||||||
|
///
|
||||||
|
///// When you are using pre-compiled headers, this source file is necessary for compilation to succeed..
|
||||||
|
/// </summary>
|
||||||
|
internal static string Cpp_PCHIl2Cpp {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Cpp-PCHIl2Cpp", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to // pch.h: This is a precompiled header file.
|
||||||
|
///// Files listed below are compiled only once, improving build performance for future builds.
|
||||||
|
///// This also affects IntelliSense performance, including code completion and many code browsing features.
|
||||||
|
///// However, files listed here are ALL re-compiled if any one of them is updated between builds.
|
||||||
|
///// Do not add files here that you will be updating frequently as this negates the performance advantage.
|
||||||
|
///
|
||||||
|
///#ifndef PCH_IL2CPP_H
|
||||||
|
///#define PCH_IL2CPP_H
|
||||||
|
///
|
||||||
|
///// add headers [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Cpp_PCHIl2CppH {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Cpp-PCHIl2CppH", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?>
|
/// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?>
|
||||||
///<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
///<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
@@ -238,7 +326,7 @@ namespace Il2CppInspector.Properties {
|
|||||||
/// Release|x64 = Release|x64
|
/// Release|x64 = Release|x64
|
||||||
/// Release|x86 = Release|x86
|
/// Release|x86 = Release|x86
|
||||||
/// EndGlobalSection
|
/// EndGlobalSection
|
||||||
/// GlobalSection(ProjectConfig [rest of string was truncated]";.
|
/// GlobalSection(ProjectConfigurationPlatfo [rest of string was truncated]";.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string CppSlnTemplate {
|
internal static string CppSlnTemplate {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@@ -119,10 +119,12 @@
|
|||||||
</resheader>
|
</resheader>
|
||||||
<data name="Cpp-DLLMainCpp" xml:space="preserve">
|
<data name="Cpp-DLLMainCpp" xml:space="preserve">
|
||||||
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// DLL entry point
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include "windows.h"
|
#include <windows.h>
|
||||||
#include "dllmain.h"
|
#include "il2cpp-init.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
// DLL entry point
|
// DLL entry point
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||||
@@ -143,53 +145,61 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}</value>
|
}</value>
|
||||||
</data>
|
|
||||||
<data name="Cpp-DLLMainH" xml:space="preserve">
|
|
||||||
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
|
||||||
|
|
||||||
// Entry point declaration for custom injected code
|
|
||||||
void Run();
|
|
||||||
|
|
||||||
// IL2CPP initializer
|
|
||||||
void init_il2cpp();</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="Cpp-HelpersCpp" xml:space="preserve">
|
<data name="Cpp-HelpersCpp" xml:space="preserve">
|
||||||
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
// Logging functions
|
// Helper functions
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_EXTRA_LEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <string>
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
// Write some text to the log file
|
// Log file location
|
||||||
void LogWrite(std::string text)
|
extern const LPCWSTR LOG_FILE;
|
||||||
{
|
|
||||||
|
// Helper function to get the module base address
|
||||||
|
uintptr_t GetBaseAddress() {
|
||||||
|
return (uintptr_t) GetModuleHandleW(L"GameAssembly.dll");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to append text to a file
|
||||||
|
void LogWrite(std::string text) {
|
||||||
HANDLE hfile = CreateFileW(LOG_FILE, FILE_APPEND_DATA, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
HANDLE hfile = CreateFileW(LOG_FILE, FILE_APPEND_DATA, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
if (hfile == INVALID_HANDLE_VALUE)
|
if (hfile == INVALID_HANDLE_VALUE)
|
||||||
MessageBox(0, L"Could not open log file", 0, 0);
|
MessageBoxW(0, L"Could not open log file", 0, 0);
|
||||||
|
|
||||||
DWORD written;
|
DWORD written;
|
||||||
WriteFile(hfile, text.c_str(), (DWORD) text.length(), &written, NULL);
|
WriteFile(hfile, text.c_str(), (DWORD) text.length(), &written, NULL);
|
||||||
WriteFile(hfile, "\r\n", 2, &written, NULL);
|
WriteFile(hfile, "\r\n", 2, &written, NULL);
|
||||||
CloseHandle(hfile);
|
CloseHandle(hfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to open a new console window and redirect stdout there
|
||||||
|
void NewConsole() {
|
||||||
|
AllocConsole();
|
||||||
|
freopen_s((FILE**) stdout, "CONOUT$", "w", stdout);
|
||||||
}</value>
|
}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Cpp-HelpersH" xml:space="preserve">
|
<data name="Cpp-HelpersH" xml:space="preserve">
|
||||||
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
// Logging functions
|
// Helper functions
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
extern const LPCWSTR LOG_FILE;
|
// Helper function to get the module base address
|
||||||
|
uintptr_t GetBaseAddress();
|
||||||
|
|
||||||
// Helper function to append text to a file
|
// Helper function to append text to a file
|
||||||
void LogWrite(std::string text);
|
void LogWrite(std::string text);
|
||||||
|
|
||||||
|
// Helper function to open a new console window and redirect stdout there
|
||||||
|
void NewConsole();
|
||||||
|
|
||||||
// Helper function to convert a pointer to hex
|
// Helper function to convert a pointer to hex
|
||||||
template<typename T> std::string to_hex_string(T i) {
|
template<typename T> std::string to_hex_string(T i) {
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
@@ -197,111 +207,25 @@ template<typename T> std::string to_hex_string(T i) {
|
|||||||
return stream.str();
|
return stream.str();
|
||||||
}</value>
|
}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Cpp-IL2CPPInitH" xml:space="preserve">
|
<data name="Cpp_Il2CppInitH" xml:space="preserve">
|
||||||
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
// IL2CPP application initializer
|
// IL2CPP application initializer
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
// IL2CPP application initializer
|
||||||
|
void init_il2cpp();</value>
|
||||||
// Application-specific types
|
|
||||||
#include "il2cpp-types.h"
|
|
||||||
|
|
||||||
// IL2CPP API function pointers
|
|
||||||
#include "il2cpp-function-ptr.h"
|
|
||||||
|
|
||||||
// IL2CPP APIs
|
|
||||||
#define DO_API(r, n, p) r (*n) p
|
|
||||||
#include "il2cpp-api-functions.h"
|
|
||||||
#undef DO_API
|
|
||||||
|
|
||||||
// Application-specific functions
|
|
||||||
#define DO_APP_FUNC(a, r, n, p) r (*n) p
|
|
||||||
#include "il2cpp-functions.h"
|
|
||||||
#undef DO_APP_FUNC
|
|
||||||
|
|
||||||
// TypeInfo pointers
|
|
||||||
#define DO_TYPEDEF(a, n) n ## __Class* n ## __TypeInfo
|
|
||||||
#include "il2cpp-type-ptr.h"
|
|
||||||
#undef DO_TYPEDEF
|
|
||||||
|
|
||||||
// Try not to include any Windows symbosl that might cause a naming conflict
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_EXTRA_LEAN
|
|
||||||
#define NOIME
|
|
||||||
#define NOWINRES
|
|
||||||
#define NOGDICAPMASKS
|
|
||||||
#define NOVIRTUALKEYCODES
|
|
||||||
#define NOWINMESSAGES
|
|
||||||
#define NOWINSTYLES
|
|
||||||
#define NOSYSMETRICS
|
|
||||||
#define NOMENUS
|
|
||||||
#define NOICONS
|
|
||||||
#define NOKEYSTATES
|
|
||||||
#define NOSYSCOMMANDS
|
|
||||||
#define NORASTEROPS
|
|
||||||
#define NOSHOWWINDOW
|
|
||||||
#define OEMRESOURCE
|
|
||||||
#define NOATOM
|
|
||||||
#define NOCLIPBOARD
|
|
||||||
#define NOCOLOR
|
|
||||||
#define NOCTLMGR
|
|
||||||
#define NODRAWTEXT
|
|
||||||
#define NOGDI
|
|
||||||
#define NOUSER
|
|
||||||
#define NOMB
|
|
||||||
#define NOMEMMGR
|
|
||||||
#define NOMETAFILE
|
|
||||||
#define NOMINMAX
|
|
||||||
#define NOMSG
|
|
||||||
#define NOOPENFILE
|
|
||||||
#define NOSCROLL
|
|
||||||
#define NOSERVICE
|
|
||||||
#define NOSOUND
|
|
||||||
#define NOTEXTMETRIC
|
|
||||||
#define NOWH
|
|
||||||
#define NOWINOFFSETS
|
|
||||||
#define NOCOMM
|
|
||||||
#define NOKANJI
|
|
||||||
#define NOHELP
|
|
||||||
#define NOPROFILER
|
|
||||||
#define NODEFERWINDOWPOS
|
|
||||||
#define NOMCX
|
|
||||||
#define NOIME
|
|
||||||
#define NOPROXYSTUB
|
|
||||||
#define NOIMAGE
|
|
||||||
#define NO
|
|
||||||
#define NOTAPE
|
|
||||||
#define ANSI_ONLY
|
|
||||||
#include "windows.h"
|
|
||||||
|
|
||||||
// Initialize everything
|
|
||||||
void init_il2cpp() {
|
|
||||||
// Get base address of IL2CPP module
|
|
||||||
uintptr_t baseAddress = (uintptr_t) GetModuleHandleW(L"GameAssembly.dll");
|
|
||||||
|
|
||||||
// Define IL2CPP API function addresses
|
|
||||||
#define DO_API(r, n, p) n = (r (*) p)(baseAddress + n ## _ptr)
|
|
||||||
#include "il2cpp-api-functions.h"
|
|
||||||
#undef DO_API
|
|
||||||
|
|
||||||
// Define function addresses
|
|
||||||
#define DO_APP_FUNC(a, r, n, p) n = (r (*) p)(baseAddress + a)
|
|
||||||
#include "il2cpp-functions.h"
|
|
||||||
#undef DO_APP_FUNC
|
|
||||||
|
|
||||||
// Define TypeInfo variables
|
|
||||||
#define DO_TYPEDEF(a, n) n ## __TypeInfo = *(n ## __Class**) (baseAddress + a);
|
|
||||||
#include "il2cpp-type-ptr.h"
|
|
||||||
#undef DO_TYPEDEF
|
|
||||||
}</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="Cpp-MainCpp" xml:space="preserve">
|
<data name="Cpp-MainCpp" xml:space="preserve">
|
||||||
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
// Custom injected code entry point
|
// Custom injected code entry point
|
||||||
|
|
||||||
#include "il2cpp-init.h"
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include "il2cpp-appdata.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
using namespace app;
|
using namespace app;
|
||||||
@@ -309,10 +233,14 @@ using namespace app;
|
|||||||
// Set the name of your log file here
|
// Set the name of your log file here
|
||||||
extern const LPCWSTR LOG_FILE = L"il2cpp-log.txt";
|
extern const LPCWSTR LOG_FILE = L"il2cpp-log.txt";
|
||||||
|
|
||||||
// Injected code entry point
|
// Custom injected code entry point
|
||||||
void Run()
|
void Run()
|
||||||
{
|
{
|
||||||
LogWrite("Startup");
|
// If you would like to write to a log file, specify the name above and use LogWrite()
|
||||||
|
// LogWrite("Startup");
|
||||||
|
|
||||||
|
// If you would like to output to a new console window, use NewConsole() to open one and redirect stdout
|
||||||
|
// NewConsole();
|
||||||
|
|
||||||
// Place your custom code here
|
// Place your custom code here
|
||||||
}</value>
|
}</value>
|
||||||
@@ -338,10 +266,44 @@ void Run()
|
|||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="framework\dllmain.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="framework\helpers.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="framework\il2cpp-init.cpp" />
|
||||||
|
<ClCompile Include="framework\pch-il2cpp.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="user\main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="appdata\il2cpp-api-functions.h" />
|
||||||
|
<ClInclude Include="appdata\il2cpp-function-ptr.h" />
|
||||||
|
<ClInclude Include="appdata\il2cpp-functions.h" />
|
||||||
|
<ClInclude Include="appdata\il2cpp-type-ptr.h" />
|
||||||
|
<ClInclude Include="appdata\il2cpp-types.h" />
|
||||||
|
<ClInclude Include="framework\helpers.h" />
|
||||||
|
<ClInclude Include="framework\il2cpp-appdata.h" />
|
||||||
|
<ClInclude Include="framework\il2cpp-init.h" />
|
||||||
|
<ClInclude Include="framework\pch-il2cpp.h" />
|
||||||
|
<ClInclude Include="user\main.h" />
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<!--<VCProjectVersion>16.0</VCProjectVersion>-->
|
<!--<VCProjectVersion>16.0</VCProjectVersion>-->
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<ProjectGuid>{%PROJECTGUID%}</ProjectGuid>
|
<ProjectGuid>{%PROJECTGUID}</ProjectGuid>
|
||||||
<RootNamespace>Il2CppDLL</RootNamespace>
|
<RootNamespace>Il2CppDLL</RootNamespace>
|
||||||
<!--<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>-->
|
<!--<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>-->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -408,7 +370,10 @@ void Run()
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch-il2cpp.h</PrecompiledHeaderFile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)appdata;$(ProjectDir)framework;$(ProjectDir)user</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -424,7 +389,10 @@ void Run()
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch-il2cpp.h</PrecompiledHeaderFile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)appdata;$(ProjectDir)framework;$(ProjectDir)user</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -440,7 +408,10 @@ void Run()
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>_DEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch-il2cpp.h</PrecompiledHeaderFile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)appdata;$(ProjectDir)framework;$(ProjectDir)user</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -456,7 +427,10 @@ void Run()
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>NDEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;IL2CPPDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch-il2cpp.h</PrecompiledHeaderFile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)appdata;$(ProjectDir)framework;$(ProjectDir)user</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -466,21 +440,6 @@ void Run()
|
|||||||
<EnableUAC>false</EnableUAC>
|
<EnableUAC>false</EnableUAC>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="dllmain.cpp" />
|
|
||||||
<ClCompile Include="helpers.cpp" />
|
|
||||||
<ClCompile Include="main.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="dllmain.h" />
|
|
||||||
<ClInclude Include="helpers.h" />
|
|
||||||
<ClInclude Include="il2cpp-api-functions.h" />
|
|
||||||
<ClInclude Include="il2cpp-init.h" />
|
|
||||||
<ClInclude Include="il2cpp-function-ptr.h" />
|
|
||||||
<ClInclude Include="il2cpp-functions.h" />
|
|
||||||
<ClInclude Include="il2cpp-type-ptr.h" />
|
|
||||||
<ClInclude Include="il2cpp-types.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
@@ -1172,4 +1131,121 @@ Global
|
|||||||
EndGlobal
|
EndGlobal
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Cpp-Il2CppAppDataH" xml:space="preserve">
|
||||||
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// IL2CPP application data
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
// Application-specific types
|
||||||
|
#include "il2cpp-types.h"
|
||||||
|
|
||||||
|
// IL2CPP API function pointers
|
||||||
|
#include "il2cpp-function-ptr.h"
|
||||||
|
|
||||||
|
// IL2CPP APIs
|
||||||
|
#define DO_API(r, n, p) extern r (*n) p
|
||||||
|
#include "il2cpp-api-functions.h"
|
||||||
|
#undef DO_API
|
||||||
|
|
||||||
|
// Application-specific functions
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) extern r (*n) p
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-functions.h"
|
||||||
|
}
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
|
||||||
|
// TypeInfo pointers
|
||||||
|
#define DO_TYPEDEF(a, n) extern n ## __Class* n ## __TypeInfo
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-type-ptr.h"
|
||||||
|
}
|
||||||
|
#undef DO_TYPEDEF</value>
|
||||||
|
</data>
|
||||||
|
<data name="Cpp-Il2CppInitCpp" xml:space="preserve">
|
||||||
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// IL2CPP application initializer
|
||||||
|
|
||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#include "il2cpp-appdata.h"
|
||||||
|
#include "il2cpp-init.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
|
// IL2CPP APIs
|
||||||
|
#define DO_API(r, n, p) r (*n) p
|
||||||
|
#include "il2cpp-api-functions.h"
|
||||||
|
#undef DO_API
|
||||||
|
|
||||||
|
// Application-specific functions
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) r (*n) p
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-functions.h"
|
||||||
|
}
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
|
||||||
|
// TypeInfo pointers
|
||||||
|
#define DO_TYPEDEF(a, n) n ## __Class* n ## __TypeInfo
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-type-ptr.h"
|
||||||
|
}
|
||||||
|
#undef DO_TYPEDEF
|
||||||
|
|
||||||
|
// IL2CPP application initializer
|
||||||
|
void init_il2cpp()
|
||||||
|
{
|
||||||
|
// Get base address of IL2CPP module
|
||||||
|
uintptr_t baseAddress = GetBaseAddress();
|
||||||
|
|
||||||
|
using namespace app;
|
||||||
|
|
||||||
|
// Define IL2CPP API function addresses
|
||||||
|
#define DO_API(r, n, p) n = (r (*) p)(baseAddress + n ## _ptr)
|
||||||
|
#include "il2cpp-api-functions.h"
|
||||||
|
#undef DO_API
|
||||||
|
|
||||||
|
// Define function addresses
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) n = (r (*) p)(baseAddress + a)
|
||||||
|
#include "il2cpp-functions.h"
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
|
||||||
|
// Define TypeInfo variables
|
||||||
|
#define DO_TYPEDEF(a, n) n ## __TypeInfo = *(n ## __Class**) (baseAddress + a);
|
||||||
|
#include "il2cpp-type-ptr.h"
|
||||||
|
#undef DO_TYPEDEF
|
||||||
|
}</value>
|
||||||
|
</data>
|
||||||
|
<data name="Cpp-MainH" xml:space="preserve">
|
||||||
|
<value>// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Custom injected code entry point
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Custom injected code entry point
|
||||||
|
void Run();</value>
|
||||||
|
</data>
|
||||||
|
<data name="Cpp-PCHIl2Cpp" xml:space="preserve">
|
||||||
|
<value>// pch.cpp: source file corresponding to the pre-compiled header
|
||||||
|
|
||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Cpp-PCHIl2CppH" xml:space="preserve">
|
||||||
|
<value>// pch.h: This is a precompiled header file.
|
||||||
|
// Files listed below are compiled only once, improving build performance for future builds.
|
||||||
|
// This also affects IntelliSense performance, including code completion and many code browsing features.
|
||||||
|
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
|
||||||
|
// Do not add files here that you will be updating frequently as this negates the performance advantage.
|
||||||
|
|
||||||
|
#ifndef PCH_IL2CPP_H
|
||||||
|
#define PCH_IL2CPP_H
|
||||||
|
|
||||||
|
// add headers that you want to pre-compile here
|
||||||
|
#include "il2cpp-appdata.h"
|
||||||
|
|
||||||
|
#endif //PCH_IL2CPP_H</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -55,7 +55,8 @@ namespace Il2CppInspector
|
|||||||
}.WriteSingleFile(testPath + $@"\test-result{nameSuffix}.cs");
|
}.WriteSingleFile(testPath + $@"\test-result{nameSuffix}.cs");
|
||||||
|
|
||||||
new IDAPythonScript(appModel)
|
new IDAPythonScript(appModel)
|
||||||
.WriteScriptToFile(testPath + $@"\test-ida-result{nameSuffix}.py", testPath + $@"\test-cpp-result{nameSuffix}\il2cpp-types.h");
|
.WriteScriptToFile(testPath + $@"\test-ida-result{nameSuffix}.py",
|
||||||
|
testPath + $@"\test-cpp-result{nameSuffix}\appdata\il2cpp-types.h");
|
||||||
|
|
||||||
new CppScaffolding(appModel)
|
new CppScaffolding(appModel)
|
||||||
.Write(testPath + $@"\test-cpp-result{nameSuffix}");
|
.Write(testPath + $@"\test-cpp-result{nameSuffix}");
|
||||||
@@ -66,7 +67,7 @@ namespace Il2CppInspector
|
|||||||
var suffix = (i > 0 ? "-" + i : "");
|
var suffix = (i > 0 ? "-" + i : "");
|
||||||
|
|
||||||
compareFiles(testPath, suffix + ".cs", $"test-result{suffix}.cs");
|
compareFiles(testPath, suffix + ".cs", $"test-result{suffix}.cs");
|
||||||
compareFiles(testPath, suffix + ".h", $@"test-cpp-result{suffix}\il2cpp-types.h");
|
compareFiles(testPath, suffix + ".h", $@"test-cpp-result{suffix}\appdata\il2cpp-types.h");
|
||||||
compareFiles(testPath, suffix + ".py", $"test-ida-result{suffix}.py");
|
compareFiles(testPath, suffix + ".py", $"test-ida-result{suffix}.py");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ $bin = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result.cs)
|
|||||||
$bin2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result-1.cs)
|
$bin2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result-1.cs)
|
||||||
$py = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-ida-result.py)
|
$py = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-ida-result.py)
|
||||||
$py2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-ida-result-1.py)
|
$py2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-ida-result-1.py)
|
||||||
$cpp = (gci "$PSScriptRoot/TestBinaries/*/test-cpp-result/*" -Filter il2cpp-types.h)
|
$cpp = (gci "$PSScriptRoot/TestBinaries/*/test-cpp-result/appdata/*" -Filter il2cpp-types.h)
|
||||||
$cpp2 = (gci "$PSScriptRoot/TestBinaries/*/test-cpp-result-1/*" -Filter il2cpp-types.h)
|
$cpp2 = (gci "$PSScriptRoot/TestBinaries/*/test-cpp-result-1/appdata/*" -Filter il2cpp-types.h)
|
||||||
|
|
||||||
# Get path to expected test results
|
# Get path to expected test results
|
||||||
$results = "$PSScriptRoot/TestExpectedResults"
|
$results = "$PSScriptRoot/TestExpectedResults"
|
||||||
|
|||||||
Reference in New Issue
Block a user