From 952236c71078a2a4092dd92d5327f20e52cc71b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 9 May 2024 15:56:34 +0800 Subject: [PATCH] typo --- LunaHook/engines/mono/impl_il2cpp.cpp | 8 ++++---- LunaHook/engines/mono/impl_mono.cpp | 11 ++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/LunaHook/engines/mono/impl_il2cpp.cpp b/LunaHook/engines/mono/impl_il2cpp.cpp index bad8a40..8b5d83f 100644 --- a/LunaHook/engines/mono/impl_il2cpp.cpp +++ b/LunaHook/engines/mono/impl_il2cpp.cpp @@ -121,15 +121,15 @@ namespace il2cpp_symbols } return maybes; } - struct AuthThread{ + struct AutoThread{ void*thread=NULL; - AuthThread(){ + AutoThread(){ if(!(il2cpp_thread_attach&&il2cpp_domain_get))return; auto il2cpp_domain=il2cpp_domain_get(); if (!il2cpp_domain) return; thread= il2cpp_thread_attach(il2cpp_domain); } - ~AuthThread(){ + ~AutoThread(){ if(!thread)return; if(!il2cpp_thread_detach)return; il2cpp_thread_detach(thread); @@ -145,7 +145,7 @@ namespace il2cpp_symbols uintptr_t get_method_pointer(const char* assemblyName, const char* namespaze, const char* klassName, const char* name, int argsCount) { - auto thread=AuthThread(); + auto thread=AutoThread(); if(!thread.thread)return NULL; auto klass=get_il2cppclass1(assemblyName,namespaze,klassName);//正向查询,assemblyName可以为空 diff --git a/LunaHook/engines/mono/impl_mono.cpp b/LunaHook/engines/mono/impl_mono.cpp index 04dd795..12f1d02 100644 --- a/LunaHook/engines/mono/impl_mono.cpp +++ b/LunaHook/engines/mono/impl_mono.cpp @@ -519,9 +519,6 @@ std::vector mono_findklassby_class(std::vector& images,c } } return maybes; -} -MonoThread* tryattach(){ - } uintptr_t getmethodofklass(MonoClass* klass,const char* name, int argsCount){ if(!(mono_class_get_method_from_name&&mono_compile_method))return NULL; @@ -530,15 +527,15 @@ uintptr_t getmethodofklass(MonoClass* klass,const char* name, int argsCount){ if(!MonoClassMethod)return NULL; return (uintptr_t)mono_compile_method((uintptr_t)MonoClassMethod); } -struct AuthThread{ +struct AutoThread{ MonoThread *thread=NULL; - AuthThread(){ + AutoThread(){ if(!(mono_get_root_domain&&mono_thread_attach))return ; auto _root=mono_get_root_domain(); if(!_root)return ; thread= mono_thread_attach(_root); } - ~AuthThread(){ + ~AutoThread(){ if(!thread)return; if(!mono_thread_detach)return; mono_thread_detach(thread); @@ -546,7 +543,7 @@ struct AuthThread{ }; } uintptr_t getmonofunctionptr(const char *_dll, const char *_namespace, const char *_class, const char *_method, int paramCount) { - auto thread=AuthThread(); + auto thread=AutoThread(); if(!thread.thread)return NULL; auto images=mono_loop_images();