Option Explicit
Dim hProcess1 As Long
Dim ID As Long, Gamehwnd1 As Long
Private Sub Check1_Click()
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 WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Gamehwnd1 = FindWindow(vbNullString, "Maplestory")
GetWindowThreadProcessId Gamehwnd1, ID
hProces1 = OpenProcess(PROCESS_ALL_ACCESS, False, ID)
If (Gamehwnd1 = 0) Then
Else
If Check1.Value = 1 Then
Dim str1(12) As Byte, nSize As Long
str1(0) = &HBC
str1(1) = &H5F
str1(2) = &HBA
str1(3) = &HE4
str1(4) = &HFE
str1(5) = &HD2
str1(6) = &H25
str1(7) = &HC7
str1(8) = &H7B
str1(9) = &H90
str1(10) = &H16
str1(11) = &H52
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
Else
str1(0) = &H99
str1(1) = &HA8
str1(2) = &HFB
str1(3) = &HC1
str1(4) = &H44
str1(5) = &HDD
str1(6) = &HF
str1(7) = &HCE
str1(8) = &H8
str1(9) = &H90
str1(10) = &HEA
str1(11) = &H71
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
End If
End If
End Sub
解决方案 »
- CB和Delphi能装在一个目录下?
- 动态创建的TEdit,请问在哪里捕获它失去焦点事件
- 一个activeform如何分成几个CAB包发布?
- 在多线程调用 端口扫描中,如何处理 N个IP+N个Port的情况?我的笨方法是一个ip+端口 启动一个线程但总不能一次启动1千以上个线程运转的
- ★★★送300分!!关于OpenGL,用线条画出立体图,怎么控制离视点远的线颜色浅点,近的颜色深点???
- 请idilent(怎么理解怎么说)大哥进来领分!顺便有几个问题请教
- 我想在当前运行的程序中判断是否有Tedit控件,怎么判断?好象是用assigned吧?
- 如何在TQuery控件操作foxpro数据库,对表删除索引
- 如何连接上一级目录中的数据库啊,谢谢!
- to urchinjj(懒刺猬) “我来做你的师傅吧!”//zswang
- 求:将 Treeview 的内容导出为 xml 的函数~~
- 怎么在程序中建立和管理SQL后台任务?
Dim hProcess1 As Long
Dim ID As Long, Gamehwnd1 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 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 LongPrivate Sub Check1_Click()
Gamehwnd1 = FindWindow(vbNullString, "Maplestory")
GetWindowThreadProcessId Gamehwnd1, ID
hProces1 = OpenProcess(PROCESS_ALL_ACCESS, False, ID)
If (Gamehwnd1 = 0) Then
Else
If Check1.Value = 1 Then
Dim str1(12) As Byte, nSize As Long
str1(0) = &HBC
str1(1) = &H5F
str1(2) = &HBA
str1(3) = &HE4
str1(4) = &HFE
str1(5) = &HD2
str1(6) = &H25
str1(7) = &HC7
str1(8) = &H7B
str1(9) = &H90
str1(10) = &H16
str1(11) = &H52
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
Else
str1(0) = &H99
str1(1) = &HA8
str1(2) = &HFB
str1(3) = &HC1
str1(4) = &H44
str1(5) = &HDD
str1(6) = &HF
str1(7) = &HCE
str1(8) = &H8
str1(9) = &H90
str1(10) = &HEA
str1(11) = &H71
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
End If
End If
End Sub
是这句, 上面的贴错了, 改不了 - -,
Dim hProcess1 As Long
Dim ID As Long, Gamehwnd1 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 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 Sub Check1_Click()Gamehwnd1 = FindWindow(vbNullString, "Maplestory")
GetWindowThreadProcessId Gamehwnd1, ID
hProces1 = OpenProcess(PROCESS_ALL_ACCESS, False, ID)
If (Gamehwnd1 = 0) Then
Else
If Check1.Value = 1 Then
Dim str1(12) As Byte, nSize As Long
str1(0) = &HBC
str1(1) = &H5F
str1(2) = &HBA
str1(3) = &HE4
str1(4) = &HFE
str1(5) = &HD2
str1(6) = &H25
str1(7) = &HC7
str1(8) = &H7B
str1(9) = &H90
str1(10) = &H16
str1(11) = &H52
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
Else
str1(0) = &H99
str1(1) = &HA8
str1(2) = &HFB
str1(3) = &HC1
str1(4) = &H44
str1(5) = &HDD
str1(6) = &HF
str1(7) = &HCE
str1(8) = &H8
str1(9) = &H90
str1(10) = &HEA
str1(11) = &H71
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
End If
End If
End Sub
str1(0) = &H99
str1(1) = &HA8
str1(2) = &HFB
str1(3) = &HC1
str1(4) = &H44
str1(5) = &HDD
str1(6) = &HF
str1(7) = &HCE
str1(8) = &H8
str1(9) = &H90
str1(10) = &HEA
str1(11) = &H71
WriteProcessMemory hProces1, ByVal &H99CD5C, ByVal VarPtr(str1(0)), 12, nSize
End If
End If
End Sub
又帖错了, 是这些 - -!!!!!!!!!!
VAR
hProcess1,ID,Gamehwnd1:cardinal;procedure TForm1.Button1Click(Sender: TObject);
var
str1: array[0..11] of byte;
nsize: cardinal;
begin
Gamehwnd1:=FindWindow(nil,'Maplestory');
GetWindowThreadProcessId(Gamehwnd1,ID);
hProcess1:= OpenProcess(PROCESS_ALL_ACCESS, False, ID);
If (Gamehwnd1 = 0) Then
else
begin
if checkbox1.Enabled then
begin
str1[0] := $BC;
str1[1] := $5F;
str1[2] := $BA;
str1[3] := $E4;
str1[4] := $FE;
str1[5] := $D2;
str1[6] := $25;
str1[7] := $C7;
str1[8] := $7B;
str1[9] := $90;
str1[10] := $16;
str1[11] := $52;
WriteProcessMemory(hProcess1, pinteger($99CD5C),@str1[0],12,nsize);
end
else
begin
str1[0] := $99;
str1[1] := $A8;
str1[2] := $FB;
str1[3] := $C1;
str1[4] := $44;
str1[5] := $DD;
str1[6] := $F ;
str1[7] := $CE;
str1[8] := $8 ;
str1[9] := $90;
str1[10] := $EA;
str1[11] := $71;
WriteProcessMemory(hProcess1, pinteger($99CD5C),@str1[0],12,nsize);
end;
end;
end;