From 412e2ae6fa746583f7c94ea4186101e833b97092 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: Fri, 22 Mar 2024 03:26:36 +0800 Subject: [PATCH] Update PPSSPP.cpp --- LunaHook/engine64/PPSSPP.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/LunaHook/engine64/PPSSPP.cpp b/LunaHook/engine64/PPSSPP.cpp index 43827c4..af55bc2 100644 --- a/LunaHook/engine64/PPSSPP.cpp +++ b/LunaHook/engine64/PPSSPP.cpp @@ -137,6 +137,14 @@ void ULJS00403(hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* spl *data=address; *len=strlen((char*)address); } +bool ULJS00403_filter(void* data, size_t* len, HookParam* hp){ + std::string result = std::string((char*)data,*len); + std::regex newlinePattern(R"((\\n)+)"); + result = std::regex_replace(result, newlinePattern, " "); + std::regex pattern(R"((\\d$|^\@[a-z]+|#.*?#|\$))"); + result = std::regex_replace(result, pattern, ""); + return write_string_overwrite(data,len,result); +} // @name [ULJS00339] Amagami // @version v1.02 @@ -269,7 +277,7 @@ bool ULJM06119_filter(void* data, size_t* len, HookParam* hp){ namespace{ auto _=[](){ emfunctionhooks={ - {0x883bf34,{"Shinigami to Shoujo",ULJS00403,0,L"PCSG01282"}}, + {0x883bf34,{"Shinigami to Shoujo",ULJS00403,ULJS00403_filter,L"PCSG01282"}}, {0x0886775c,{"Amagami",ULJS00339,0,L"ULJS00339"}}, {0x8814adc,{"Sekai de Ichiban Dame na Koi",NPJH50909,NPJH50909_filter,L"NPJH50909"}}, {0x8850b2c,{"Sekai de Ichiban Dame na Koi",NPJH50909,NPJH50909_filter,L"NPJH50909"}},