自動搜索特徵碼來定位位址的DLL
下面是XP下蜘蛛紙牌的範例,只是作一個功能演示,並沒有其他作用
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName 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 CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function ScanTZ Lib "mem.dll" (ByVal hProcess As Long, ByVal s As String) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Dim hwnd As Long, pid As Long, hProc As Long
Sub Main()
hwnd = FindWindow(vbNullString, "蜘蛛")
GetWindowThreadProcessId hwnd, pid
hProc = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
MsgBox Hex(ScanTZ(hProc, "1C210300")) '查找特徵碼
CloseHandle (hProc)
End Sub
得到了這個位址就很方便了,遊戲記憶體是動態分配的,但是相對於一些位址的位移差是不變的
比如 :
第1次搜索特徵碼A1C4FC8B008B401C
地址定位到400000,血的地址是410000,那麼她們的位移差就是10000,
第2次搜索特徵碼A1C4FC8B008B401C
地址定位到500000,那麼血的地址就是500000+10000就是了,
舉個VB例子
dim i as long,u as long 'u表示血的位址
i=ScanTZ(hProc, "A1C4FC8B008B401C")
u=i+&H10000 '這樣就得到準確血的地址了
當然你要早到正確的特徵碼(不要問我怎麼找特徵碼,這個去查論壇的相關貼)
'關於應用,在舉個例子
'比如征途的體力什麼的是按照人物的名稱的Unicode來定位的
'比如人物名稱"廣海遊戲"他的UNicode是B9E3BAA3D3CECFB7
dim i as long,u as long 'u表示血的位址,i表示記憶體人物名稱位址
i=ScanTZ(hProc, "B9E3BAA3D3CECFB7") '假設血的地址和人物名稱相差&H10000
u=i+&H10000 '這樣就得到準確血的地址了
mem.dll和VB調用源代碼在附件,dll很小的,支援其他語言調用的
|