为预防外挂,就让各位知道下外挂的工作原理,以便于防止这个垃圾外挂,骑士就是倒在外挂的脚下!不知道帖子发对地方了没,不对的话CT帮忙移动下板块谢谢! 
 
源代码: 
 
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) 
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long 
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) 
Private Const KEYEVENTF_KEYUP = &H2 
 
Private Const MOUSEEVENTF_LEFTDOWN = &H2 
Private Const MOUSEEVENTF_LEFTUP = &H4 
 
Const PROCESS_ALL_ACCESS = &H1F0FFF 
Const XIULI_TIME = 30 
 
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long 
 
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long 
 
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long 
 
Private Declare Function GetForegroundWindow Lib "user32" () As Long 
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer 
 
Private Const MOUSEEVENTF_RIGHTDOWN = &H8 
Private Const MOUSEEVENTF_RIGHTUP = &H10 
'Private ACCESS1 As Boolean 
'Private ACCESS_CUANQIANG 
'Private ACCESS_DAZUO 
 
Private timecount As Integer 
 
Private pHandle As Long ' 储存进程句柄 
 
Private jineng1(100) As Long ' `技能存储 
Private jineng2(100) As Long ' `技能存储 
Private jineng3(100) As Long ' `技能存储 
 
Private Sub Check1_Click() 
If Check1.Value = 1 Then 
Timer4.Enabled = True 
Else 
Timer4.Enabled = False 
End If 
End Sub 
 
''速度 
'Private Sub Check1_Click() 
''If ACCESS1 Then 
' If Check1.Value = 1 Then 
' WriteProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(16400), 2, 0& 
' ElseIf Check1.Value = 0 Then 
' WriteProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(16256), 2, 0& 
' End If 
''Else 
'' If Check1.Value = 1 Then 
'' WriteProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(16332), 2, 0& 
'' ElseIf Check1.Value = 0 Then 
'' WriteProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(16256), 2, 0& 
'' End If 
''End If 
' 
'End Sub 
 
Private Sub Check2_Click() 
'If ACCESS1 Then 
If Check2.Value = 1 Then 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 4, VarPtr(0), 2, 0& 
ElseIf Check2.Value = 0 Then 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 4, VarPtr(1), 2, 0& 
End If 
'Else 
' If Check2.Value = 1 Then 
' WriteProcessMemory pHandle, &H422F364, VarPtr(0), 2, 0& 
' ElseIf Check2.Value = 0 Then 
' WriteProcessMemory pHandle, &H422F364, VarPtr(1), 2, 0& 
' End If 
'End If 
End Sub 
 
Private Sub Check3_Click() 
'If ACCESS1 Then 
If Check3.Value = 1 Then 
' WriteProcessMemory pHandle, &H67DAF18, VarPtr(1), 2, 0& 
' WriteProcessMemory pHandle, CLng(Combo1.Text) + 1610, VarPtr(1), 2, 0& 
' Sleep 1000 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 1610, VarPtr(0), 2, 0& 
 
' Timer1.Enabled = True 
Else 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 1610, VarPtr(1), 2, 0& 
' Timer1.Enabled = False 
End If 
'Else 
' If Check3.Value = 1 Then 
'' WriteProcessMemory pHandle, &H67DAF18, VarPtr(1), 2, 0& 
' WriteProcessMemory pHandle, &H422F9AA, VarPtr(0), 2, 0& 
'' Timer1.Enabled = True 
' Else 
' WriteProcessMemory pHandle, &H422F9AA, VarPtr(1), 2, 0& 
'' Timer1.Enabled = False 
' End If 
' 
'End If 
End Sub 
 
Private Sub Check4_Click() 
If Check4.Value = 1 Then 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 1306400, VarPtr(0), 2, 0& 
 
Timer1.Enabled = True 
Else 
timecount = 0 
Timer1.Enabled = False 
End If 
End Sub 
 
Private Sub Check5_Click() 
If Check5.Value = 1 Then 
Sleep (5000) 
Timer3.Enabled = True 
Else 
Timer3.Enabled = False 
End If 
End Sub 
 
' 
'Private Sub Check5_Click() 
' If Check5.Value = 1 Then 
'' ACCESS_SUDU = &H422F3D2 
'' ACCESS_CUANQIANG = &H422F364 
'' ACCESS_DAZUO = &H422F9AA 
' ACCESS1 = False 
' Else 
'' ACCESS_SUDU = &H458F3D2 
'' ACCESS_CUANQIANG = &H458F364 
'' ACCESS_DAZUO = &H458F9AA 
' ACCESS1 = True 
' End If 
'End Sub 
 
Private Sub Check6_Click() 
If Check6.Value = 1 Then 
Timer2.Enabled = True 
Else 
Timer2.Enabled = False 
End If 
End Sub 
 
