Using the Optimizing VC7 compiler with the VC6 IDE,with DEBUGGING
you may contact him at: ywjheart ## gmail.com (replace ## to @)
from the source of atl/mfc in vc7x series,wo can see something interesting,that vc7 is able to output pdb files in the format used in vc6,the options is as following:
however,vc7 toolset refuse the options if we add to commandline.
They lie to us,in fact,after debugging,we know M$ close the interface in commandline,but leave the functions in binaries.
OK,let’s patch the toolset,in order to reenable the capability we need.
1.install vc2003toolkit(any vc2003 edition is ok,and psdk/ddk 2003 also has these files),i’ll use the toolset unpack from vc2003sp1,it’s the lastest version.
copy the following files to C:Program FilesMicrosoft Visual StudioVC98bin,don’t forget to backup files from vc6!
2. take a copy of the mspdb60.dll from PSDK/DDK2003,its version should equal to 6.2
3. hex editor
1.1 modify the compiler front end
c1.dll in offset 78a11,change 0 to 1;
c1xx.dll in offset 18D3B1,change 0 to 1;
1.2 modify the compiler back end
c2.dll in offset 744C,change 1D to 3D;
2. modify the linker
from 2a4dc to 2a4e7
original: 8A 98 60 01 00 00 84 DB
after patch: B3 01 88 98 60 01 00 00
3.open c1.dll,c1xx.dll,c2.dll,cl.exe,link.exe in a hex editor
replace all string "mspdb71.dll" to "mspdb60.dll"
5.copy the mspdb60.dll v6.2 to bin folder.
all done.now you can new a console project, and build the debug configuration,open the output file in a hex editor,you can find the signature of the old pdb format,"NB10",set a break in the function "main",and press F5, after break,you can see variables,callstack,and etc.