有没有人知道如何在NSIS中执行按位异或命令?
以下是我想在NSIS中实现的C#代码:
private string CalculateChecksum(byte[] dataToCalculate)
{ int intChecksum1 = 0;
int intChecksum2 = 0;
if(strBase64ChrsArray== null)
{
strBase64ChrsArray = strBase64Chrs.Split(' ');
}
for (int i = 0; i < dataToCalculate.Length - 3; i++)
{
intChecksum1 ^= dataToCalculate[i];
}
for (int i = 1; i < dataToCalculate.Length - 2; i++)
{
intChecksum2 ^= dataToCalculate[i];
}
return strBase64ChrsArray.ElementAt((byte)intChecksum1) + strBase64ChrsArray.ElementAt((byte)intChecksum2);
}
答案 0 :(得分:0)
IntOp $0 1234 ^ 5678
DetailPrint $0