Private Sub Check7_Click() 
Dim count As Integer 
Dim addr As Long 
Dim lngCount As Long 
Dim aaa As Long 
 
count = 0 
lngCount = 0 
If Check7.Value = 1 Then 
'fire 
addr = CLng(Text1.Text) - 177 
Do While count < 21 
 
ReadProcessMemory pHandle, addr + lngCount, VarPtr(jineng1(count)), 2, 0& 
ReadProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2(count)), 2, 0& 
ReadProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3(count)), 2, 0& 
 
' 
If count = 0 Or count = 4 Or count = 12 Or count = 15 Then 
lngCount = lngCount + 384 
ElseIf count = 9 Or count = 17 Then 
lngCount = lngCount + 272 
ElseIf count = 10 Or count = 18 Then 
lngCount = lngCount + 496 
Else 
lngCount = lngCount + 352 
End If 
 
 
count = count + 1 
Loop 
'ice 
count = 30 
lngCount = 0 
addr = CLng(Text1.Text) + 7375 + 16 
Do While count < 53 
ReadProcessMemory pHandle, addr + lngCount, VarPtr(jineng1(count)), 2, 0& 
ReadProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2(count)), 2, 0& 
ReadProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3(count)), 2, 0& 
 
' 
If count = 32 Then 
lngCount = lngCount + 384 
ElseIf count = 40 Or count = 46 Or count = 49 Then 
lngCount = lngCount + 272 
ElseIf count = 34 Then 
lngCount = lngCount + 304 
ElseIf count = 37 Or count = 41 Then 
lngCount = lngCount + 416 
ElseIf count = 30 Or count = 35 Or count = 42 Or count = 44 Or count = 47 Then 
lngCount = lngCount + 496 
ElseIf count = 50 Then 
lngCount = lngCount + 528 
Else 
lngCount = lngCount + 352 
End If 
 
count = count + 1 
Loop 
 
'jineng 
count = 25 
lngCount = 0 
addr = CLng(Text1.Text) - 2753 + 16 
Do While count < 28 
ReadProcessMemory pHandle, addr + lngCount, VarPtr(jineng1(count)), 2, 0& 
ReadProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2(count)), 2, 0& 
ReadProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3(count)), 2, 0& 
 
' 
If count = 0 + 25 Then 
lngCount = lngCount + 1472 
Else 
lngCount = lngCount + 736 
End If 
 
count = count + 1 
Loop 
Option1(0).Enabled = True 
Option1(1).Enabled = True 
Option1(2).Enabled = True 
Else 
addr = CLng(Text1.Text) - 177 
Do While count < 21 
WriteProcessMemory pHandle, addr + lngCount, VarPtr(jineng1(count)), 2, 0& 
WriteProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2(count)), 2, 0& 
WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3(count)), 2, 0& 
 
' 
If count = 0 Or count = 4 Or count = 12 Or count = 15 Then 
lngCount = lngCount + 384 
ElseIf count = 9 Or count = 17 Then 
lngCount = lngCount + 272 
ElseIf count = 10 Or count = 18 Then 
lngCount = lngCount + 496 
Else 
lngCount = lngCount + 352 
End If 
 
count = count + 1 
Loop 
'ice 
count = 30 
lngCount = 0 
addr = CLng(Text1.Text) + 7375 + 16 
Do While count < 53 
WriteProcessMemory pHandle, addr + lngCount, VarPtr(jineng1(count)), 2, 0& 
WriteProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2(count)), 2, 0& 
WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3(count)), 2, 0& 
' 
If count = 32 Then 
lngCount = lngCount + 384 
ElseIf count = 40 Or count = 46 Or count = 49 Then 
lngCount = lngCount + 272 
ElseIf count = 34 Then 
lngCount = lngCount + 304 
ElseIf count = 37 Or count = 41 Then 
lngCount = lngCount + 416 
ElseIf count = 30 Or count = 35 Or count = 42 Or count = 44 Or count = 47 Then 
lngCount = lngCount + 496 
ElseIf count = 50 Then 
lngCount = lngCount + 528 
Else 
lngCount = lngCount + 352 
End If 
count = count + 1 
Loop 
'jineng 
count = 25 
lngCount = 0 
addr = CLng(Text1.Text) - 2753 + 16 
Do While count < 28 
WriteProcessMemory pHandle, addr + lngCount, VarPtr(jineng1(count)), 2, 0& 
WriteProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2(count)), 2, 0& 
WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3(count)), 2, 0& 
 
' 
If count = 0 + 25 Then 
lngCount = lngCount + 1472 
Else 
lngCount = lngCount + 736 
End If 
 
count = count + 1 
Loop 
Option1(0).Enabled = False 
Option1(1).Enabled = False 
Option1(2).Enabled = False 
Option1(0).Value = False 
Option1(1).Value = False 
Option1(2).Value = False 
End If 
 
 
End Sub 
 
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) 
 
