From ffb7b7df8dc85b0ec3c322d8a940688f7494a174 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: Sat, 14 Sep 2024 11:09:51 +0800 Subject: [PATCH] unity --- LunaHook/main.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/LunaHook/main.cc b/LunaHook/main.cc index 2ccb052..4ce5718 100644 --- a/LunaHook/main.cc +++ b/LunaHook/main.cc @@ -260,7 +260,16 @@ bool NewHook(HookParam hp, LPCSTR name) ConsoleOutput("invalid"); return false; } - hp.address = tryfindmonoil2cpp(spls[0].c_str(), spls[1].c_str(), spls[2].c_str(), spls[3].c_str(), std::stoi(spls[4])); + int argcount; + try + { + argcount = std::stoi(spls[4]); + } + catch (...) + { + argcount = -1; + } + hp.address = tryfindmonoil2cpp(spls[0].c_str(), spls[1].c_str(), spls[2].c_str(), spls[3].c_str(), argcount); if (!hp.address) {