mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-07-17 15:32:24 -07:00
Implement binary data escaping
This commit is contained in:
@@ -283,12 +283,12 @@ namespace Ryujinx.HLE.Debugger
|
|||||||
|
|
||||||
if (len >= (ulong)data.Length - addr)
|
if (len >= (ulong)data.Length - addr)
|
||||||
{
|
{
|
||||||
Reply("l" + data.Substring((int)addr));
|
Reply("l" + ToBinaryFormat(data.Substring((int)addr)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Reply("m" + data.Substring((int)addr, (int)len));
|
Reply("m" + ToBinaryFormat(data.Substring((int)addr, (int)len)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -624,6 +624,25 @@ namespace Ryujinx.HLE.Debugger
|
|||||||
return ToHex(Encoding.ASCII.GetBytes(str));
|
return ToHex(Encoding.ASCII.GetBytes(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string ToBinaryFormat(byte[] bytes)
|
||||||
|
{
|
||||||
|
return string.Join("", bytes.Select(x =>
|
||||||
|
x switch
|
||||||
|
{
|
||||||
|
(byte)'#' => "}\x03",
|
||||||
|
(byte)'$' => "}\x04",
|
||||||
|
(byte)'*' => "}\x0a",
|
||||||
|
(byte)'}' => "}\x5d",
|
||||||
|
_ => Convert.ToChar(x).ToString(),
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private string ToBinaryFormat(string str)
|
||||||
|
{
|
||||||
|
return ToBinaryFormat(Encoding.ASCII.GetBytes(str));
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
|
Reference in New Issue
Block a user