C++: Add il2cpp_thread_attach in Run()

This commit is contained in:
Katy Coe
2021-01-08 22:11:25 +01:00
parent 8da20a4afa
commit 370d15e8d9
2 changed files with 5 additions and 1 deletions

View File

@@ -238,7 +238,8 @@ namespace Il2CppInspector.Properties {
///// Custom injected code entry point ///// Custom injected code entry point
///void Run() ///void Run()
///{ ///{
/// // If you would like to write to a log file, specify the name above and u [rest of string was truncated]";. /// // Initialize thread data - DO NOT REMOVE
/// il2cpp_thread_attach(il2cpp [rest of string was truncated]";.
/// </summary> /// </summary>
internal static string Cpp_MainCpp { internal static string Cpp_MainCpp {
get { get {

View File

@@ -273,6 +273,9 @@ extern const LPCWSTR LOG_FILE = L"il2cpp-log.txt";
// Custom injected code entry point // Custom injected code entry point
void Run() void Run()
{ {
// Initialize thread data - DO NOT REMOVE
il2cpp_thread_attach(il2cpp_domain_get());
// If you would like to write to a log file, specify the name above and use il2cppi_log_write() // If you would like to write to a log file, specify the name above and use il2cppi_log_write()
// il2cppi_log_write("Startup"); // il2cppi_log_write("Startup");