|
本帖最后由 FAAW2200 于 2023-6-28 01:58 编辑
關於WriteProcessMemory 部分內存無法寫入
使用CE搜尋 是不可寫入的地址 然後使用CE可以更改數據
但是使用VB ReadProcessMemory WriteProcessMemory
ReadProcessMemory 可以讀取到數據
WriteProcessMemory 無法寫入 確定 其他可寫入地址可更改數據
為什麼使用CE就可更改 自己用VB寫的 卻無法更改
部分程式碼
- Private Const PROCESS_ALL_ACCESS = &H1F0FFF
- Declare Auto Function WriteMemoryInt Lib "kernel32" Alias "WriteProcessMemory" (ByVal hwnd As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
- Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As Integer) As IntPtr
- Dim PId As Long
- Private Declare Auto Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As IntPtr
- Public Enum PROCESS_ACCESS As Integer
- ' Specifies all possible access flags for the process object.
- PROCESS_ALL_ACCESS = &H1F0FFF
- ' Enables using the process handle in the CreateRemoteThread function
- ' to create a thread in the process.
- PROCESS_CREATE_THREAD = &H2
- ' Enables using the process handle as either the source or
- ' target process in the DuplicateHandle function to duplicate a handle.
- PROCESS_DUP_HANDLE = &H40
- ' Enables using the process handle in the GetExitCodeProcess and
- ' GetPriorityClass functions to read information from the process object.
- PROCESS_QUERY_INFORMATION = &H400
- ' Enables using the process handle in the SetPriorityClass function to
- ' set the priority class of the process.
- PROCESS_SET_INFORMATION = &H200
- ' Enables using the process handle in the TerminateProcess function to
- ' terminate the process.
- PROCESS_TERMINATE = &H1
- ' Enables using the process handle in the VirtualProtectEx and
- ' WriteProcessMemory functions to modify the virtual memory of the process.
- PROCESS_VM_OPERATION = &H8
- ' Enables using the process handle in the ReadProcessMemory function to
- ' read from the virtual memory of the process.
- PROCESS_VM_READ = &H10
- ' Enables using the process handle in the WriteProcessMemory function to
- ' write to the virtual memory of the process.
- PROCESS_VM_WRITE = &H20
- ' Enables using the process handle in any of the wait functions to wait
- ' for the process to terminate.
- SYNCHRONIZE = &H100000
- End Enum
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim hProcess1 As Integer
- GetWindowThreadProcessId(窗口編號.Text, PId)
- hProcess1 = OpenProcess(PROCESS_ALL_ACCESS, False, PId)
- WriteMemoryInt(hProcess1, 地址, "7", 4, 0)
- End Sub
复制代码 |
上一篇: raw sock关联icop 接收不了数据下一篇: 零基础C++入门教程后面的每一课课后作业答案在哪里呢
|