Merge pull request 'unityhook: check for new entrypoint' (#15) from Yusen0727/segatools:fix/new-doorstop-entrypoint into develop

Reviewed-on: Dniel97/segatools#15
This commit is contained in:
Dniel97 2024-05-10 04:04:01 +00:00
commit d3a0faa530

View File

@ -118,9 +118,19 @@ void doorstop_invoke(void* domain) {
return; return;
} }
void *desc = mono_method_desc_new("*:Main", FALSE); // BepInEx 5.4.23 has upgrade its doorstop version,
// which forces entrypoint to Doorstop.Entrypoint:Start
void *desc = mono_method_desc_new("Doorstop.Entrypoint:Start", TRUE);
void *method = mono_method_desc_search_in_image(desc, image); void *method = mono_method_desc_search_in_image(desc, image);
if (!method) {
// Fallback to old entrypoint definition.
desc = mono_method_desc_new("*:Main", FALSE);
method = mono_method_desc_search_in_image(desc, image);
}
if (!method) { if (!method) {
dprintf("Unity: Assembly does not have a valid entrypoint.\n"); dprintf("Unity: Assembly does not have a valid entrypoint.\n");
free(dll_path); free(dll_path);