求大神帮忙修改一下vb代码运行不了
方法如下:在文件起始位置偏移+12处保存有一个指针,指向区服信息的开始位置,长度为2字节,读出这个指针,然后定位到该指针指向的位置处,以后每读一个字节就判断该字节的值是奇数还是偶数,如果是奇数则将该字节减1,是偶数则将该字节加1,最后把这段数据保存到一个文件里面用记事本打开就能看见了.
VB解密程序段如下:
Dim fh1 As Integer
Dim fh2 As Integer
Dim fn1 As String
Dim fn2 As String
Dim n As Byte
Dim lp As Integer
On Error GoTo Err
fn1 = Dir1.Path + "\group.dat" + vbNullString
fn2 = App.Path + "\group.txt" + vbNullString
fh1 = FreeFile()
Open fn1 For Binary Access Read As fh1
fh2 = FreeFile()
Open fn2 For Binary Access Write As fh2
Seek fh1, 13
Get fh1, , lp
Seek fh1, lp + 1
Do While Not EOF(fh1)
Get fh1, , n
If (n Mod 2) = 1 Then
n = n - 1
Else
n = n + 1
End If
Put fh2, , n
Loop
Close fh1
Close fh2
MsgBox "解密成功!"
Exit Sub
Err:
MsgBox "解密时出错(" + CStr(Err.Number) + ":" + Err.Description + ")"
运行不了 不知道哪里问题