End Sub 
 
Private Sub HScroll1_Change() 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(HScroll1.Value), 2, 0& 
End Sub 
 
Private Sub Option1_Click(Index As Integer) 
 
 
Dim count As Integer 
Dim addr As Long 
Dim lngCount As Long 
Dim jineng1Tmp As Long 
Dim jineng2Tmp As Long 
Dim jineng3Tmp As Long 
 
count = 0 
lngCount = 0 
 
Select Case Index 
Case 0 
jineng1Tmp = 0 
jineng2Tmp = jineng2(count) 
jineng3Tmp = 2 
Case 1 
jineng1Tmp = 0 
jineng2Tmp = jineng2(count) 
jineng3Tmp = 0 
Case Else 
jineng1Tmp = 0 
jineng2Tmp = 0 
jineng3Tmp = 0 
End Select 
 
 
If Check7.Value = 1 Then 
addr = CLng(Text1.Text) - 177 
Do While count < 21 
 
WriteProcessMemory pHandle, addr + lngCount, VarPtr(jineng1Tmp), 2, 0& 
WriteProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2Tmp), 2, 0& 
' If count = 12 Or count = 18 Or count = 20 Then 
' WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(2), 2, 0& 
' Else 
WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3Tmp), 2, 0& 
' End If 
' 
If count = 0 Or count = 4 Or count = 12 Or count = 15 Then 
lngCount = lngCount + 384 
ElseIf count = 9 Or count = 17 Then 
lngCount = lngCount + 272 
ElseIf count = 10 Or count = 18 Then 
lngCount = lngCount + 496 
Else 
lngCount = lngCount + 352 
End If 
 
count = count + 1 
Loop 
 
'ice 
count = 30 
lngCount = 0 
addr = CLng(Text1.Text) + 7375 + 16 
Do While count < 53 
 
WriteProcessMemory pHandle, addr + lngCount, VarPtr(jineng1Tmp), 2, 0& 
WriteProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2Tmp), 2, 0& 
' If count = 12 Or count = 18 Or count = 20 Then 
' WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(2), 2, 0& 
' Else 
WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3Tmp), 2, 0& 
' End If 
' 
If count = 32 Then 
lngCount = lngCount + 384 
ElseIf count = 40 Or count = 46 Or count = 49 Then 
lngCount = lngCount + 272 
ElseIf count = 34 Then 
lngCount = lngCount + 304 
ElseIf count = 37 Or count = 41 Then 
lngCount = lngCount + 416 
ElseIf count = 30 Or count = 35 Or count = 42 Or count = 44 Or count = 47 Then 
lngCount = lngCount + 496 
ElseIf count = 50 Then 
lngCount = lngCount + 528 
Else 
lngCount = lngCount + 352 
End If 
 
count = count + 1 
Loop 
 
'jineng 
count = 25 
lngCount = 0 
addr = CLng(Text1.Text) - 2753 + 16 
Do While count < 28 
WriteProcessMemory pHandle, addr + lngCount, VarPtr(jineng1Tmp), 2, 0& 
WriteProcessMemory pHandle, addr + 4 + lngCount, VarPtr(jineng2Tmp), 2, 0& 
' If count = 12 Or count = 18 Or count = 20 Then 
' WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(2), 2, 0& 
' Else 
WriteProcessMemory pHandle, addr + 40 + lngCount, VarPtr(jineng3Tmp), 2, 0& 
' End If 
 
' 
If count = 0 + 25 Then 
lngCount = lngCount + 1472 
Else 
lngCount = lngCount + 736 
End If 
 
count = count + 1 
Loop 
End If 
 
 
 
End Sub 
 
Private Sub Timer1_Timer() 
' WriteProcessMemory pHandle, &H67DAF18, VarPtr(1), 2, 0& 
' WriteProcessMemory pHandle, &H458F9AA, VarPtr(0), 2, 0& 
 
timecount = timecount + 1 
If timecount = XIULI_TIME Then 
 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 1306400, VarPtr(1), 2, 0& 
Sleep 3000 
SetCursorPos 881, 175 
Sleep 1000 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep 300 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Sleep 3000 
 
SetCursorPos 937, 69 
Sleep 1000 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep 300 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Sleep 3000 
 
SetCursorPos 932, 125 
Sleep 1000 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep 300 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Sleep 3000 
 
SetCursorPos 936, 227 
Sleep 1000 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep 300 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Sleep 3000 
 
SetCursorPos 936, 277 
Sleep 1000 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep 300 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Sleep 3000 
 
SetCursorPos 879, 276 
Sleep 1000 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep 300 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Sleep 3000 
SetCursorPos 200, 276 
Sleep 1000 
timecount = 0 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 1306400, VarPtr(0), 2, 0& 
End If 
 
 
End Sub 
 
