Modify objects in memory

Help
NaZAf
2008-03-22
2013-03-24
  • NaZAf

    NaZAf - 2008-03-22

    Hi,
    You could at least make it possible to modify objects and local variables values in memory at runtime.

    anyway, Good work!

     
    • Petrény Zsolt

      Petrény Zsolt - 2008-03-22

      Hi nazaf,

      First of all, thank you for using DILE. :-)

      No doubt that would be a very useful feature however there are 2 main reasons why I haven't added it yet:
      1. I was simply lazy. Sorry. :-)
      2. It would make hackers' task lot easier. Unfortunately, DILE already makes hackers' life easier despite that I rather make this program for developers like me. Being able to debug an application without source code is already a huge advantage for them and I don't want to help them any further (I wish they couldn't use this tool at all).

      Regards,
        Zsolt Petreny

      P.S.: DILE allows calling methods of objects therefore it is possible to change the value of a property that has set method. Let's say, we have the following Bar class:
      public class Bar
      {
        private int foo;
        public int Foo
        {
          get
          {
            return foo;
          }
          set
          {
            foo = value;
          }
        }
      }

      And we have a very simple console application that creates an instance of this class and writes the value of Foo to the console:
      public class Program
      {
        private static void Main(string[] args)
        {
          Bar bar = new Bar();

          Console.WriteLine(bar.Foo);
          Console.ReadLine();
        }
      }

      If you load this into DILE, start it and step over the IL code until you reach the line where a new Bar instance is created, then you will be able to change the value of Foo by typing the following expression into the Object Viewer:
      V_0.set_Foo(5)

      This will set Foo's value to 5 and if you let the application run then you will see that 5 will be printed to the console.
      Of course, this only works for properties...

       

Log in to post a comment.