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

解决方案 »

  1.   

    Option Explicit
    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
    是这句, 上面的贴错了, 改不了 - -,
      

  2.   

    Option Explicit
    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
    又帖错了, 是这些 - -!!!!!!!!!!
      

  3.   


    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;