📄 金庸小外挂代码.txt
字号:
最近金庸又火了....自己开发多舒服.....呵呵.
学易语言的朋友也可以很快的做出很棒的外挂滴....
模块部分...
Option Explicit
'需要用的API函数声明:
Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetWindowThreadProcessId Lib "User32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Declare Function UnhookWindowsHookEx Lib "User32" (ByVal hHook As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function GetCurrentProcess Lib "kernel32" () As Long
Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function CallWindowProc Lib "User32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function RegisterHotKey Lib "User32" (ByVal hwnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Declare Function UnregisterHotKey Lib "User32" (ByVal hwnd As Long, ByVal id As Long) As Long
****************************
窗体部分....
Dim DiZhi As Long
Dim Dizhi1 As Long
Dim x As Form2
Dim CKJB As String
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vkey As Long) As Integer
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Function ncnr(lpADDress As Long) As Integer
' 声明一些需要的变量
Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄
Dim pid As Long ' 储存进程标识符( Process Id )
Dim pHandle As Long ' 储存进程句柄
hwnd = FindWindow(vbNullString, CKJB)
' 取得进程标识符
GetWindowThreadProcessId hwnd, pid
' 使用进程标识符取得进程句柄
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
' 在内存地址中读取数据
ReadProcessMemory pHandle, lpADDress, ByVal VarPtr(ncnr), 4, 0&
' 关闭进程句柄
CloseHandle hProcess
End Function
Private Function xr(lpADDress As Long, Zhi As Long) As Integer
' 声明一些需要的变量
Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄
Dim pid As Long ' 储存进程标识符( Process Id )
Dim pHandle As Long ' 储存进程句柄
hwnd = FindWindow(vbNullString, CKJB)
' 取得进程标识符
GetWindowThreadProcessId hwnd, pid
' 使用进程标识符取得进程句柄
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
WriteProcessMemory pHandle, lpADDress, Zhi, 1, 0&
' 关闭进程句柄
CloseHandle hProcess
End Function
****************************
Private Function xr(lpADDress As Long, Zhi As Long) As Integer
' 声明一些需要的变量
Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄
Dim pid As Long ' 储存进程标识符( Process Id )
Dim pHandle As Long ' 储存进程句柄
hwnd = FindWindow(vbNullString, CKJB)
' 取得进程标识符
GetWindowThreadProcessId hwnd, pid
' 使用进程标识符取得进程句柄
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
WriteProcessMemory pHandle, lpADDress, Zhi, 1, 0&
' 关闭进程句柄
CloseHandle hProcess
End Function
Private Sub Check1_Click()
DiZhi = &H6E4E96
If Check1.value = Checked Then
xr DiZhi, &H80
xr DiZhi + 1, &H3E
Label1.Caption = "快速行走启用"
Else
xr DiZhi, &HFA
xr DiZhi + 1, &H44
Label1.Caption = "快速行走关闭"
End If
End Sub
Private Sub Check2_Click()
DiZhi = &H8AD2F3
Dizhi1 = &H8FC5D4
If Check2.value = Checked Then
xr DiZhi, &H0
xr DiZhi + 1, &H0
xr Dizhi1, &H0
xr Dizhi1 + 1, &H0
Label1.Caption = "战斗快退启用"
Else
xr DiZhi, &H98
xr DiZhi + 1, &H9A
xr Dizhi1, &H98
xr Dizhi1 + 1, &H3A
Label1.Caption = "战斗快退关闭"
End If
End Sub
Private Sub Check3_Click()
DiZhi = &H90064C
Dizhi1 = &H9005DC
If Check3.value = Checked Then
xr DiZhi, &HB0 + FE
xr DiZhi, &HB0 + FE
Label1.Caption = "快速聚气启用"
Else
xr DiZhi, &H3 + C2
xr DiZhi, &H3 + C2
Label1.Caption = "取消快速聚气"
End If
End Sub
Private Sub Check4_Click() '任意逃跑
DiZhi = &H8F39FD
Dizhi1 = &H93B38D
If Check4.value = Checked Then
xr DiZhi, &H90 + 90
xr Dizhi1, &H90 + 90 + 90 + 90 + 90 + 90
Label1.Caption = "任意逃跑启用"
Else
xr DiZhi, &H7C + D
xr Dizhi1, &HF + 84 + 87 + 0 + 0 + 0
Label1.Caption = "任意逃跑取消"
End If
End Sub
Private Sub Check5_Click()
DiZhi = &H67BF0E
If Check5.value = Checked Then
xr DiZhi, &H0 + 0
Label1.Caption = "快速修炼起用"
Else
xr DiZhi, &H88 + 13
Label1.Caption = "快速修炼关闭"
End If
End Sub
Private Sub Check6_Click()
DiZhi = &H6D5C04
If Check6.value = Checked Then
xr DiZhi, &H90 + 90 + 90 + 90 + 90 + 90
xr DiZhi + 30, &HEB
xr DiZhi + 56, &HEB
xr DiZhi + 79, &H90 + 90
xr DiZhi + 89, &H90 + 90
Label1.Caption = "穿越起用"
Else
xr DiZhi, &HF
xr DiZhi, &H8E + CA + 0 + 0 + 0
xr DiZhi + 30, &H72
xr DiZhi + 56, &H72
xr DiZhi + 79, &H75
xr DiZhi + 80, &H7F
xr DiZhi + 89, &H75 + 75
Label1.Caption = "穿越取消"
End If
End Sub
Private Sub Check7_Click()
DiZhi = &H8E6999
Dizhi1 = &H8FE6F7
If Check7.value = Checked Then
xr DiZhi, &HB0 + 9 + 90 + 90 + 90 + 90
xr Dizhi1, &H7
Label1.Caption = "起用快招"
Else
xr DiZhi, &HB8A + 86 + &H2C + 3 + 0 + 0
xr Dizhi1, &H8
Label1.Caption = "取消快招"
End If
End Sub
Private Sub Check8_Click()
DiZhi = &H67C103
If Check8.value = Checked Then
xr DiZhi, &H90 + 90 + 90 + 90 + 90
xr DiZhi + &HC, &H90 + 90 + 90 + 90 + 90
Label1.Caption = "固定NPC"
Else
xr DiZhi, &HE8
xr DiZhi + 1, &H7B + C7 + 6 + 0
xr DiZhi + &HC, &HE8
xr DiZhi + &HD, &H9C
xr DiZhi + HE, &H6B + 9 + 0
Label1.Caption = "取消固定NPC"
End If
End Sub
Private Sub Check9_Click()
If Text1.Text = "" Then
Label1.Caption = "请输入ID"
Exit Sub
End If
If Check9.value = Checked Then
CKJB = "loginp" + Text1.Text
Label1.Caption = CKJB
Else
cbjb = "JYOnline"
End If
End Sub
Private Sub Form_Load()
CKJB = "JYOnlie"
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnhookWindowsHookEx pid
Dim ret As Long
'取消Message的截取,使之送往原来的windows程序
ret = SetWindowLong(Me.hwnd, GWL_WNDPROC, preWinProc)
Call UnregisterHotKey(Me.hwnd, uVirtKey)
End Sub
Private Sub Label4_Click()
End Sub
Private Sub Option1_Click()
DiZhi = &H878E8A
xr DiZhi, &H0 + 69 + 0 + 0 + 69 + 0
End Sub
Private Sub Option2_Click()
DiZhi = &H878E8A
xr DiZhi, &H0 + 0 + 0 + 0 + 0 + 0
End Sub
Private Sub Option3_Click()
DiZhi = &H878E8A
xr DiZhi, &H48 + 44 + 0 + 0 + 48 + 42
End Sub
Private Sub Timer1_Timer()
Dim hwnd As Long
hwnd = FindWindow(vbNullString, CKJB)
If hwnd = 0 Then
Label11.Caption = "游戏未加载"
Timer1.Enabled = True
Exit Sub
End If
If hwnd <> 0 Then
Label11.Caption = "游戏已加载"
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
DiZhi = &HA6E3D74
Dim NowHp As Long
Dim HP As Integer
NowHp = ncnr(DiZhi)
HP = 30000
Label8.Caption = Str(NowHp)
'If Check9.value = Checked And hwnd <> 0 And NowHp < HP Then
'SendKeys "f9"
'End If
End Sub
Function Http(Web)
HyperJump = ShellExecute(0&, vbNullString, Web, vbNullString, vbNullString, vbNormalFocus)
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -