This commit is contained in:
恍兮惚兮 2024-09-27 15:28:18 +08:00
parent b659dbc6a0
commit cd3d8c4924
2 changed files with 6 additions and 3 deletions

View File

@ -221,7 +221,7 @@ void TextHook::parsenewlineseperator(void *data, size_t *len)
if (hp.type & CODEC_UTF16) 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) else if (hp.type & CODEC_UTF32)
return; return;
@ -231,7 +231,7 @@ void TextHook::parsenewlineseperator(void *data, size_t *len)
std::string newlineseperatorA; std::string newlineseperatorA;
for (int i = 0; i < wcslen(hp.newlineseperator); i++) for (int i = 0; i < wcslen(hp.newlineseperator); i++)
newlineseperatorA += (char)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) UINT64 texthash(void *data, size_t len)

View File

@ -1390,12 +1390,14 @@ namespace Private {
std::wstring ConvertToFullWidth(const std::wstring& str) { std::wstring ConvertToFullWidth(const std::wstring& str) {
std::wstring fullWidthStr; std::wstring fullWidthStr;
wchar_t last=0;
for (wchar_t c : str) { for (wchar_t c : str) {
if (c >= 32 && c <= 126) { if (c >= 32 && c <= 126 && c!=L'\\' && last!=L'\\') {
fullWidthStr += static_cast<wchar_t>(c + 65248); fullWidthStr += static_cast<wchar_t>(c + 65248);
} else { } else {
fullWidthStr += c; fullWidthStr += c;
} }
last=c;
} }
return fullWidthStr; return fullWidthStr;
} }
@ -1532,6 +1534,7 @@ bool attach(ULONG startAddress, ULONG stopAddress)
hp.type = EMBED_ABLE|CODEC_UTF8; hp.type = EMBED_ABLE|CODEC_UTF8;
hp.hook_before=hookBeforez; hp.hook_before=hookBeforez;
hp.hook_after=after; hp.hook_after=after;
hp.newlineseperator=L"\\n";
succ|=NewHook(hp, "EmbedKrkrZ"); succ|=NewHook(hp, "EmbedKrkrZ");
// return true; // return true;
} }