fix: fix incorrect assert in DefaultConstEncryptor::ObfuscateString

before-split
walon 2025-05-19 12:53:35 +08:00
parent bd6c70072f
commit 6306a5604a
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ namespace Obfuz.ObfusPasses.ConstEncrypt
int salt = GenerateSalt(random); int salt = GenerateSalt(random);
int stringByteLength = Encoding.UTF8.GetByteCount(value); int stringByteLength = Encoding.UTF8.GetByteCount(value);
byte[] encryptedValue = encryptionScope.encryptor.Encrypt(value, ops, salt); byte[] encryptedValue = encryptionScope.encryptor.Encrypt(value, ops, salt);
Assert.IsTrue(encryptedValue.Length % 4 == 0); Assert.AreEqual(stringByteLength, encryptedValue.Length);
RvaData rvaData = _rvaDataAllocator.Allocate(method.Module, encryptedValue); RvaData rvaData = _rvaDataAllocator.Allocate(method.Module, encryptedValue);
DefaultMetadataImporter importer = GetModuleMetadataImporter(method); DefaultMetadataImporter importer = GetModuleMetadataImporter(method);