www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - OllyDbg

reply Cauterite <cauterite gmail.com> writes:
I'm surprised OllyDbg hasn't been mentioned in this group before. 
For 32-bit Windows it's certainly a viable option; vastly 
preferable over WinDBG for sure.

Here's how I have it set up: http://imgur.com/53a4iUS
You can see its support for PDB debugging information, with the 
source listed next to the disassembly. Obviously you'll need to 
use cv2pdb to make use of it though.
(I don't enable the source view very often though, since it makes 
Olly crash fairly regularly on my system.)

When using OllyDbg it's useful to place breakpoints in the source 
code, since the hundreds of pages of disassembly can be hard to 
navigate; DebugBreak() from kernel32.dll serves this purpose.

Lastly, if you're considering using OllyDbg, first consider 
http://x64dbg.com/
I haven't tested it out much, but it seems to have a fairly 
similar feature set to Olly, with additional support for 64-bit 
code. Hopefully it's more stable too.
Sep 28 2015
parent reply Cauterite <cauterite gmail.com> writes:
I think I've managed to fix the crashes caused by loading PDB 
files. It was happening fairly often today, but I found some 
details here:
http://doar-e.github.io/blog/2013/09/09/pinpointing-heap-related-issues-ollydbg2-off-by-one-story/

OllyDbg is closed-source, so the fix involves editing the binary 
(just a single instruction though).

The decompiled code in the article shows this line:
	u->mem1_ov = (unsigned int *)Memalloc(12 * (nb_lines + 1), 3);
Increasing the size passed to Memalloc here seems to avoid the 
bug.
I did that by changing the instruction at 0x004CE5E3 from
	lea edx, [edx*2+edx]
to
	lea edx, [edx*4+edx]

The CRC32 of my original ollydbg.exe is 0x464dbcdb.
With this patch, it should become 0x8376f767.
Version is '2.01 (beta 2)', by the way.

Now OllyDbg reliably uses the debug data generated by cv2pdb for 
executables generated by DMD. I hope this fix works for you too.
Oct 21 2015
parent stew <growlercab gmail.com> writes:
On Wednesday, 21 October 2015 at 16:16:59 UTC, Cauterite wrote:
 I think I've managed to fix the crashes caused by loading PDB 
 files. It was happening fairly often today, but I found some 
 details here:
 http://doar-e.github.io/blog/2013/09/09/pinpointing-heap-related-issues-ollydbg2-off-by-one-story/

 [...]
Nice blog, thanks for sharing the info. Cheers Stew
Oct 21 2015