[Kernel] Filter thread names from guest.

This commit is contained in:
gibbed 2020-11-22 14:50:57 -06:00 committed by Rick Gibbed
parent 4f25a96928
commit 8749ca2260
1 changed files with 5 additions and 1 deletions

View File

@ -47,8 +47,12 @@ void HandleSetThreadName(pointer_t<X_EXCEPTION_RECORD> record) {
return;
}
// TODO(gibbed): cvar for thread name encoding for conversion, some games use
// SJIS and there's no way to automatically know this.
auto name =
kernel_memory()->TranslateVirtual<const char*>(thread_info->name_ptr);
std::string(kernel_memory()->TranslateVirtual<const char*>(thread_info->name_ptr));
std::replace_if(
name.begin(), name.end(), [](auto c) { return c < 32 || c > 127; }, '?');
object_ref<XThread> thread;
if (thread_info->thread_id == -1) {