Ergebnis 1 bis 3 von 3
  1. #1
    Sobig Wurm Avatar von Bl1zz4rD
    Registriert seit
    28.10.2008
    Beiträge
    226

    Standard [Vbnet Frage:] ProcessModule.BaseAddress

    Hallo,

    seit einem Patch von einem Spiel haben die nun "ASLR".
    Somit muss man nun Spiel.exe + Offset rechnen.

    Auf MSDN | Microsoft Development, Subscriptions, Resources, and More hab ich schon was dazu gefunden:

    Code:
    Dim myProcess As New Process()
    ' Get the process start information of notepad.
    Dim myProcessStartInfo As New ProcessStartInfo("notepad.exe")
    ' Assign 'StartInfo' of notepad to 'StartInfo' of 'myProcess' object.
    myProcess.StartInfo = myProcessStartInfo
    ' Create a notepad.
    myProcess.Start()
    System.Threading.Thread.Sleep(1000)
    Dim myProcessModule As ProcessModule
    ' Get all the modules associated with 'myProcess'.
    Dim myProcessModuleCollection As ProcessModuleCollection = myProcess.Modules
    Console.WriteLine("Base addresses of the modules associated " + _
                         "with 'notepad' are:")
    ' Display the 'BaseAddress' of each of the modules.
    Dim i As Integer
    For i = 0 To myProcessModuleCollection.Count - 1
       myProcessModule = myProcessModuleCollection(i)
       Console.WriteLine(myProcessModule.ModuleName + " : " + _
                         myProcessModule.BaseAddress.ToString())
    Next i
    ' Get the main module associated with 'myProcess'.
    myProcessModule = myProcess.MainModule
    ' Display the 'BaseAddress' of the main module.
    Console.WriteLine("The process's main module's base address is: " + _
                      myProcessModule.BaseAddress.ToString())
    myProcess.CloseMainWindow()
    Aber das funktioniert irgendwie nur mit Notepad und auch nur wenn es sich in dem moment auch startet, ich will aber eigentlich nur die BaseAddress vom Spiel und zwar auch nur von der, der in der Combobox steht (PID - Process ID)

    640 Kilobyte RAM sind genug für jeden. (Bill Gates, 1981)

    BM-Profil
    0 | 0 | 6


  2. #2
    Anfänger Avatar von The_Funeral
    Registriert seit
    18.02.2008
    Beiträge
    17

    Standard

    Wenn ich dich halbwegs richtig verstehe willst du so etwas in der Art:
    (Der Code ist zu ~80 von ProcessModule.BaseAddress-Eigenschaft (System.Diagnostics) ). Musste nur ein paar kleine Veränderungen durchnehmen.

    Evtl. Gibt es noch elegantere Methoden.

    Code:
        class BaseAdresse
        {
            static void Main(string[] args)
            {
                foreach(Process _process in Process.GetProcessesByName("firefox")) //change in our GameName
                {
                    GetBaseAddress(_process.Id, _process.ProcessName);
                }
            }
    
            private static void GetBaseAddress(int ProcessID, string ProcessName)
            {
                Process myProcess = Process.GetProcessById(ProcessID);
    
                ProcessModule myProcessModule;
                // Get all the modules associated with 'myProcess'.
                ProcessModuleCollection myProcessModuleCollection = myProcess.Modules;
                Console.WriteLine("Base addresses of the modules associated "
                   + "with "+ ProcessName+" are:");
                // Display the 'BaseAddress' of each of the modules.
                for (int i = 0; i < myProcessModuleCollection.Count; i++)
                {
                    myProcessModule = myProcessModuleCollection[i];
                    Console.WriteLine(myProcessModule.ModuleName + " : "
                       + myProcessModule.BaseAddress);
                }
                // Get the main module associated with 'myProcess'.
                myProcessModule = myProcess.MainModule;
                // Display the 'BaseAddress' of the main module.
                Console.WriteLine("The process's main module's base address is: "
                   + myProcessModule.BaseAddress);
                
                //myProcess.CloseMainWindow();
                Console.ReadLine();
            }
        }
    Ich denke den VB Code kannst du dir davon ableiten, bzw konvertieren...
    Geändert von The_Funeral (20.10.2010 um 14:26 Uhr) Grund: Konvertierung...
    Suche: Alles zu C#
    Biete keinen Treuhandservice!

  3. Folgende Benutzer haben sich für diesen Beitrag bedankt:

    Bl1zz4rD (20.10.2010)

  4. #3
    Sobig Wurm Avatar von Bl1zz4rD
    Registriert seit
    28.10.2008
    Beiträge
    226

    Standard

    Zitat Zitat von The_Funeral Beitrag anzeigen
    Wenn ich dich halbwegs richtig verstehe willst du so etwas in der Art:
    (Der Code ist zu ~80 von ProcessModule.BaseAddress-Eigenschaft (System.Diagnostics) ). Musste nur ein paar kleine Veränderungen durchnehmen.

    Evtl. Gibt es noch elegantere Methoden.

    Code:
        class BaseAdresse
        {
            static void Main(string[] args)
            {
                foreach(Process _process in Process.GetProcessesByName("firefox")) //change in our GameName
                {
                    GetBaseAddress(_process.Id, _process.ProcessName);
                }
            }
    
            private static void GetBaseAddress(int ProcessID, string ProcessName)
            {
                Process myProcess = Process.GetProcessById(ProcessID);
    
                ProcessModule myProcessModule;
                // Get all the modules associated with 'myProcess'.
                ProcessModuleCollection myProcessModuleCollection = myProcess.Modules;
                Console.WriteLine("Base addresses of the modules associated "
                   + "with "+ ProcessName+" are:");
                // Display the 'BaseAddress' of each of the modules.
                for (int i = 0; i < myProcessModuleCollection.Count; i++)
                {
                    myProcessModule = myProcessModuleCollection[i];
                    Console.WriteLine(myProcessModule.ModuleName + " : "
                       + myProcessModule.BaseAddress);
                }
                // Get the main module associated with 'myProcess'.
                myProcessModule = myProcess.MainModule;
                // Display the 'BaseAddress' of the main module.
                Console.WriteLine("The process's main module's base address is: "
                   + myProcessModule.BaseAddress);
                
                //myProcess.CloseMainWindow();
                Console.ReadLine();
            }
        }
    Ich denke den VB Code kannst du dir davon ableiten, bzw konvertieren...
    Klappt wunderbar.
    Dann kann es geclosed werden

    640 Kilobyte RAM sind genug für jeden. (Bill Gates, 1981)

    BM-Profil
    0 | 0 | 6


Ähnliche Themen

  1. Frage
    Von M@5+er_of_De5a5+er im Forum Trashbox
    Antworten: 8
    Letzter Beitrag: 13.05.2010, 14:23
  2. Frage zu TOR
    Von nrxpro im Forum Anonymität & Proxies
    Antworten: 6
    Letzter Beitrag: 27.04.2010, 00:40
  3. [VBNet] XML Datei speichern
    Von Devilworld im Forum VisualBasic
    Antworten: 0
    Letzter Beitrag: 27.06.2009, 15:22
  4. [FRAGE]Hoch-Sicherheits-Passwort??[FRAGE]
    Von Mﮇx ǿηe im Forum Sicherheit
    Antworten: 24
    Letzter Beitrag: 12.11.2008, 22:06
  5. bat -> exe Frage
    Von nemo im Forum Sonstige Programmiersprachen
    Antworten: 8
    Letzter Beitrag: 26.09.2007, 21:44

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •