CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Location
    California
    Posts
    136

    debugging problem with Visual Studio 2005

    Hi all,

    I am debugging a buffer overflow, and I am having a lot of difficulty in finding out where the bug is at.

    I have a pointer points to the memory address 0x013d1218, but something is writing to it...
    The problem is that it is being written without a specific pattern (When I step through the code in debug mode, 0x013d1218 is being written by a different code sometimes...)
    Let's say line 100 wrote to 0x013d1218, so I would set a break point at line 100, but the next time I run the program, line 200 writes to 0x013d1218 instead of line 100...

    It's pretty frustrating to debug this, so I am wondering if VS2005 has a tool that shows which code wrote to the memory

    Thank you,
    kab

  2. #2
    Join Date
    Mar 2004
    Location
    KL, Malaysia
    Posts
    63

    Re: debugging problem with Visual Studio 2005

    You can set your program to break execution when the memory at specified address changes, then trace the code back to see which line changes it.

    In VS2008 during debug, you can set that by going to Debug->New Breakpoint->New Data Breakpoint. I am not sure this feature is available in VS2005 though.

    Kevin Choong

  3. #3
    Join Date
    Jun 2007
    Location
    California
    Posts
    136

    Re: debugging problem with Visual Studio 2005

    Hey ckweius,

    Thank you so much for sharing this feature.
    It works in VS2005 as well, and I found the bug with it. )

    Thank you,
    kab

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured