Skip to content

Commit ff54aa6

Browse files
committed
Fixed wrong size calculation.
1 parent f0e6dbd commit ff54aa6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ReClass.NET/MemoryScanner/ScanResult.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics.Contracts;
33
using System.Linq;
44
using System.Text;
5+
using ReClassNET.Extensions;
56

67
namespace ReClassNET.MemoryScanner
78
{
@@ -260,7 +261,7 @@ public class StringScanResult : ScanResult, IEquatable<StringScanResult>
260261
{
261262
public override ScanValueType ValueType => ScanValueType.String;
262263

263-
public override int ValueSize => Value.Length;
264+
public override int ValueSize => Value.Length * Encoding.GuessByteCountPerChar();
264265

265266
public string Value { get; }
266267

@@ -298,6 +299,8 @@ public override int GetHashCode()
298299

299300
public class RegexStringScanResult : StringScanResult
300301
{
302+
public override ScanValueType ValueType => ScanValueType.Regex;
303+
301304
public RegexStringScanResult(string value, Encoding encoding)
302305
: base(value, encoding)
303306
{

0 commit comments

Comments
 (0)