玩А怪ぁ哭 发表于 2010-12-6 00:27:21

大家来看看这个是VB代码吗?9)、、

本帖最后由 玩А怪ぁ哭 于 2010-12-6 00:31 编辑

我是菜鸟不会,帮忙看下!
ption Explicit
Private Type MODULEENTRY32      '模块结构
    dwSize As Long            '指定结构的大小,在调用Module32First前需要设置,否则将会失败
    th32ModuleID As Long      '模块号
    th32ProcessID As Long       '包含本模块的进程号
    GlblcntUsage As Long      '本模块的全局引用计数
    ProccntUsage As Long      '包含模块的进程上下文中的模块引用计数
    modBaseAddr As Byte         '模块基地址
    modBaseSize As Long         '模块大小(字节数)
    hModule As Long             '包含模块的进程上下文中的hModule句柄
    szModule As String * 256    '模块名
    szExePath As String * 260   '模块对应的文件名和路径
End Type
'API函数声明
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 CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetModuleFileNameEx Lib "psapi.dll" Alias "GetModuleFileNameExA" (ByVal Hprocess As Long, ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Private Declare Function Module32First Lib "kernel32.dll" (ByVal hSnapshot As Long, ByRef lppe As MODULEENTRY32) As Long
Private Declare Function Module32Next Lib "kernel32.dll" (ByVal hSnapshot As Long, ByRef lpme As MODULEENTRY32) As Long
Private Declare Function ReadProcessMemory Lib "kernel32.dll" (ByVal Hprocess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Any, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal Hprocess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Any, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
Private Declare Function VirtualFreeEx Lib "kernel32" (ByVal Hprocess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal Hprocess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'API常数定义
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Const TH32CS_SNAPMODULE = &H8
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Const MEM_DECOMMIT = &H4000&
Private Const MEM_RELEASE = &H8000&
Private Const MEM_RESERVE = &H2000&
Private Const MEM_COMMIT = &H1000&
'窗口级变量声明
Private g_Pid As Long
Private g_Handle As Long
Private gpigamebase As Long
Private gpiCodebase As Long
Private gpiHookProc As Long
Private gpiHookAddress As Long
Private gpiHookData(5) As Byte
Private qfxpAddress As Long
Private qfxpHookData(4) As Byte
Private g_MapAddress() As Long
Private g_MapModify() As String
Private g_MapOld() As String
'检测进程打开标志
Private g_OpenTag As Boolean
Private g_HookTag As Boolean
Private Sub chkmap_Click(Index As Integer)
    If g_HookTag = True And g_OpenTag = True Then
      If chkmap(Index).Value = 1 Then
            WriteCode g_MapAddress(Index), g_MapModify(Index)
      Else
            WriteCode g_MapAddress(Index), g_MapOld(Index)
      End If
    End If
End Sub
'Timer过程用于检测游戏进程
Private Sub chkTimer_Timer()
    Dim g_hWnd As Long, g_Ver As String, i As Integer
    Static DeyTime As Long
    g_hWnd = FindWindow("SANGUO", vbNullString)
    If g_hWnd <> 0 Then
      If g_OpenTag = False Then
            Label1(0).Visible = True
            DeyTime = DeyTime + 1
            Label1(0).Caption = "全图打开倒计时:" & 100 - DeyTime
            If DeyTime > 100 Then
               
                Call GetWindowThreadProcessId(g_hWnd, g_Pid)
                g_Handle = OpenProcess(PROCESS_ALL_ACCESS, False, g_Pid)
                g_Ver = GetGameVer
                If SetGameHook(g_Ver) = True Then
                  g_HookTag = True
                  For i = 0 To 4
                        If chkmap(i).Value = 1 Then
                            WriteCode g_MapAddress(i), g_MapModify(i)
                        Else
                            WriteCode g_MapAddress(i), g_MapOld(i)
                        End If
                  Next
                  lblcheck = "游戏运行中,版本(" & g_Ver & "),支持,正常使用..."
                  lblcheck.ForeColor = RGB(255, 0, 0)
                Else
                  lblcheck = "游戏运行中,但版本(" & g_Ver & "),不支持,需要更新..."
就是这个,只发了一部分,如何编译,会编译的联系我!

fh9hut6jmd 发表于 2015-8-1 09:58:18

页: [1]
查看完整版本: 大家来看看这个是VB代码吗?9)、、