diff --git a/GUI/host/textthread.cpp b/GUI/host/textthread.cpp index 8cb7b71..95ef1ac 100644 --- a/GUI/host/textthread.cpp +++ b/GUI/host/textthread.cpp @@ -49,6 +49,7 @@ void TextThread::Push(BYTE* data, int length) if (hp.type & USING_UNICODE) buffer.append((wchar_t*)data, length / sizeof(wchar_t)); else if (auto converted = Util::StringToWideString(std::string((char*)data, length), hp.codepage ? hp.codepage : Host::defaultCodepage)) buffer.append(converted.value()); else Host::AddConsoleOutput(INVALID_CODEPAGE); + if (hp.type & FULL_STRING) buffer.push_back(L'\n'); lastPushTime = GetTickCount(); if (filterRepetition) @@ -62,7 +63,7 @@ void TextThread::Push(BYTE* data, int length) } } - if (flushDelay == 0 && hp.type & USING_STRING) + if (flushDelay == 0 && hp.type & FULL_STRING) { AddSentence(std::move(buffer)); buffer.clear(); diff --git a/GUI/host/util.cpp b/GUI/host/util.cpp index f4d92ef..0922dae 100644 --- a/GUI/host/util.cpp +++ b/GUI/host/util.cpp @@ -102,11 +102,20 @@ namespace } HCode.erase(0, 1); - // [null_length<] - if ((hp.type & USING_STRING) && std::regex_search(HCode, match, std::wregex(L"^([0-9]+)<"))) + if ((hp.type & USING_STRING)) { - hp.null_length = std::stoi(match[1]); - HCode.erase(0, match[0].length()); + if (HCode[0] == L'F') + { + hp.type |= FULL_STRING; + HCode.erase(0, 1); + } + + // [null_length<] + if (std::regex_search(HCode, match, std::wregex(L"^([0-9]+)<"))) + { + hp.null_length = std::stoi(match[1]); + HCode.erase(0, match[0].length()); + } } // [N] @@ -226,6 +235,8 @@ namespace else HCode << "B"; } + if (hp.type & FULL_STRING) HCode << "F"; + if (hp.null_length != 0) HCode << hp.null_length << "<"; if (hp.type & NO_CONTEXT) HCode << "N"; diff --git a/include/const.h b/include/const.h index 1c795ea..59ab8f0 100644 --- a/include/const.h +++ b/include/const.h @@ -27,6 +27,7 @@ enum HookParamType : unsigned HOOK_EMPTY = 0x800, FIXING_SPLIT = 0x1000, DIRECT_READ = 0x2000, // /R read code instead of classic /H hook code - HOOK_ENGINE = 0x4000, - HOOK_ADDITIONAL = 0x8000, + FULL_STRING = 0x4000, + HOOK_ENGINE = 0x8000, + HOOK_ADDITIONAL = 0x10000, }; diff --git a/text.cpp b/text.cpp index d306fde..b8fa731 100644 --- a/text.cpp +++ b/text.cpp @@ -29,12 +29,13 @@ Enter read code R{S|Q|V}[null_length<][codepage#]@addr OR Enter hook code -H{A|B|W|S|Q|V}[null_length<][N][codepage#][padding+]data_offset[*deref_offset][:split_offset[*deref_offset]]@addr[:module[:func]] +H{A|B|W|S|Q|V}[F][null_length<][N][codepage#][padding+]data_offset[*deref_offset][:split_offset[*deref_offset]]@addr[:module[:func]] All numbers except codepage/null_length in hexadecimal Default codepage is 932 (Shift-JIS) but this can be changed in settings A/B: codepage char little/big endian W: UTF-16 char S/Q/V: codepage/UTF-16/UTF-8 string +F: treat strings as full lines of text N: don't use context null_length: length of null terminator used for string padding: length of padding data before string (C struct { int64_t size; char string[500]; } needs padding = 8)