Private Sub Timer2_Timer() 
Call keybd_event(vbKeyZ, 0, 0, 0) 
Sleep 100 
Call keybd_event(vbKeyZ, 0, KEYEVENTF_KEYUP, 0) 
Sleep 100 
Call keybd_event(vbKey4, 0, 0, 0) 
Sleep 100 
Call keybd_event(vbKey4, 0, KEYEVENTF_KEYUP, 0) 
Sleep 100 
End Sub 
 
 
Private Sub Timer3_Timer() 
If GetAsyncKeyState(vbKeyF12) = -32768 Then 
Check5.Value = 0 
 
Call Check5_Click 
End If 
If bbb(529, 374) = 4893390 Then 
' SetCursorPos 293, 732 
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 
Sleep (50) 
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 
Else 
' Call keybd_event(vbKeyB, 0, 0, 0) 
' Sleep 50 
' Call keybd_event(vbKeyB, 0, KEYEVENTF_KEYUP, 0) 
' Sleep 50 
mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0 
Sleep (50) 
mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0 
End If 
End Sub 
 
Private Sub Timer4_Timer() 
Dim speed As Long 
 
ReadProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(speed), 2, 0& 
If speed < 16256 Then 
WriteProcessMemory pHandle, CLng(Combo1.Text) + 114, VarPtr(HScroll1.Value), 2, 0& 
End If 
 
 
End Sub 
 
Private Sub Command1_Click() 
End 
End Sub 
 
 
Private Function bbb(X As Long, Y As Long) As Long 
Dim b As Long 
Dim c As Long 
 
b = GetForegroundWindow 
 
'b = 2359622 
c = GetDC(b) 
 
bbb = GetPixel(c, X, Y) 
 
ReleaseDC b, c 
 
End Function 
 
Private Sub Form_Load() 
Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄 
Dim pid As Long ' 储存进程标识符 
Dim str As Long ' 存储显示文本 
 
' 取得目标窗口的句柄 
hwnd = FindWindow(vbNullString, "Knight OnLine Client") 
If (hwnd = 0) Then 
Exit Sub 
End If 
' 取得进程标识符 
GetWindowThreadProcessId hwnd, pid 
 
' 取得进程句柄 
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) 
If (pHandle = 0) Then 
' Check1.Enabled = False 
Check2.Enabled = False 
Check3.Enabled = False 
End If 
 
'ACCESS_SUDU = &H458F3D2 
'ACCESS_CUANQIANG = &H458F364 
'ACCESS_DAZUO = &H458F9AA 
'ACCESS1 = True 
 
End Sub 
 
 
'Private Sub Command1_Click() 
' 
' 
' 
' 
' 
'' 声明变量 
'Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄 
'Dim pid As Long ' 储存进程标识符 
'Dim pHandle As Long ' 储存进程句柄 
'Dim str As Long ' 存储显示文本 
' 
'' 取得目标窗口的句柄 
'hwnd = FindWindow(vbNullString, "Form1") 
'If (hwnd = 0) Then 
'Exit Sub 
'End If 
'' 取得进程标识符 
'GetWindowThreadProcessId hwnd, pid 
' 
'' 取得进程句柄 
'pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) 
'If (pHandle = 0) Then Exit Sub 
' 
'' 读取内存数据 &H80D0509A改成你跟踪到的地址 
' 
'ReadProcessMemory pHandle, &H14D600, VarPtr(str), 4, 0& 
' 
'' 在文本框显示 
'txtDisplay = str 
'Text1.Text = Len(txtDisplay) 
'' 关闭进程句柄 
'CloseHandle pHandle 
'End Sub 
' 
' 
'Private Sub Command2_Click() 
' 
'' 声明变量 
'Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄 
'Dim pid As Long ' 储存进程标识符 
'Dim pHandle As Long ' 储存进程句柄 
'Dim str As Long ' 存储显示文本 
' 
'' 取得目标窗口的句柄 
'hwnd = FindWindow(vbNullString, "Knight OnLine Client") 
'If (hwnd = 0) Then 
'Exit Sub 
'End If 
'' 取得进程标识符 
'GetWindowThreadProcessId hwnd, pid 
' 
'' 取得进程句柄 
'pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) 
'If (pHandle = 0) Then Exit Sub 
' 
' 
'WriteProcessMemory pHandle, &H458F3D2, VarPtr(16320), 2, 0& 
''Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long 
' 
' 
' 
''' 读取内存数据 &H80D0509A改成你跟踪到的地址 
'' 
''ReadProcessMemory pHandle, &H14D600, VarPtr(str), 4, 0& 
'' 
''' 在文本框显示 
''txtDisplay = str 
''Text1.Text = Len(txtDisplay) 
'' 关闭进程句柄 
'CloseHandle pHandle 
' 
' 
' 
'End Sub |