diff --git a/LunaHook/embed_util.cc b/LunaHook/embed_util.cc index 3feeca1..75d2c4d 100644 --- a/LunaHook/embed_util.cc +++ b/LunaHook/embed_util.cc @@ -221,7 +221,7 @@ void TextHook::parsenewlineseperator(void *data, size_t *len) if (hp.type & CODEC_UTF16) { - StringReplacer((wchar_t *)data, len, hp.newlineseperator, wcslen(hp.newlineseperator), L"\n", 1); + StringCharReplacer((wchar_t *)data, len, hp.newlineseperator, wcslen(hp.newlineseperator), L'\n'); } else if (hp.type & CODEC_UTF32) return; @@ -231,7 +231,7 @@ void TextHook::parsenewlineseperator(void *data, size_t *len) std::string newlineseperatorA; for (int i = 0; i < wcslen(hp.newlineseperator); i++) newlineseperatorA += (char)hp.newlineseperator[i]; - StringReplacer((char *)data, len, newlineseperatorA.c_str(), newlineseperatorA.size(), "\n", 1); + StringCharReplacer((char *)data, len, newlineseperatorA.c_str(), newlineseperatorA.size(), '\n'); } } UINT64 texthash(void *data, size_t len) diff --git a/LunaHook/engine32/KiriKiri.cpp b/LunaHook/engine32/KiriKiri.cpp index 7c63778..8b8fc0c 100644 --- a/LunaHook/engine32/KiriKiri.cpp +++ b/LunaHook/engine32/KiriKiri.cpp @@ -1390,12 +1390,14 @@ namespace Private { std::wstring ConvertToFullWidth(const std::wstring& str) { std::wstring fullWidthStr; + wchar_t last=0; for (wchar_t c : str) { - if (c >= 32 && c <= 126) { + if (c >= 32 && c <= 126 && c!=L'\\' && last!=L'\\') { fullWidthStr += static_cast(c + 65248); } else { fullWidthStr += c; } + last=c; } return fullWidthStr; } @@ -1532,6 +1534,7 @@ bool attach(ULONG startAddress, ULONG stopAddress) hp.type = EMBED_ABLE|CODEC_UTF8; hp.hook_before=hookBeforez; hp.hook_after=after; + hp.newlineseperator=L"\\n"; succ|=NewHook(hp, "EmbedKrkrZ"); // return true; }