
A few words about symbolic debugging 
           by Gij
------------------------------------

hi, Gij here, i'm writing this to make you a little bit more
informed. if you already know about symbolic debugging, there's
probably nothing new here for you, so continue on your quest
for knowledge elsewhere....

i'm willing to bet some of you, even the one's that have been
funking around with ASM and it's related uses ( i.e. cracking),
have never used s-ice for symbolic debugging.
too bad, your missing out on something.

originally, SoftIce was meant to be used for developers, to debug their
own application, in an environment where full source is available to them.
it's only us crackers that have made those endless lines of abstract ASM
code, the usually mode of operation for SoftIce.

of course, when u crack, the source code of the program isn't usually available
to you ( MIRC32 is an exception to that rule ), so when and what can u use 
the symbolic debugging of SoftIce for? why, educational anarchy of course!.

using SoftIce in symbolic debugging mode let's you:

1) see the source of the program inside the SoftIce code window , including 
   comments, be it written in ASM or c.

2) see how a code line in C translates into the equivalent ASM code.

3) be a little more knowledgable about the abilities of your debugger
   ( it never hurts to know more ).

so how is it done?
------------------
easy.

the whole point of symbolic debugging, is having more info available for the
debugger. this usually means, ( besides having the source files in a handy
place for the debugger ) adding debug info to the executable file. this
may sound complicated ( does it? ) , it usually just means adding another 
command-line switch to the compiler/assembler. unfortunately, at this time
i know no way of making NASM ( my favorite assembler: www.cryogen.com/NASM)
generating debug info into it's assembled files, so i'll give the switches
for what i know:

TASM
----
add /zi to the command-line.

Turbo C
-------
add -v to the command-line.

this is for DOS, but i know it works similarly in VC++ and BC++, just find
the check box in one of the menus, and check it.

Loading into SoftIce
------------------

DOS:
you folks, when loading DOS programs, probably use the command:
"LDR file.exe", this loads the exe into DOS, and gets you a nice
screen-full of ASM.

if your trying to start SoftIce in symbolic debugging mode, u should use:
"LDR file", that is without the extension of the file, do this in the
directory with the source files.
 
Win:
just use the sym-loader, that's what it's there for.
you might want to load the exports too, if your using some DLL's
in the program.

Great, i have it in symbol mode, Now what?
-------------------------------------------

once SoftIce is loaded, you should see, exactly, the contents of the source file
displayed. again, this can be either ASM or C source code.
now u can use the "SRC" command in SoftIce, this should flip you between
source,mixed,and code modes. 
you can use SoftIce in just the same way as you do in any other situation,
u can BPX on  functions (only now, u can use their given name), u can
BPM on variables ( only now u can use their name ), you can put WATCH slots
on variables (only now... you know), you can even find out the value a variable
contains by doing "? WORD(*(var_name))" ( you can also use BYTE,or DWORD,
depending on the var size).


Closing Arguments	 
-----------------

"sex-changed individuals winning international song competitions.... yeah,
 that's healthy." 

 now you know how to do it, glad to have helped.
 included is a file with C source code, and an exe file you can use to practice.
 use it wisely, my son.

 if you need to contact me, i can often be found on #cracking4newbies
 on EFNET.

 have a nice day.

	
snip,snip <<---------------------------

