我用反射器反编译了一个 vb.net 应用程序
所有字符串都使用此方法加密:
Public Shared Function smethod_0(ByVal string_0 As String) As String
Dim length As Integer = string_0.Length
Dim chArray As Char() = New Char(length - 1) {}
Dim i As Integer
For i = 0 To chArray.Length - 1
Dim ch As Char = string_0.Chars(i)
Dim num3 As Byte = CByte((ch Xor (length - i)))
Dim num4 As Byte = CByte(((ch >> 8) Xor i))
chArray(i) = DirectCast(((num4 << 8) Or num3), Char)
Next i
Return String.Intern(New String(chArray))
End Function
此方法接收如下输入字符串:
"j" & ChrW(354) & ChrW(623) & ChrW(868)
并返回一个可读的字符串。
如何在 vb.net 或 c# 中转换此代码?
Vb.net 编译器抱怨此代码不正确,因为未为 char/int 组合定义 xor。