飞艳小屋

程序--人生--哲学___________________欢迎艳儿的加入

BlogJava 首页 新随笔 联系 聚合 管理
  52 Posts :: 175 Stories :: 107 Comments :: 0 Trackbacks
VB 从零开始编外挂(一)
需要VB API函数:
FindWindow ←寻找窗口列表中第一个符合指定条件的顶级窗口
GetWindowThreadProcessId ←获取与指定窗口关联在一起的一个进程和线程标识符
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
FindWindow

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

GetWindowThreadProcessId

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long)
As Long
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:Label、Timer
-------------------------------------------------------------------------------------------------------------------------------------------------------- 自定义函数:
Dim hwnd As Long
-------------------------------------------------------------------------------------------------------------------------------------------------------- 源代码:
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 Sub Timer1_Timer()
Dim hwnd As Long'' 储存 FindWindow 函数返回的句柄
hwnd = FindWindow(vbNullString, "Windows Media Player")'' 取得进程标识符
''只要把Windows Media Player换成游戏的名称就可了!
If hwnd = 0 Then
Label1.Caption = "游戏未运行"
Else
Label1.Caption = "游戏已运行"
End If
End Sub

VB 从零开始编外挂(二)
相信大家,在制作游戏外挂的时候,都会用到FPE、金山游侠、GE修改器、Game Master8.0等等这些软件,但是如今的网络游戏基本上都加了NP,下面来了解一下NP。知己知彼,百战不殆嘛!
什么是nProtect?
nProtect是设计用于保护个人电脑终端不被病毒和黑客程序感染的新概念的基于网络的反黑客和反病毒的工具。他帮助确保所有输入个人电脑终端的信息在网络上不落入黑客手中。在最终用户在执行电子贸易时,可以通过将nProtect配置在那些提供电子商务、进口贸易,电子贸易的金融机构的网站上,来提高安全等级。nProtect怎样工作?nProtect是一种基于服务器端的解决方案并且当那些需要保护的任何网络应用被运行时而自动启动。nProtect被载入内存,所以最终用户不需要安装任何应用程序,只要nProtect启动,就开始拒绝黑客工具和病毒的入侵!
--------------------------------------------------------------------------------------------------------------------------------------------------------
下面介绍它如何工作:
用户登陆时nProtect自动启动。
浏览器确认和自动安装安全模块到用户的个人电脑。扫描黑客工具和病毒通知用户目前的安全状态如果有黑客工具和病毒尝试删除在被入侵时端驻留内存来锁定黑客工具直到电脑或者nProtect关闭。
可恶的韩国人,把这个加进了网络游戏。我只能说:“呸!”
--------------------------------------------------------------------------------------------------------------------------------------------------------
下面讲讲躲过NP的扫描的几个方法:
一、FPE篇
台湾人开发的东西,哎。出名了的,没办法谁叫它这么好呢!
1.先装一个FPE把,呵呵←这个是废话!
2.不要把安装程序删除,按照:开始→运行→regedit→HEKY_LOCAL_MACHINE→SOFTWARE
→jaw→FPE 打开!(问:有什么用? 答:修改呀!)
3.运行FPE,然后在搜索里面输入 ''jaw''(一定要家'''')一般是6个地址,然后全部都选中输入:
313131c313131(意思就是111,两边多输入31就是1111!)不要关FPE!(关了就完了!)
4.修改注册表,把注册表里面的jaw、FPE(FPE的是全改)关闭FPE出现对话框。(什么鸟语不认识!呵呵)
5.将现在FPE的文件夹修改为1112000(原来是FPE2000撒),把FPE.exe修改为111.exe
6.然后重新安装一次FPE也把那个DLL文件复制到你修改过的FPE文件目录下!(呵呵!)
7.开FPE进游戏里面乱来拉!哈哈
--------------------------------------------------------------------------------------------------------------------------------------------------------



二、任务管理器篇
比尔·盖茨那崽儿设计的东西,还可以在这上面派上用场!(问:是什么东西?答WINDOWS自带的撒!呵呵!)
1.首先用快捷键Ctrl+Alt+Delete/.打开任务管理器
2.查看进程,一般垃圾点的网络游戏会出现多的进程。你就杀了就行了!
3.没有多的进程怎么办?BIN这个是大多数网络游戏都有的把,官方的登陆器和私服的登陆器一样的,都是调用BIN进入游戏。登陆器打开后,更新完毕。点击运行游戏,间隔几秒杀掉登陆器的进程(这个要看你自己的计算机配置如何了,可能是2秒、可能是10秒!反正不超过15秒)这样就可以闭屏NP拉!
呵呵又可以乱来了!
--------------------------------------------------------------------------------------------------------------------------------------------------------


三、直接篇
直接篇说白了就不用任何东西!怎么做?跟着我眼镜来撒!
《封神榜》知道把?(答:不知道!反答:去死!)它的保护是有的,官方都已经公布了
但是有些人说《封神榜》没NP,(注意:NP现在就是保护的代名词了!)别听那些人的!
首先,运行登陆器(更新的那个)进入游戏。关闭用登陆器进入的游戏马上运行Game.exe
呵呵,没NP了。FPE等东西可以乱来了。魔法叠加、免负重等等都可以实现!
还有一种就是DAT文件或者BIN文件直接修改为EXE。呵呵!
--------------------------------------------------------------------------------------------------------------------------------------------------------


四、编程篇(VB、VC、DELPHI等等!)
怎么办呢?呵呵,我不懂怎么编VC和DELPHI的。***我就喜欢VB怎么着?
VB可以简单的实现虚拟nProtect的消息发送。具体的就不说了!
一句话虚拟nProtect消息(你不等于没说嘛!)-_-!呵呵这个嘛......!
代码就不写了,麻烦。就像用WPE这些发包一样的原理

VB 从零开始编外挂(三)
躲避了NP的扫描现在就可以模拟了!
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VB API函数:
keybd_event ←函数模拟了键盘行动
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
keybd_event

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:Timer(interval不为空)
--------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Timer1_Timer()
Call keybd_event(82, 0, 0, 0) ''模拟按下"R"键
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------------
其它模拟:
方法一:
AppActivate sTitle
SendKeys "5"
方法二:
AppActivate sTitle
SendKeys vbKey5
方法三:
SendMessage Hwnd, WM_KEYDOWN, vbKey5, 0&
SendMessage Hwnd, WM_KEYUP, vbKey5, 0&
方法四:
AppActivate sTitle
keybd_event 53, 0, 0, 0
keybd_event 53, 0, KEYEVENTF_KEYUP, 0
方法五:
PostMessage lHwnd, WM_KEYDOWN, vbKey5, 0&
PostMessage lHwnd, WM_KEYUP, vbKey5, 0&
VB 从零开始编外挂(四)
添加快捷键
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VB API函数:
GetAsyncKeyState ←判断函数调用时指定虚拟键的状态
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
GetAsyncKeyState

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Function MyHotKey(vKeyCode) As Boolean
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:Timer(interval不为空)
--------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Function MyHotKey(vKeyCode) As Boolean
MyHotKey = (GetAsyncKeyState(vKeyCode) < 0)
End Function
''然后在循环中或Timer的Timer事件中检测:
Private Sub Timer1_Timer()
If MyHotKey(vbKeyA) And vbKeyControl Then ''ctrl+A
End ''关闭
End If
''其中vbkeyA是键盘″A″的常数,其他键可按F1查得。
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------------
其它方法:
比如按下"ctrl+A"就退出!
''可以设置Form的KeyPreview属性为True,然后在Form_KeyDown事件中添加代码:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Asc("A") And Shift = vbCtrlMask Then unload me ''如果ctrl+A键被按下就退出
End Sub
VB 从零开始编外挂(五)
前边谈了模拟键盘,下面说说模拟鼠标。
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VB API函数:
mouse_event ←模拟一次鼠标事件
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
mouse_event

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 )
--------------------------------------------------------------------------------------------------------------------------------------------------------
定义变量:
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
--------------------------------------------------------------------------------------------------------------------------------------------------------
MOUSEEVENTF_LEFTDOWN''鼠标左键按下
MOUSEEVENTF_LEFTUP''鼠标松开
MOUSEEVENTF_RIGHTDOWN ''鼠标右键按下
MOUSEEVENTF_RIGHTUP''鼠标右键松开
--------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
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 )
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
''这里是 鼠标左键按下 和松开两个事件的组合即一次单击
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
''模拟鼠标右键单击事件
mouse_event MOUSEEVENTF_RIGHTDOWN Or MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
''两次连续的鼠标左键单击事件 构成一次鼠标双击事件
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

VB 从零开始编外挂(六)

文章类别:VB专区    发表日期:2005-08-21

--------------------------------------------------------------------------------------------------------------------------------------------------------
应用实战
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VB API函数:
FindWindow
GetWindowThreadProcessId
OpenProcess
ReadProcessMemory
CloseHandle
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
FindWindow

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( ByVal lpClassName As String , ByVal lpWindowName As String ) As Long

GetWindowThreadProcessId

Private Declare Function GetWindowThreadProcessId Lib "user32" ( ByVal hwnd As Long , lpdwProcessId As Long )
As Long

OpenProcess

Private Declare Function OpenProcess Lib "kernel32" ( ByVal dwDesiredAccess As Long , ByVal bInheritHandle As Long , ByVal dwProcessId As Long ) As Long

ReadProcessMemory

Private 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

CloseHandle

Private Declare Function CloseHandle Lib "kernel32" ( ByVal hObject As Long ) As Long

GetCurrentProcess

Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件: Label 、 Timer(interval不为空)、Text
--------------------------------------------------------------------------------------------------------------------------------------------------------
定义函数:
Dim SetHp As Integer ' 定义设定的体力值
Dim SetMp As Integer ' 定义设定的魔法值
Dim NowHp As Long ' 定义目前的体力值
Dim NowMp As Long ' 定义目前的魔法值
Dim MaxHp As Long ' 定义角色的最高体力值
Dim MaxMp As Long ' 定义角色的最高魔法值
Dim DiZhi As Long '定义内存地址函数
Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄
--------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
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 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
Private Declare Function CloseHandle Lib "kernel32" ( ByVal hObject As Long ) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Dim SetHp As Integer ' 定义设定的体力值
Dim SetMp As Integer ' 定义设定的魔法值
Dim NowHp As Long ' 定义目前的体力值
Dim NowMp As Long ' 定义目前的魔法值
Dim MaxHp As Long ' 定义角色的最高体力值
Dim MaxMp As Long ' 定义角色的最高魔法值
Dim DiZhi 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, "封神榜·网络版")
' 取得进程标识符
GetWindowThreadProcessId hwnd, pid
' 使用进程标识符取得进程句柄
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
' 在内存地址中读取数据
ReadProcessMemory pHandle, lpADDress, ByVal VarPtr(ncnr), 4, 0&
' 关闭进程句柄
CloseHandle hProcess
End Function
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const SYNCHRONIZE = &H100000
Const SPECIFIC_RIGHTS_ALL = &HFFFF
Const STANDARD_RIGHTS_ALL = &H1F0000
Const PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &HFFF
Const PROCESS_VM_OPERATION = &H8&
Const PROCESS_VM_READ = &H10&
Const PROCESS_VM_WRITE = &H20&

Private Sub Form_Load()
' 体力:07F68F3 这里替换你所搜索到的地址 魔法:07F6860 同前
DiZhi = &H 07F68F3
Timer1.Enabled = True
Timer2.Enabled = False
Timer3.Enabled = False
End Sub

Private Sub Timer1_Timer()
Dim hwnd As Long
hwnd = FindWindow(vbNullString, "封神榜·网络版")

If hwnd = 0 Then
Label12.Caption = "游戏未加载"
Timer1.Enabled = True
Timer2.Enabled = False
Timer3.Enabled = False
Exit Sub
End If

Label12.Caption = "游戏已加载"
SetHp = Text1.Text ' 获取设定的体力值
SetMp = Text2.Text ' 获取设定的魔法值
NowHp = ncnr(DiZhi) ' 获取当前的体力值
NowMp = ncnr(DiZhi + 12) ' 获取当前的魔法值
MaxHp = ncnr(DiZhi + 4) ' 获取角色的最高体力值
MaxMp = ncnr(DiZhi + 16) ' 获取角色的最高魔法值
Label3.Caption = Str(NowHp) + "/" + Str(MaxHp) ' 显示角色体力值状态
Label4.Caption = Str(NowMp) + "/" + Str(MaxMp) ' 显示角色魔法值状态

If Check1.Value Then
Timer2.Enabled = True
Else
Timer2.Enabled = False
End If
If Check2.Value Then
Timer3.Enabled = True
Else
Timer3.Enabled = False
End If
End Sub

Private Sub Timer2_Timer()
' 体力值小于设定值按下数字键1
If (NowHp) < SetHp Then
SendKeys "1"
End If
End Sub

Private Sub Timer3_Timer()
' 魔法值小于设定值按下数字键2
If (NowMp) < SetMp Then
SendKeys "2"
End If
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------------

VB 从零开始编外挂(七)

文章类别:VB专区    发表日期:2005-08-21
--------------------------------------------------------------------------------------------------------------------------------------------------------
钩子:喜欢外挂的人都知道,很多外挂都是在游戏当中才能呼出。这个就用到了钩子
N多人说:“哎,VB做钩子想都别想!去学C语言吧!”只要大家遇到这种人,就别理会他。
可以说他是个垃圾。在实现钩子方面VB可能没有VC快,但是也不像那种人说的“想都别想”
C语言,我最近几天看了看。{ } ;这些太多了。脑袋也大了!可能那些学C语言的人是接触电脑
编程的时候就学的它吧!但是呢,我接触电脑学的就是VB。没办法我爱它!
--------------------------------------------------------------------------------------------------------------------------------------------------------
好了下面介绍简单的钩子吧!
--------------------------------------------------------------------------------------------------------------------------------------------------------
SetWindowsHookEx定义如下:
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" ( ByVal idHook As Long , ByVal lpfn As Long , ByVal hmod As Long , ByVal dwThreadId As Long ) As Long
idHook是钩子类型,如WH_KEYBOARD捕捉键盘消息,而WH_MOUSE捕捉鼠标消息。
hmod用于全局钩子,VB要实现钩子,必须设为0。
dwThreadId用于线程钩子VB中可以设置为App.ThreadID。
lpfn为钩子函数,在VB中可以使用AddressOf获得钩子函数的地址。
这个函数因为钩子类型不同而有所不同。
--------------------------------------------------------------------------------------------------------------------------------------------------------
如键盘钩子为:
Public Function KeyboardProc( ByVal nCode As Long , ByVal wParam As Long , ByVal lParam As Long ) As Long
'如果Code不为0,钩子函数必须调用CallNextHookEx,将消息传递给下面的钩子。wParam和lParam不是按键 。
--------------------------------------------------------------------------------------------------------------------------------------------------------
下面给大家一个VB钩子运用很好的例子!(全局钩子)
我在论坛上遇到了王者,王者可以说是我见到的VB最棒的一个人。可以说王者是个
VB狂人,很多学C语言的人看来VB不能实现的东西。王者都实现了!这不是在打广告
这是真的。VB实现全局钩子前几年在某某VB学习网站上看见过“VB全局钩子是根本不能实现的!站长发布”呵呵!真的有点骇人听闻!
但是大家看到了下面这个“万能吃药”外挂就知道了!
http://www.v2best.com/dispbbs.asp?boardID=6&ID=171&page=1
--------------------------------------------------------------------------------------------------------------------------------------------------------
其它的就不多说了,开学了。到暑假的时候再写东西吧!
希望大家努力,相信一点,
什么工具什么语言不重要,只要有思路就行!
--------------------------------------------------------------------------------------------------------------------------------------------------------

VB 从零开始编外挂(八)
Private Sub Form_Load()
CountID = 0
ExitID = False
ListView1.ColumnHeaders.Add 1, , "源 IP", 1500
ListView1.ColumnHeaders.Add 2, , "源端口", 1500
ListView1.ColumnHeaders.Add 3, , "目标 IP", 1500
ListView1.ColumnHeaders.Add 4, , "目标端口", 1500
ListView1.ColumnHeaders.Add 5, , "协议", 1500
ListView1.ColumnHeaders.Add 6, , "时间", 1500
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call WCleanup(s)
Unload Me
End Sub

Private Sub ListView1_Click()
Dim coun As Long
Dim sar As String, sar3 As String
Dim sar1 As String, sar2 As String

RichTextBox1.Text = "" ''清除 RichTextBox1
Dim buffer() As Byte
buffer = str

If ListView1.SelectedItem Is Nothing Then ''如果 ListView1 控件没有数值则提示错误
Exit Sub
End If


''将 buffer 的值(即通过 Recibir 接收的数据包)转换为一定格式并在 RichTextBox1 控件下显示出来
For i = 0 To resarray(ListView1.SelectedItem.Index)
coun = coun + 1
If Len(Hex(buffer(i))) = 1 Then
sar = "0" & Hex(buffer(i))
Else
sar = Hex(buffer(i))
End If

sar3 = sar3 & sar

If Asc(Chr("&h" & Hex(buffer(i)))) < 32 Then
sar1 = "."
Else
sar1 = Chr("&h" & Hex(buffer(i)))
End If

sar2 = sar2 & sar1
RichTextBox1.Text = RichTextBox1.Text & sar & " "

If coun = 15 Then
RichTextBox1.Text = RichTextBox1.Text & " |" & sar2 & vbCrLf:
coun = 0
sar2 = ""
sar3 = ""
End If
Next i

If coun < 15 Then
r = 44 - (coun * 3) + 1
es = String(r, Chr(32))
RichTextBox1.Text = RichTextBox1.Text & es & " |" & sar2
End If
End Sub

Private Sub M_Clear_Click()
ListView1.ListItems.Clear
RichTextBox1.Text = ""
End Sub

''程序开始捕捉
Private Sub M_Start_Click()
ListView1.ListItems.Clear
RichTextBox1.Text = ""
Connecting ip(hostname), MsgHwnd ''开始截取封包
End Sub


Private Sub M_Stop_Click()
ExitID = True ''停止截取封包
End Sub

Private Sub MsgHwnd_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
CountID = CountID + 1
Recibir s, 1
If ExitID = True Then
Call WCleanup(s)
ExitID = False
MsgBox "退出", vbOKOnly, "数据封包截取"
End If
End Sub

模块:

Option Explicit

''WSAstartup 用来判断 Windows 所支持的 Winsock 版本,也就是初始化 Winsock DLL,其中第一个参数为你所想需要的Winsock版本!低字节为主版本,高字节为副版本!由于目前Winsock有两个版本:1.1和2.2,因此该参数可以是0x101或0x202;第二个参数是一个WSADATA结构,用于接收函数的返回信息!WSAStartup函数调用成功会返回0,否则返回非0值!
''WSACleanup 用来关闭 Winsock,与 WSAstartup 一起使用,即 WSAstartup 也可以看为启动 Winsock
''gethostbyname 用来返回一个关于主机信息的结构的指针
Public Declare Function WSAstartup Lib "wsock32.dll" Alias "WSAStartup" (ByVal wVersionRequired As Integer, ByRef lpWSAData As WSAdata) As Long
Public Declare Function WsACleanup Lib "wsock32.dll" Alias "WSACleanup" () As Long
Public Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long)
Public Declare Function lstrlen Lib "kernel32.dll" Alias "lstrlenA" (ByVal lpString As Any) As Long
Public Declare Function lstrcpy Lib "kernel32.dll" Alias "lstrcpyA" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
Public Declare Function inet_ntoa Lib "wsock32.dll" (ByVal addr As Long) As Long
Public Declare Function gethostname Lib "wsock32.dll" (ByVal name As String, ByVal namelen As Long) As Long
Public Declare Function gethostbyname Lib "wsock32.dll" (ByVal name As String) As Long
Public Declare Function closesocket Lib "wsock32.dll" (ByVal s As Long) As Long
Public Declare Function recv Lib "wsock32.dll" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long) As Long
Public Declare Function socket Lib "wsock32.dll" (ByVal af As Long, ByVal s_type As Long, ByVal protocol As Long) As Long
Public Declare Function WSAAsyncSelect Lib "wsock32.dll" (ByVal s As Long, ByVal hWnd As Long, ByVal wMsg As Long, ByVal lEvent As Long) As Long
Public Declare Function WSAIoctl Lib "ws2_32.dll" (ByVal s As Long, ByVal dwIoControlCode As Long, lpvInBuffer As Any, ByVal cbInBuffer As Long, lpvOutBuffer As Any, ByVal cbOutBuffer As Long, lpcbBytesReturned As Long, lpOverlapped As Long, lpCompletionRoutine As Long) As Long
Public Declare Function inet_addr Lib "wsock32.dll" (ByVal cp As String) As Long
Public Declare Function bind Lib "wsock32.dll" (ByVal s As Integer, addr As sockaddr, ByVal namelen As Integer) As Integer
Public Declare Function ntohs Lib "wsock32.dll" (ByVal netshort As Long) As Integer


Public Type WSAdata
wVersion As Integer
wHighVersion As Integer
szDescription As String * 255
szSystemStatus As String * 128
iMaxSockets As Integer
iMaxUdpDg As Integer
lpVendorInfo As Long
End Type


''sock 地址结构
Public Type sockaddr
sin_family As Integer
sin_port As Integer
sin_addr As Long
sin_zero As String * 8
End Type

Public Type HOSTENT
h_name As Long
h_aliases As Long
h_addrtype As Integer
h_length As Integer
h_addr_list As Long
End Type



''ip 头结构
Public Type ipheader
lenver As Byte
tos As Byte
len As Integer
ident As Integer
flags As Integer
ttl As Byte
proto As Byte
checksum As Integer
sourceIP As Long
destIP As Long
End Type


''TCP 头结构
Public Type tcp_hdr
th_sport As Integer
th_dport As Integer
th_seq As Long
th_ack As Long
th_lenres As Byte
th_flag As Byte
th_win As Integer
th_sum As Integer
th_urp As Integer
End Type


''UDP 头结构
Public Type udp_hdr
th_sport As Integer
th_dport As Integer
th_len As Integer
th_sum As Integer
End Type


''ICMP 头结构
Public Type icmp_hdr
th_type As Byte
th_code As Byte
th_sum As Integer
th_id As Integer
th_seq As Integer
th_time As Long
End Type

''常量
Public Const PF_INET = 2
Public Const SOCK_RAW = 3
Public Const AF_INET = 2
Public Const FD_READ = &H1
Public Const SIO_RCVALL = &H98000001
Public Const EM_REPLACESEL = &HC2

Public host As HOSTENT
Public s As Long
Public sock As sockaddr

Public Header As ipheader
Public tcpHead As tcp_hdr
Public udpHead As udp_hdr
Public icmpHead As icmp_hdr


Public resarray() As Long, str As String
Public i As Long, CountID As Long ''i 为临时变量,循环语句用,CountID 用来计算一共有多少个数据包
Public protocol As String
Public buffer() As Byte ''存放数据包
Public res As Long ''返回值,临时变量
Public ExitID As Boolean ''退出标识


''开始
Public Sub Wstartup()
Dim Data As WSAdata
Call WSAstartup(&H202, Data) ''初始化 Winsock 为 2.2
End Sub

''结束
Public Sub WCleanup(s As Long)
Call WsACleanup ''关闭 Winsock
closesocket s
End Sub

''获得当前主机的 IP
Public Function ip(ByRef address As String) As String
Dim pip As Long
Dim uip As Long
Dim s As Long
Dim ss As String
Dim cul As Long

CopyMemory host, ByVal gethostbyname(address), Len(host) ''将 gethostbyname 获得的值放到 host
CopyMemory pip, ByVal host.h_addr_list, 4 ''将 host.h_addr_list 的值放到 pip
CopyMemory uip, ByVal pip, 4 ''将 pip 的值放到 uip
s = inet_ntoa(uip) ''将 uip 转换为标准的 IPV4 格式
ss = Space(lstrlen(s)) ''去掉空格
cul = lstrcpy(ss, s)
ip = ss ''获得 IPV4 格式的地址并将其放如 ip
End Function

''获得当前机器的主机名
Public Function hostname() As String
Dim r As Long
Dim s As String
Dim host As String

Wstartup
host = String(255, 0)
r = gethostname(host, 255) ''获得当前主机的主机名

If r = 0 Then
hostname = Left(host, InStr(1, host, vbNullChar) - 1)
End If

End Function

''连接 IP
Public Sub Connecting(ByRef ip As String, pic As PictureBox)
Dim res As Long, buf As Long, bufb As Long
buf = 1

Wstartup ''初始化 Winsock

s = socket(AF_INET, SOCK_RAW, 0) ''创建套接字,s 是socket功能返回的文件描述符
If s < 1 Then
Call WCleanup(s)
Exit Sub ''如果创建失败则退出
End If

sock.sin_family = AF_INET ''socket类型
sock.sin_addr = inet_addr(ip) ''所用的IP地址
res = bind(s, sock, Len(sock)) ''绑定端口

If res <> 0 Then
Call WCleanup(s)
Exit Sub ''如果绑定失败则退出
End If

res = WSAIoctl(s, SIO_RCVALL, buf, Len(buf), 0, 0, bufb, ByVal 0, ByVal 0) ''改变Socket IO模式,将其改为混乱模式,即接受与自己无关的数据,则 SIO_RCVALL

If res <> 0 Then
Call WCleanup(s)
Exit Sub
End If

res = WSAAsyncSelect(s, pic.hWnd, &H202, ByVal FD_READ) ''设置套接字处于阻塞方式或者非阻塞方式,消息发送的窗口是 pic,即 Form1.Picture1

If res <> 0 Then
Call WCleanup(s)
Exit Sub
End If

End Sub

''接收信息
Public Sub Recibir(s As Long, ByVal RecFormat As Long)
If RecFormat = FD_READ Then
ReDim buffer(2000) ''重定义缓冲区大小为 2000
Do
res = recv(s, buffer(0), 2000, 0&) ''接收信息
If res > 0 Then

ReDim Preserve resarray(CountID) ''改变数组大小,并保留以前的数据
str = buffer()
resarray(CountID) = res

CopyMemory Header, buffer(0), Len(Header) ''将 buffer 里面的数据复制到 Header 结构里面

''根据IP头结构的标识来获得是什么类型的数据包,并将 IP 从头结构中分离出来
If Header.proto = 1 Then
protocol = "ICMP"
proticmp inversaip(Hex(Header.destIP)), inversaip(Hex(Header.sourceIP))
End If
If Header.proto = 6 Then
protocol = "TCP"
protcp inversaip(Hex(Header.destIP)), inversaip(Hex(Header.sourceIP))
End If
If Header.proto = 17 Then
protocol = "UDP"
proudp inversaip(Hex(Header.destIP)), inversaip(Hex(Header.sourceIP))
End If
End If
Loop Until res <> 2000
End If
End Sub

''将 16 进制转换为 IP 地址
Public Function inversaip(ByRef lng As String) As String
Dim ips As String

Select Case Len(lng)
Case 1
lng = "0000000" & lng
Case 2
lng = "000000" & lng
Case 3
lng = "00000" & lng
Case 4
lng = "0000" & lng
Case 5
lng = "000" & lng
Case 6
lng = "00" & lng
Case 7
lng = "0" & lng
End Select
For i = 1 To Len(lng) Step 2
ips = ips & Val("&h" & Mid(lng, Len(lng) - i, 2)) & "."
Next i

inversaip = Mid(ips, 1, Len(ips) - 1)
End Function


Public Function proticmp(saa As String, soc As String) As String
Dim ListTemp As Variant
Set ListTemp = Form1.ListView1.ListItems.Add(, , soc)
ListTemp.SubItems(2) = saa
ListTemp.SubItems(4) = protocol
ListTemp.SubItems(5) = Time

CopyMemory icmpHead, buffer(0 + 20), Len(icmpHead)

End Function

Public Sub protcp(saa As String, soc As String)
Dim ListTemp As Variant
CopyMemory tcpHead, buffer(0 + 20), Len(tcpHead)

Set ListTemp = Form1.ListView1.ListItems.Add(, , soc)
ListTemp.SubItems(1) = ntohs(tcpHead.th_sport)
ListTemp.SubItems(2) = saa
ListTemp.SubItems(3) = ntohs(tcpHead.th_dport)
ListTemp.SubItems(4) = protocol
ListTemp.SubItems(5) = Time
End Sub

Public Sub proudp(saa As String, soc As String)
Dim ListTemp As Variant
CopyMemory udpHead, buffer(0 + 20), Len(udpHead)


Set ListTemp = Form1.ListView1.ListItems.Add(, , soc)
ListTemp.SubItems(1) = ntohs(udpHead.th_sport)
ListTemp.SubItems(2) = saa
ListTemp.SubItems(3) = ntohs(udpHead.th_dport)
ListTemp.SubItems(4) = protocol
ListTemp.SubItems(5) = Time
End Sub


--------------------------------------------------------------------------------------------------------------------------------------------------------
彩色的太费时间了,所以就直接贴了!呵呵!
VB 从零开始编外挂(九)
封包的比对!网络游戏都是通过数据交换实现游戏竞技滴,所以分析封包是制作外挂的一个步骤。

--------------------------------------------------------------------------------------------------------------------------------------------------------

网络游戏封包分为2种封包:1。明文封包 2。加密封包

多数网络游戏都是加密封包,其原因是为了信息不被修改。明文封包的也有,呵呵“CS”呀这些

--------------------------------------------------------------------------------------------------------------------------------------------------------

好了,进入正题。封包这玩意其实很难。但是如果你入门了就不难了!

明文的好对付,BUT加密的就有点.......但也是有办法滴

就是“多抓包,多分析,多解密!”呵呵!

--------------------------------------------------------------------------------------------------------------------------------------------------------

抓包篇:什么抓包呢?抓包当然就是用WPE,或者自己编写软件拉,上次(呵呵`也就是昨天)已经做过了!

0056DF38 4E 3E 54 53 56 55 4A 6C 77 64 63 42 4D 46 6A 6E N>TSVUJlwdcBMFjn
0056DF48 41 4B 62 3F 71 78 76 79 65 47 7A 66 4C 50 3D 5F AKb?qxvyeGzfLP=_
0056DF58 45 52 40 5A 5C 61 6D 5D 43 68 67 6F 57 44 3B 51 ER@Z\am]ChgoWD;Q
0056DF68 75 58 5B 3C 74 6B 70 72 5E 60 69 49 48 4F 59 73 uX[<tkpr^`iIHOYs
0056DF78 2E 33 1E 01 13 22 10 0B 28 2D 20 0D 19 3C 3B 06 .3" (- .<;
0056DF88 11 1C 0C 00 3D 1D 2F 21 03 02 05 04 2C 31 3E 23 ..=/!,1>#
0056DF98 32 24 27 38 1F 39 25 12 0A 09 18 1B 2A 29 3A 0E 2$''89%..*):
0056DFA8 35 07 26 0F 2B 36 14 37 3F 34 30 16 08 15 17 1A 5&+67?40

这个就是某个网络游戏的封包!当然是加了密的。

00878BE0 55 41 4E 4E 4E 4E 4E 4E 4E 4E 4E 42 4E 4E 70 4E UANNNNNNNNNBNNpN
00878BF0 41 45 56 4E 3E 41 3E 58 79 4E 4B 65 AEVN>A>XyNKe

00878BE0 05 10 00 00 00 00 00 00 00 00 00 0B 00 00 36 00 ......... ..6.
00878BF0 10 20 04 00 01 10 01 31 17 00 11 18  .1.

0087CC04 15 00 00 00 00 00 00 00 0B 00 0D 80 42 01 00 05 ....... ..?B.
0087CC14 00 71 5C 04 58 .q\X

什么意思呢?当然就是要分析拉!

--------------------------------------------------------------------------------------------------------------------------------------------------------

分析篇:分析主要就是分析RAM里面的东西拉。可以到“看雪”去学学简单的汇编命令

004F3B9C /$ 53 PUSH EBX
004F3B9D |. 83C4 F8 ADD ESP,-8
004F3BA0 |. 8BDA MOV EBX,EDX ; 解密后数据目标地址
004F3BA2 |. 8BD4 MOV EDX,ESP ; 数据传递目标地址
004F3BA4 |. B9 04000000 MOV ECX,4 ; 传递个数为 4
004F3BA9 |. E8 12EEF8FF CALL CLIENT.004829C0 ; 把侍解密的4数值传递过来进行解密
004F3BAE |. 8A0424 MOV AL,BYTE PTR SS:[ESP] ; 第一位
004F3BB1 |. C1E0 02 SHL EAX,2
004F3BB4 |. 33D2 XOR EDX,EDX
004F3BB6 |. 8A5424 01 MOV DL,BYTE PTR SS:[ESP+1] ; 第二位
004F3BBA |. C1EA 04 SHR EDX,4
004F3BBD |. 0AC2 OR AL,DL ; 第一位与每二位 0r
004F3BBF |. 8803 MOV BYTE PTR DS:[EBX],AL ; 输出第1位
004F3BC1 |. 43 INC EBX ; 计数器+1 指向第二位
004F3BC2 |. 8A4424 01 MOV AL,BYTE PTR SS:[ESP+1] ; 第二位
004F3BC6 |. C1E0 04 SHL EAX,4
004F3BC9 |. 33D2 XOR EDX,EDX
004F3BCB |. 8A5424 02 MOV DL,BYTE PTR SS:[ESP+2] ; 第三位
004F3BCF |. C1EA 02 SHR EDX,2
004F3BD2 |. 0AC2 OR AL,DL ; 第二位与第三位 or
004F3BD4 |. 8803 MOV BYTE PTR DS:[EBX],AL ; 输出第二位
004F3BD6 |. 43 INC EBX ; 计数器+1 指向第三位
004F3BD7 |. 8A4424 02 MOV AL,BYTE PTR SS:[ESP+2] ; 第三位
004F3BDB |. C1E0 06 SHL EAX,6
004F3BDE |. 8A5424 03 MOV DL,BYTE PTR SS:[ESP+3] ; 第4个
004F3BE2 |. 0AC2 OR AL,DL ; 第三个与第四个 or
004F3BE4 |. 8803 MOV BYTE PTR DS:[EBX],AL ; 输出第三位
004F3BE6 |. 59 POP ECX
004F3BE7 |. 5A POP EDX
004F3BE8 |. 5B POP EBX
004F3BE9 \. C3 RETN
004F3BEA 8BC0 MOV EAX,EAX
004F3BEC /$ 53 PUSH EBX
004F3BED |. 56 PUSH ESI
004F3BEE |. 57 PUSH EDI
004F3BEF |. 55 PUSH EBP
004F3BF0 |. 50 PUSH EAX ; 封包
004F3BF1 |. B8 02000000 MOV EAX,2
004F3BF6 |> 81C4 04F0FFFF /ADD ESP,-0FFC
004F3BFC |. 50 |PUSH EAX
004F3BFD |. 48 |DEC EAX
004F3BFE |.^75 F6 \JNZ SHORT CLIENT.004F3BF6
004F3C00 |. 8B8424 0020000>MOV EAX,DWORD PTR SS:[ESP+2000]
004F3C07 |. 8BD9 MOV EBX,ECX
004F3C09 |. 8BFA MOV EDI,EDX
004F3C0B |. 8BD3 MOV EDX,EBX
004F3C0D |. 81E2 03000080 AND EDX,80000003
004F3C13 |. 79 05 JNS SHORT CLIENT.004F3C1A
004F3C15 |. 4A DEC EDX
004F3C16 |. 83CA FC OR EDX,FFFFFFFC
004F3C19 |. 42 INC EDX
004F3C1A |> 85D2 TEST EDX,EDX
004F3C1C |. 74 05 JE SHORT CLIENT.004F3C23
004F3C1E |. 83C8 FF OR EAX,FFFFFFFF
004F3C21 |. EB 7B JMP SHORT CLIENT.004F3C9E
004F3C23 |> 8BD3 MOV EDX,EBX
004F3C25 |. 85D2 TEST EDX,EDX
004F3C27 |. 79 03 JNS SHORT CLIENT.004F3C2C
004F3C29 |. 83C2 03 ADD EDX,3
004F3C2C |> C1FA 02 SAR EDX,2
004F3C2F |. 891424 MOV DWORD PTR SS:[ESP],EDX
004F3C32 |. 8D5424 04 LEA EDX,DWORD PTR SS:[ESP+4]
004F3C36 |. 8BCB MOV ECX,EBX
004F3C38 |. E8 83EDF8FF CALL CLIENT.004829C0 ; 整理出封包传递给解密地址进行解密
004F3C3D |. C6441C 04 00 MOV BYTE PTR SS:[ESP+EBX+4],0
004F3C42 |. 8B1C24 MOV EBX,DWORD PTR SS:[ESP]
004F3C45 |. C1E3 02 SHL EBX,2
004F3C48 |. 4B DEC EBX
004F3C49 |. 85DB TEST EBX,EBX
004F3C4B |. 7C 28 JL SHORT CLIENT.004F3C75
004F3C4D |. 43 INC EBX
004F3C4E |. 8D4424 04 LEA EAX,DWORD PTR SS:[ESP+4] ; 一个封包
004F3C52 |> 8A10 /MOV DL,BYTE PTR DS:[EAX] ; 第N位
004F3C54 |. 80FA 3B |CMP DL,3B
004F3C57 |. 72 05 |JB SHORT CLIENT.004F3C5E
004F3C59 |. 80FA 7A |CMP DL,7A
004F3C5C |. 76 05 |JBE SHORT CLIENT.004F3C63
004F3C5E |> 83C8 FF |OR EAX,FFFFFFFF ; 出错处理
004F3C61 |. EB 3B |JMP SHORT CLIENT.004F3C9E
004F3C63 |> 81E2 FF000000 |AND EDX,0FF
004F3C69 |. 8A92 3DEF5A00 |MOV DL,BYTE PTR DS:[EDX+5AEF3D] ; 54ef3d是一串字符串.
004F3C6F |. 8810 |MOV BYTE PTR DS:[EAX],DL ; 转换后代码
004F3C71 |. 40 |INC EAX ; 下一个封包字符
004F3C72 |. 4B |DEC EBX ; 计数器减1
004F3C73 |.^75 DD \JNZ SHORT CLIENT.004F3C52
004F3C75 |> 8B1C24 MOV EBX,DWORD PTR SS:[ESP]
004F3C78 |. 4B DEC EBX
004F3C79 |. 85DB TEST EBX,EBX
004F3C7B |. 7C 1B JL SHORT CLIENT.004F3C98
004F3C7D |. 43 INC EBX
004F3C7E |. 33ED XOR EBP,EBP
004F3C80 |. 8D7424 04 LEA ESI,DWORD PTR SS:[ESP+4] ; 取上面转化后的数值
004F3C84 |> 8D546D 00 /LEA EDX,DWORD PTR SS:[EBP+EBP*2]
004F3C88 |. 03D7 |ADD EDX,EDI ; 目标地址 每次转化3
004F3C8A |. 8BC6 |MOV EAX,ESI ; 源地址 每次取
004F3C8C |. E8 0BFFFFFF |CALL CLIENT.004F3B9C ; 解密数据 (取4个.转化3个)
004F3C91 |. 45 |INC EBP
004F3C92 |. 83C6 04 |ADD ESI,4
004F3C95 |. 4B |DEC EBX
004F3C96 |.^75 EC \JNZ SHORT CLIENT.004F3C84
004F3C98 |> 8B0424 MOV EAX,DWORD PTR SS:[ESP]
004F3C9B |. 8D0440 LEA EAX,DWORD PTR DS:[EAX+EAX*2]
004F3C9E |> 81C4 04200000 ADD ESP,2004
004F3CA4 |. 5D POP EBP
004F3CA5 |. 5F POP EDI
004F3CA6 |. 5E POP ESI
004F3CA7 |. 5B POP EBX
004F3CA8 \. C3 RETN

什么意思?就是要解密后制作外挂拉!

--------------------------------------------------------------------------------------------------------------------------------------------------------
外挂的制作就不介绍了设计到VB汇编指针的问题了,VB指针的应用下一次给大家讲!

VB 从零开始编外挂(十)
前天晚上我跟封包玩了一晚上,因才开始(第一次跟封包)说一下我一晚上的发现吧
我是直接用WPE截取的,因为金山游戏本身都有截取封包的保护措施(就像MM所说),直接用WPE截取我是截取不到的,后来用Ollydbg调试的时候才截取的到。
经过前面的准备,封报的明文准备已经OK,准备进行加密,加密方式是取一个4字节的数字,对封包进行Xor运算,运算完毕后就直接发送出去,我核对过用WPE截取封包的数据,和我看到的运算结果完全一致,这说明只要用那个4字节的数字对封包进行反Xor运算就可以得到明文的封包。
其实说白了那个4字节的数字就是每次加密的密匙,也就是服务器认可的,这个4字节怎么得出的我就没跟了,暂时只发现只要不更换场景,4字节密匙不会更变。
相同道理,服务返回的信息也是经过4字节Xor运算处理了的,客户端解密时候取服务端4字节密匙对封包进行解密就可以得到明文封包。
大体说下封神封包加密解密流程
Send:
1,制造明文封包
2,取4字节Send密匙
3,用4字节密匙对封包进行Xor运算(保留前2位),最后不足4字节进行单字节运算。
4,发送。
Revc:
1,收到封包
2,取4字节Revc密匙
3,用4字节密匙对封包进行Xor运算(保留前2位),最后不足4字节进行单字节运算。
4,对明文封包进行分析


--------------------------------------------------------------------------------------------------------------------------------------------------------


以上的方法比较累人!下面说说本地制作吧(既是用大家熟悉的FPE等软件)
制作辅助外挂(自动加血,自动加蓝,免负重等等)
HP的地址是不固定的,我使用金山游侠先找出当前的那个地址,
然后使用softice对该地址设置断点,softice应该会立刻断住,
你会看见MOV DWORD PTR DS:[EAX+ECX*8+EB4],EDI,
在客户端中,位置是0x4B2C74,
你可以修改游戏的进程,
把MOV DWORD PTR DS:[EAX+ECX*8+EB4],
EDI改成一个E9 XX XX XX XX 90 90,
JMP到进程中.rsrc和.data之间的空余地址,
把(XX XX XX XX) + 0x4B2C74 + 5处的代码修改成MOV Y, EDI,
下一条做原来的MOV DWORD PTR DS:[EAX+ECX*8+EB4],EDI,
再来个E9 ZZ ZZ ZZ ZZ,
设置好ZZ ZZ ZZ ZZ使其再跳到原来DWORD PTR DS:[EAX+ECX*8+EB4],
EDI的下一句,就是0x4B2C7B处,
这样HP的地址就固定下来了,只要看Y就知道HP了。

--------------------------------------------------------------------------------------------------------------------------------------------------------



下面说说客服端的破解(小试牛刀!)有兴趣的朋友可以制作一个DLL
来实现加血锁定血量!
.text:004E8EF0 sub_4E8EF0 proc near
.text:004E8EF0
.text:004E8EF0 arg_0 = dword ptr 4
.text:004E8EF0 arg_4 = dword ptr 8
.text:004E8EF0 arg_8 = dword ptr 0Ch
.text:004E8EF0
.text:004E8EF0 mov ecx, [esp+arg_0] ; 可能是长度LEN地址
.text:004E8EF4 push ebx
.text:004E8EF5 mov eax, [esp+4+arg_4] ; 缓存地址
.text:004E8EF9 push esi
.text:004E8EFA mov esi, ecx
.text:004E8EFC push edi
.text:004E8EFD mov edi, [esp+0Ch+arg_8] ; 加密KEY地址
.text:004E8F01 and esi, 3 ;相当于缓存长度除以4的余数
.text:004E8F04 shr ecx, 2 ;相当于缓存长度除以4的商
.text:004E8F07 mov edx, [edi] ;把加密KEY值放进edx
.text:004E8F09 mov ebx, ecx ;
.text:004E8F0B dec ecx ;
.text:004E8F0C test ebx, ebx ;
.text:004E8F0E jbe short loc_4E8F1E ;判断跳转
.text:004E8F10 inc ecx ;
.text:004E8F11
.text:004E8F11 loc_4E8F11:
.text:004E8F11 mov ebx, [eax]
.text:004E8F13 add eax, 4
.text:004E8F16 xor ebx, edx ;异或运算,EDX=KEY的值,核心运算
.text:004E8F18 dec ecx
.text:004E8F19 mov [eax-4], ebx
.text:004E8F1C jnz short loc_4E8F11 ;相当于FOR循环运算
.text:004E8F1E
.text:004E8F1E loc_4E8F1E:
.text:004E8F1E mov ecx, esi
.text:004E8F20 dec esi
.text:004E8F21 test ecx, ecx
.text:004E8F23 jbe short loc_4E8F35
.text:004E8F25 lea ecx, [esi+1]
.text:004E8F28
.text:004E8F28 loc_4E8F28:
.text:004E8F28 mov bl, [eax]
.text:004E8F2A xor bl, dl ;异或运算
.text:004E8F2C mov [eax], bl
.text:004E8F2E inc eax
.text:004E8F2F shr edx, 8
.text:004E8F32 dec ecx
.text:004E8F33 jnz short loc_4E8F28;相当于FOR循环运算
.text:004E8F35
.text:004E8F35 loc_4E8F35: KEY付值运算;
.text:004E8F35 mov eax, [edi]
.text:004E8F37 mov edx, eax
.text:004E8F39 shl edx, 5
.text:004E8F3C sub edx, eax
.text:004E8F3E mov eax, 1
.text:004E8F43 add edx, 8088405h
.text:004E8F49 mov [edi], edx KEY付值
.text:004E8F4B pop edi
.text:004E8F4C pop esi
.text:004E8F4D pop ebx
.text:004E8F4E retn
.text:004E8F4E sub_4E8EF0 endp

--------------------------------------------------------------------------------------------------------------------------------------------------------
VB 从零开始编外挂(十一)
传奇外挂制作的资料

--------------------------------------------------------------------------------------------------------------------------------------------------------


显血:7A0D3: 75 EB
超负重:99A40: 76 EB
offset 原 改
防石化:
00466F80: 75 90
00466F81: 2E 90
稳如泰山:
0046959D: 20 44
004695A9: 14 38
如影随行:
004634E2: 00 01
战斗退出:
004620E6: 74 90
004620E7: 0D 90
00462162: 74 90
00462163: 0A 90
004914CA: 74 90
004914CB: 0E 90
00491576: 74 90
00491577: 0E 90
相对不卡: ——|
00463A8D: 99 00 |
0049B848: 2C 00 |—— 二选一
绝对不卡: |
00466F57: 00 01 ——|

--------------------------------------------------------------------------------------------------------------------------------------------------------

防止双开:
EB 1C A1 10 41 4A 00
修改为:
74 1C A1 10 41 4A 00
需要双开就反过来改。

看血:
内存地址:47A0D3
75 EB

00000075108B45EC
修改为:
000000EB108B45EC

强退:
内存地址:004620E6(7)
74 90
0D 90

2000740D8B45
修改为:
200090908B45
内存地址:00462162(3)
74 90
0A 90

2000740A8B45
修改为:
200090908B45
内存地址:4914CA(B)
内存地址:491576(7)
74 90
0E 90

0080782000740EA1
修改为:
00807820009090A1


免助跑
内存地址:00461BEB(C-F0)
0F 90
8E 90
79 90
FD 90
FF 90
FF 90

E8000F8E79FDFFFF
修改为:
E800909090909090
内存地址:461BB9(A-E)
0F 90
8C 90
DA 90
00 90
00 90
00 90

00010F8CDA000000A1
修改为:
0001909090909090A1


跑步砍
内存地址:004634E2
00 01

4F00008D45F0
修改为:
4F00018D45F0


攻击速度
内存地址:467016(7)
78 E2
05 04

EB0BB87805
修改为:
EB0BB84805
说明:速度由二位数指定,二位数前后互换为真实数据,数字大为慢小为快


穿人
内存地址:472D17
34 0C

00000034018845
修改为:
0000000C018845


免蜡
内存地址:471BDE
74 EB

008038007454
修改为:
00803800EB54


物品闪光
内存地址:471AA6
04

1300007625
修改为:
0200007625


自动放药

0048C21F F9 68 FD FF
004623A2 76 07 00 00
修改为:
0048C21F DD 50 B0 01
004623A2 7A ED B2 01


超负重??
Poke 00499A40 EB
004975A8 EB 5C
00499A40 EB 93

攻击方法修
原版
00463425 74 1C
0046344A 74 10
00463463 74 15

半月
00463425 74 1C
0046344A 74 10
00463463 90 90
攻杀
00463425 74 1C
0046344A 90 90
00463463 74 15
烈火
00463425 90 90
0046344A 74 10
00463463 74 15

方法二

半月
Poke 00463363 D0
烈火
Poke 00463363 D1
普通
Poke 00463363 C6

C745E8 C60B 单手砍
C745E8 C70B 双手砍
C745E8 C80B 跳跃砍
C745E8 CA0B 攻杀
C745E8 CB0B 刺杀
C745E8 D00B 半月
C745E8 D10B 烈火


无限刺杀
内存地址:463363
C6 CB

C745E8C60B
修改为:
C745E8CB0B
内存地址:463373
C7 CB

C745E8C70B
修改为:
C745E8CB0B


无限攻杀
内存地址:463363
C6 CA

C745E8C60B
修改为:
C745E8CA0B
内存地址:463373
C7 CA

C745E8C70B
修改为:
C745E8CA0B


无限半月
内存地址:463363
C6 D0

C745E8C60B
修改为:
C745E8D00B
内存地址:463373
C7 D0

C745E8C70B
修改为:
C745E8D00B


无限烈火
内存地址:463363
C6 D1

C745E8C60B
修改为:
C745E8D10B
内存地址:463373
C7 D1

C745E8C70B
修改为:
C745E8D10B

自动放药

0048C21F F9 68 FD FF
004623A2 76 07 00 00
修改为:
0048C21F DD 50 B0 01
004623A2 7A ED B2 01

免蜡
内存地址:471BDE
74 EB

008038007454
修改为:
00803800EB54
--------------------------------------------------------------------------------------------------------------------------------------------------------


编程工具:
1.VC 高手的不二选择
2.Borland C++Builder 如果当年是Borland做了操作系统而不是bill,也许我们现在的
编程工具更加智能更加方便更加接近人性化. 如果不喜欢VC那种事事必恭的编程方式,
就用它好了,除了我们用的操作系统不是由它造的之外,几乎所有的编程都可以用它完
成.
3.Borland Delphi 和Borland C++Builder一样,由同一家公司出品在RAD方面个人感觉
VB在它面前只是一个小学生.与VC比嘛,除了语法上不同之外,性能及编程方面都要比VC
强过很多,不过它不是bill的产品,所以有系统底层方面比VC要差一些,不过用它做个什
么外挂之类,它还是足以胜任的.
4.VB 这个就不多说了简单的内存修改封包修改就它就好了,强烈推荐初学者使用,有了
经验之后再用其它的工具,可以事倍功半.
内存工具:
FPE2001
GameMaster
Game Expert
GameEnchanter
游神
金山游侠
↑我最喜欢的几样工具(金山游侠除外),谁说网络游戏不能修改。呵呵

封包修改工具
WPE
winsock
spyMaster
ETF20
(PS:还有很多工具哟,不过不太智能化,不过也一样有功能很强了.这些以后再介绍了)
辅助工具
变速齿轮
按键精灵
Trainer Maker Kit
Magic Trainer Creator
反编译调试脱壳工具
UltraEdit
Softice
TRW2000
W32Dasm
OllyDbg
SPY++
脱SafeDisc SafeCast 2 壳工具
脱Aspack壳工具
脱ASPro壳工具
脱UPX壳工具
脱Armadillo壳工具
VB 从零开始编外挂(十二)
VB实现指针访问!DLL的访问

--------------------------------------------------------------------------------------------------------------------------------------------------------

CopyMemory函数提供了一个简单的方法来执行C++中见解访问运算符(*),这个运算符可以访问被一个指针变量所指向的变量的值。
即如有指针变量 P,在C++中可以简单的用 *P 来访问,那在 VB 中怎么访问呢?


在 VB 中,我们可以使用 CopyMemory函数别名。
Declare Sub VBGetTarget Lb "kernel32" Alias "RtlMoveMemory"(Target As Any,ByVal lPoint As Long,ByVal cbCopy As Long)


例子:
Dim Pointer As Long
Dim Target As Integer
Dim i As Integer
i=123
Pointer=VarPtr(i) ''获得指针
VBGetTarget Target,Pointer,LenB(Target)
Debug.Print Target

--------------------------------------------------------------------------------------------------------------------------------------------------------

很长时间以来,都认为只能通过绝对路径引用标准DLL中的函数。其实,你也可以用相对路径。很简单的,现在就尝试一下吧。

  1)绝对路径方法

  比如你的DLL文件位于c:\testDLL\debug\testDLL.dll

  一般来说,你需要在VB中作如下声明

Declare Sub mytest Lib "c:\testDLL\dubug\testDLL.dll" (ByVal x As Long)

  另外的一个变通方法是把testDLL.dll放在windows的系统目录下,这样,你就可以直接引用文件名了。不过,需要把一个文件放到windows系统目录下,很是不爽!

  2)相对路径方法

  看看我们如何用相对路径,假设你的DLL文件位于c:\testDLL\debug\testDLL.dll,你的VB程序位于目录c:\testDLL\vbClient
你可以在VB程序中作如下声明:

Declare Sub mytest Lib "../dubug/testDLL.dll" (ByVal x As Long)

  如果直接运行你的VB程序,系统会提示错误:找不到../dubug/testDLL.dll.

  为了使上面的声明其作用,先暂时关闭你的VB工程。然后用一个文本编辑器(notepad,editplus,etc)打开工程文件(就是那个后缀是vbp的家伙),通常vbp文件由几个部分组成。

posted on 2006-06-27 14:43 天外飞仙 阅读(2513) 评论(0)  编辑  收藏 所属分类: 其它

只有注册用户登录后才能发表评论。


网站导航: