Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Read Pointer + offset


Rekomendowane odpowiedzi

Opublikowano

Witajcie,
mam class:

 

Imports System.Runtime.InteropServices

Public Class readpointer
    Private ProcHandle As IntPtr
    Private ProcessName As String
    Public Const PROCESS_VM_OPERATION As UInteger = (&H8)
    Public Const PROCESS_VM_READ As UInteger = (&H10)
    Public Const PROCESS_VM_WRITE As UInteger = (&H20)
    <DllImport("kernel32.dll")> _
    Public Shared Function OpenProcess(ByVal dwDesiredAccess As UInt32, ByVal bInheritHandle As Int32, ByVal dwProcessId As UInt32) As IntPtr
    End Function

    <DllImport("kernel32.dll", SetLastError:=True)> _
    Public Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <Out()> ByVal lpBuffer As Byte(), ByVal dwSize As Integer, ByRef lpNumberOfBytesRead As Integer) As Boolean
    End Function

    Public Function GetMaplestory() As Integer
        Dim Success As Integer
        GetProcess = "nazwa procesu"
        OpenProcess()
        If OpenProcess() = -1 Then
            Success = 0
            Return Success
        Else
            Success = 1
            Return Success
        End If

    End Function

    Public Property GetProcess() As String
        Get
            Return ProcessName
        End Get
        Set(ByVal value As String)
            ProcessName = value
        End Set
    End Property

    Public Function OpenProcess() As Integer
        Dim ProcessArray As Process() = Process.GetProcessesByName(ProcessName)
        Dim sucess As Integer
        Try
            ProcHandle = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ Or PROCESS_VM_WRITE, 1, CUInt(ProcessArray(0).Id))
            sucess = 1
        Catch generatedExceptionName As IndexOutOfRangeException
            sucess = -1
        End Try
        Return sucess
    End Function

    Public Function ReadPointerFromMemory(ByVal BaseAddress As Integer, ByVal PointerOffset As Integer, ByVal BytesToRead As Integer) As Integer
        Dim BytesAtAddress As Byte() = New Byte(BytesToRead - 1) {}
        Dim BytesRead As Integer
        Dim MemoryBase As Integer
        Dim ReturnVal As Integer
        ReadProcessMemory(ProcHandle, CType(BaseAddress, IntPtr), BytesAtAddress, BytesToRead, BytesRead)
        MemoryBase = BitConverter.ToInt32(BytesAtAddress, 0)
        MemoryBase += PointerOffset
        ReadProcessMemory(ProcHandle, CType(MemoryBase, IntPtr), BytesAtAddress, BytesToRead, BytesRead)
        ReturnVal = BitConverter.ToInt32(BytesAtAddress, 0)
        Return ReturnVal
    End Function

    Public Function ReadPointer(ByVal Base As Integer, ByVal Offset As Integer) As Integer
        GetMaplestory()
        Dim Pointer As Integer
        Dim Final As Integer
        Pointer = ReadPointerFromMemory(Base, Offset, 4)
        Final = (Convert.ToInt32(Pointer))
        Return Final
    End Function
End Class 

 

I kod który ją wywołuje:

 

        Dim rp As New readpointer
        Label1.Text = rp.ReadPointer(&H3FCA60, &H240).ToString()

 

 

I zawsze zwraca do Label1=0 czemu?
­

Mój stary nick: damian5602
Nick League Of Legends: Sonaes

  • 2 tygodnie później...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...