5

I am bring a .EXE, a .PDB, and a source code .C file into my computer and attempting to look at my program in Ollydbg.

I am compiling C programs on one machine (XP Vm actually) and running them in Ollydbg 2.01 in Windows 7 on another machine. I want to look at Release code, so I set the compile and link options as described in link. And so I have a 'prog.exe' and 'prog.pdb' in Win7 where Ollydbg is. I can launch prog.exe in Ollydbg and I see the labels for main() and my other functions, and can go to them with the CTRL+G "Enter Expression to Follow" dialog.

But I like to also see the associated source code line, to be able to see it below the code in the CPU window, and to be able to double-click and open the source code .C file.

But unless I recreate the entire same directory path in my Win7 (Olly) computer Olly can't get at this source code (even though it sees the label names for code blocks). I've spent some time looking through the settings in both Visual Studio (6 for me) to try not have absolute paths, and Olly to change where it looks. Any ideas?

1

pdb is self contained so you can drag and drop it and the debugger can utilize it
but src files are just path references
either relative or absolute paths
so either you have to copy them to a local directory
(think about feasibility of this with a project that has thousands of src files) or
set up the directory structure ( a bit easier if you did not compile in c:\ :) )
diskmgmt.msc wont let you change the drive letter for system boot partition )

if you were on a partition other than system boot partition
simply dump the directory from base to a removable drive and change the drive letter

or learn a bit of windbg's environment variables _NT_SOURCE_PATH , _NT_SYMBOL_PATH , and let ollydbg use the symsrv.dll from windbg directory

look at options -> debugging data -> tab

  • Junction points and ntsubst-like tools can always help to cheat your way out of the described conundrum. Unless, of course, you had your source code in something like C:\Windows\System32 ;) – 0xC0000022L Jun 19 '18 at 12:05
  • I have read this answer several times and still don't understand. I have no .PDB, just .EXE and .C - how do I tell it where my .C file is, so that I can breakpoint & step through the code? Thanks in advance – Mawg Jul 26 '18 at 7:14
  • 2
    no linkage exists between exe and source without pdb file so you cant tell ollydbg or for that matter any debugger without having debug symbol information – blabb Jul 26 '18 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.