Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 06-23-2006, 03:17
tbone
 
Posts: n/a
Quote:
Originally Posted by Fade
So I was wondering, if I know the place in memory where v6.17 is stored, is there a way I can find where it is referenced in the program?
It may not have been necessary this time, but for future reference, I think this is an important question to answer.

The short answer is to set a memory breakpoint (on access) on the first byte of the string, and wait for something to read or write to it. Since the program is probably manipulating strings through library calls (ex. wsprintf), there's a good chance that your debugger will break somewhere inside of a system dll or library runtime (msvcrt, vbrun60, etc.) instead of the main module. You'll have to examine the return addresses of each stack frame to work your way back up to the relevant code in the target application.

The long answer is that Ollydbg has two kinds of memory breakpoints for breaking on an individual address. The hardware breakpoint option is a conventional memory breakpoint, analoguous to using "bpm ..." in SoftICE, except that it sets them through the windows debugging API instead of directly modifying the debug registers (forbidden for ring-3 code). The other option ("memory, on access/write" in the context menu) is something else altogether. When you use this option, Olly prohibits the corresponding operation by changing the attributes of the entire page containing the address (4k page minimum on x86 systems). This raises an exception every time that any address in that page is accessed/written to, not just the one you set the breakpoint on. Olly basically ignores all the other exceptions for you, and only halts when the exception is raised while messing with the breakpoint'd address.

This approach is novel, and can be very useful, but I tend to avoid using it unless other approaches don't work. Two problems: one is that this approach can have major performance impact because of all the "false positives" that have be dealt with. Secondly, this approach can also trip up certain kinds of programs, causing crashes or triggering a protector. You're also limited to only a single breakpoint of this kind at any given time, although the interface doesn't make this clear. On the other hand, the fact that it isn't implemented through the normal mechanisms is sometimes exactly what you need to avoid detection. YMMV.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced IdaPython to change details UI cannot change chants General Discussion 1 07-31-2019 15:46
Banned on IRC with Mirc cesarapodaca General Discussion 6 06-29-2014 19:53


All times are GMT +8. The time now is 23:26.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )