遥想我高中的时候曾经妄想做一个外挂,让仙剑3配上对话语音。甚至为此还联系上了配音组。我的高中的时候果然是个开挂的年代。下面代码就是我从以前的博客上翻来的。毅然全部忘记。只留作纪念。
Private Declare Function
FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String)
As Long
Private Declare Function
GetWindowThreadProcessId Lib "user32"
(ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function
OpenProcess Lib "kernel32"
(ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long,
lpBaseAddress As Any,
lpBuffer As Any,
ByVal nSize As Long,
lpNumberOfBytesWritten As Long) As Long
Private Declare Function
CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Dim c As Integer
Dim t1, t2, t3, t4, o As Long
Dim t, a As Long
Dim k As Boolean
Private Sub Form_Load()
t = 0
k = True
t4 = 0
'Open App.Path & "\1.txt" For Output As #1
'Input #1, c, b
End Sub
Private Sub Timer1_Timer()
Text1.Text = k
Text2.Text = o
Text3.Text = t4
Text4.Text = a
t1 = FindWindow(vbNullString, "PAL3--SOFTSTAR.sh")
GetWindowThreadProcessId t1, t2
t3 = OpenProcess(PROCESS_ALL_ACCESS, False, t2)
ReadProcessMemory t3, ByVal &HDBA1A8, o, 4, 0&
ReadProcessMemory t3, ByVal o + &H8, o, 4, 0&
'ReadProcessMemory t3, ByVal &H2797164, s, 4, 0&
If o = -272571691 And k Then 's - t = 1
Open App.Path & "\saygoodbye.txt" For Input As #1
'正式的应该读相应的文件此处省略
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "WaveAudio"
MMControl1.FileName = App.Path & "\f.wav"
MMControl1.Command = "Open"
MMControl1.TimeFormat = 10
k = False
End If
't = s
If (Not k) And Not (t4 = o) Then
t4 = o
MMControl1.Command = "stop"
b = a
Input #1, a
If a <> 35001 Then
If a <> 999 Then
MMControl1.From = b
MMControl1.To = a
MMControl1.Command = "play"
'Close file
'close music
Else
MMControl1.To = MMControl1.Length
MMControl1.Command = "play"
End If
End If
End If
Text5.Text = MMControl1.Position
'If re = -272571691 Or ok = 1 Then ok = 1
'If MMControl1.Position = a Then
'MMControl1.Command = "pause"
'End If
'If ok = 1 Then
'If t4 <> re Then
't4 = re
'Input #1, a
'Text1.Text = MMControl1.Position
'If a <> 0 And a <> "end" Then
'MMControl1.Command = "play"
'Else
'If k = "end" Then
'Timer1.Interval = False
'End If
'End If
'End If
'End If
End Sub
'Print #1, c; re