Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How can i change values in a program's memory?

How can i change values in a program's memory?

Scheduled Pinned Locked Moved C#
questionperformancetutorial
11 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sharpiesharpie
    wrote on last edited by
    #1

    let's say i want to go to address 377DC in program.exe and change it's value to 60? (just a fictional example), how can I do it?

    J S 2 Replies Last reply
    0
    • S sharpiesharpie

      let's say i want to go to address 377DC in program.exe and change it's value to 60? (just a fictional example), how can I do it?

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      You can acquire pointers to memory locations use standard pointer syntax ala C++. It just has to be done in an unsafe context using the unsafe keyword.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: How men in the Catholic Church replaced Passover with Easter The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      S 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        You can acquire pointers to memory locations use standard pointer syntax ala C++. It just has to be done in an unsafe context using the unsafe keyword.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: How men in the Catholic Church replaced Passover with Easter The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        S Offline
        S Offline
        sharpiesharpie
        wrote on last edited by
        #3

        um..have you got any examples? cause i haven't been able to find any references to that subject

        C 1 Reply Last reply
        0
        • S sharpiesharpie

          let's say i want to go to address 377DC in program.exe and change it's value to 60? (just a fictional example), how can I do it?

          S Offline
          S Offline
          sthotakura
          wrote on last edited by
          #4

          Are you trying to change something in some other running program? Or you trying to this in an application written by you?

          S 1 Reply Last reply
          0
          • S sharpiesharpie

            um..have you got any examples? cause i haven't been able to find any references to that subject

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            sharpiesharpie wrote:

            i haven't been able to find any references to that subject

            What did you search on? MSDN: unsafe[^]


            Upcoming events: * Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

            1 Reply Last reply
            0
            • S sthotakura

              Are you trying to change something in some other running program? Or you trying to this in an application written by you?

              S Offline
              S Offline
              sharpiesharpie
              wrote on last edited by
              #6

              In another program (games). I just want to learn the whole thing (used to build trainers etc.).

              S 1 Reply Last reply
              0
              • S sharpiesharpie

                In another program (games). I just want to learn the whole thing (used to build trainers etc.).

                S Offline
                S Offline
                sthotakura
                wrote on last edited by
                #7

                I knew that you can use DLL Injection in VC++ however I am not sure how to achive it in VC#. btw I dont think you can do it in any NT based OS. That is the security model to stop one process to modify(tamper) some other process unless explicitly allowed. Cheers, Suresh

                S 1 Reply Last reply
                0
                • S sthotakura

                  I knew that you can use DLL Injection in VC++ however I am not sure how to achive it in VC#. btw I dont think you can do it in any NT based OS. That is the security model to stop one process to modify(tamper) some other process unless explicitly allowed. Cheers, Suresh

                  S Offline
                  S Offline
                  sharpiesharpie
                  wrote on last edited by
                  #8

                  lol...ever heard of trainers? and you don't even have to go that far, just google "TSearch"...a memory searcher used to search a program's memory and change values in it.

                  S 1 Reply Last reply
                  0
                  • S sharpiesharpie

                    lol...ever heard of trainers? and you don't even have to go that far, just google "TSearch"...a memory searcher used to search a program's memory and change values in it.

                    S Offline
                    S Offline
                    sthotakura
                    wrote on last edited by
                    #9

                    Excellent!! Cheers

                    S 1 Reply Last reply
                    0
                    • S sthotakura

                      Excellent!! Cheers

                      S Offline
                      S Offline
                      sharpiesharpie
                      wrote on last edited by
                      #10

                      It's not excellent...it doesn't help me >< I still need to know how to do it \=

                      D 1 Reply Last reply
                      0
                      • S sharpiesharpie

                        It's not excellent...it doesn't help me >< I still need to know how to do it \=

                        D Offline
                        D Offline
                        Daniel Grunwald
                        wrote on last edited by
                        #11

                        A process can only access its own memory, so you need to inject a library into the target process. I don't think you can inject the .NET runtime into a running process (though another injected library may load .NET), so what you're trying to do is probably impossible with C#. There are articles here on CodeProject that show how to do it with C++.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups