Read others Process Memory?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GRABLER Georg

    #1

    Read others Process Memory?

    Hello everyone.

    A not too long time ago, i wrote a Post about "Reading process memory".

    Now, i got a good answer, about using the "marshal" class.

    I read over the class quickly, but i could not find a solution to write
    anothers process memory.

    As it was done in C++ (WinAPI)
    IntPtr hProcess

    where i can pass by a processes adress.

    Now, i read the Process-List with
    Process[] pArray = Process.GetProc essesByName("Ti bia");
    in C#

    As i found in the marshal class, the function ReadByte in the Marshal
    class would fit fine. But how to read of the process memory of the other
    Process? I cant find anything where ic an pass by a Process-Object or
    Object-Reference.

    Thank you,
    Grabler Georg

    PS: Sorry that i dont use a "real" E-Mail this time, last time i got
    spammed by hundreds of e-mails an hour with several viruses and other
    things.
    The ones who want to write an E-Mail, please to
    georg at grabler.net

  • Mattias Sjögren

    #2
    Re: Read others Process Memory?

    [color=blue]
    >Now, i got a good answer, about using the "marshal" class.[/color]

    I don't think it'll help you here. The Marshal class only works with
    addresses in your own process space.

    I think you have to use the ReadProcessMemo ry Win32 API, since there's
    no corresponding functionality in the BCL.



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    • Willy Denoyette [MVP]

      #3
      Re: Read others Process Memory?


      "GRABLER Georg" <mail@not.set > wrote in message
      news:uaIRxjwtDH A.1740@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Hello everyone.
      >
      > A not too long time ago, i wrote a Post about "Reading process memory".
      >
      > Now, i got a good answer, about using the "marshal" class.
      >
      > I read over the class quickly, but i could not find a solution to write
      > anothers process memory.
      >
      > As it was done in C++ (WinAPI)
      > IntPtr hProcess
      >
      > where i can pass by a processes adress.
      >
      > Now, i read the Process-List with
      > Process[] pArray = Process.GetProc essesByName("Ti bia");
      > in C#
      >
      > As i found in the marshal class, the function ReadByte in the Marshal
      > class would fit fine. But how to read of the process memory of the other
      > Process? I cant find anything where ic an pass by a Process-Object or
      > Object-Reference.
      >
      > Thank you,
      > Grabler Georg
      >
      > PS: Sorry that i dont use a "real" E-Mail this time, last time i got
      > spammed by hundreds of e-mails an hour with several viruses and other
      > things.
      > The ones who want to write an E-Mail, please to
      > georg at grabler.net
      >[/color]

      Not quite clear why you need to read another process memory, anyway you need
      to call the Win32 API "ReadProcessMem ory" using PInvoke.

      Willy.


      Comment

      • GRABLER Georg

        #4
        Re: Read others Process Memory?

        Willy Denoyette [MVP] wrote:[color=blue]
        > "GRABLER Georg" <mail@not.set > wrote in message
        > news:uaIRxjwtDH A.1740@TK2MSFTN GP12.phx.gbl...
        >[color=green]
        >>Hello everyone.
        >>
        >>A not too long time ago, i wrote a Post about "Reading process memory".
        >>
        >>Now, i got a good answer, about using the "marshal" class.
        >>
        >>I read over the class quickly, but i could not find a solution to write
        >>anothers process memory.
        >>
        >>As it was done in C++ (WinAPI)
        >>IntPtr hProcess
        >>
        >>where i can pass by a processes adress.
        >>
        >>Now, i read the Process-List with
        >>Process[] pArray = Process.GetProc essesByName("Ti bia");
        >>in C#
        >>
        >>As i found in the marshal class, the function ReadByte in the Marshal
        >>class would fit fine. But how to read of the process memory of the other
        >>Process? I cant find anything where ic an pass by a Process-Object or
        >>Object-Reference.
        >>
        >>Thank you,
        >>Grabler Georg
        >>
        >>PS: Sorry that i dont use a "real" E-Mail this time, last time i got
        >>spammed by hundreds of e-mails an hour with several viruses and other
        >>things.
        >>The ones who want to write an E-Mail, please to
        >>georg at grabler.net
        >>[/color]
        >
        >
        > Not quite clear why you need to read another process memory, anyway you need
        > to call the Win32 API "ReadProcessMem ory" using PInvoke.
        >
        > Willy.
        >
        >[/color]

        Thank you for your repiles.

        Reading and Writing other process memory is sometimes necessary for
        preventing gameservers opening direct3d windows where you can set the
        options. with writing in the others userspace i can tell, that i have
        set the options and finished with using the default values.

        Thank you for your replies, it makes me stop .NET development again.

        Grabler Georg

        Comment

        • Willy Denoyette [MVP]

          #5
          Re: Read others Process Memory?

          I thought that writing into another's process space was a privilege required
          by debuggers only ;-).
          What's your problem using PInvoke, and there is Managed C++ (which is also
          part of .NET.), just curious how did you manage this before .NET?

          Willy.

          "GRABLER Georg" <mail@not.set > wrote in message
          news:uKsWgD4tDH A.2088@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Willy Denoyette [MVP] wrote:[color=green]
          > > "GRABLER Georg" <mail@not.set > wrote in message
          > > news:uaIRxjwtDH A.1740@TK2MSFTN GP12.phx.gbl...
          > >[color=darkred]
          > >>Hello everyone.
          > >>
          > >>A not too long time ago, i wrote a Post about "Reading process memory".
          > >>
          > >>Now, i got a good answer, about using the "marshal" class.
          > >>
          > >>I read over the class quickly, but i could not find a solution to write
          > >>anothers process memory.
          > >>
          > >>As it was done in C++ (WinAPI)
          > >>IntPtr hProcess
          > >>
          > >>where i can pass by a processes adress.
          > >>
          > >>Now, i read the Process-List with
          > >>Process[] pArray = Process.GetProc essesByName("Ti bia");
          > >>in C#
          > >>
          > >>As i found in the marshal class, the function ReadByte in the Marshal
          > >>class would fit fine. But how to read of the process memory of the other
          > >>Process? I cant find anything where ic an pass by a Process-Object or
          > >>Object-Reference.
          > >>
          > >>Thank you,
          > >>Grabler Georg
          > >>
          > >>PS: Sorry that i dont use a "real" E-Mail this time, last time i got
          > >>spammed by hundreds of e-mails an hour with several viruses and other
          > >>things.
          > >>The ones who want to write an E-Mail, please to
          > >>georg at grabler.net
          > >>[/color]
          > >
          > >
          > > Not quite clear why you need to read another process memory, anyway you[/color][/color]
          need[color=blue][color=green]
          > > to call the Win32 API "ReadProcessMem ory" using PInvoke.
          > >
          > > Willy.
          > >
          > >[/color]
          >
          > Thank you for your repiles.
          >
          > Reading and Writing other process memory is sometimes necessary for
          > preventing gameservers opening direct3d windows where you can set the
          > options. with writing in the others userspace i can tell, that i have
          > set the options and finished with using the default values.
          >
          > Thank you for your replies, it makes me stop .NET development again.
          >
          > Grabler Georg
          >[/color]


          Comment

          Working...