@@ -312,10 +312,13 @@ class UnityResolve final {
312
312
313
313
class AssemblyLoad {
314
314
public:
315
- AssemblyLoad (const std::string path, std::string namespaze = " MonoCsharp " , std::string className = " Inject " , std::string desc = " MonoCsharp.Inject:Load() " ) {
315
+ AssemblyLoad (const std::string path, std::string namespaze = " " , std::string className = " " , std::string desc = " " ) {
316
316
if (mode_ == Mode::Mono) {
317
317
assembly = Invoke<void *>(" mono_domain_assembly_open" , pDomain, path.data ());
318
318
image = Invoke<void *>(" mono_assembly_get_image" , assembly);
319
+ if (namespaze.empty () || className.empty () || desc.empty ()) {
320
+ return ;
321
+ }
319
322
klass = Invoke<void *>(" mono_class_from_name" , image, namespaze.data (), className.data ());
320
323
void * entry_point_method_desc = Invoke<void *>(" mono_method_desc_new" , desc.data (), true );
321
324
method = Invoke<void *>(" mono_method_desc_search_in_class" , entry_point_method_desc, klass);
@@ -812,7 +815,7 @@ class UnityResolve final {
812
815
int param_count = Invoke<int >(" mono_signature_get_param_count" , signature);
813
816
names = new char * [param_count];
814
817
Invoke<void >(" mono_method_get_param_names" , method, names);
815
- } catch (const std:: exception & e ) {
818
+ } catch (... ) {
816
819
continue ;
817
820
}
818
821
@@ -830,18 +833,18 @@ class UnityResolve final {
830
833
new Type{.address = mType , .name = Invoke<const char *>(" mono_type_get_name" , mType ), .size = Invoke<int >(" mono_type_size" , mType , &t_size) }
831
834
});
832
835
}
833
- catch (const std:: exception & e ) {
836
+ catch (... ) {
834
837
835
838
}
836
839
iname++;
837
840
}
838
841
}
839
- catch (const std:: exception & e ) {
842
+ catch (... ) {
840
843
break ;
841
844
}
842
845
} while (mType );
843
846
}
844
- } catch (const std:: exception & e ) {
847
+ } catch (... ) {
845
848
return ;
846
849
}
847
850
} while (method);
0 commit comments