Log in

View Full Version : Symbolic code labels during debug


true_ruf
September 12th, 2006, 11:50
Hi, this is a question regarding masm, link and ollydbg. The problem I have is I am not able to see the symbolic code labels I use in the assembler programs. For example if I compile the following program:

Code:

.386
.model flat, stdcall
ExitProcess PROTO, dwExitCodeWORD

.data
list DD 10, 2, 35, 4, 5, 6, 7

.code
_Init:
push offset list
call Dummy

push 0
call ExitProcess

Dummy PROC
jmp Dummy_label
Dummy_label:
ret 4
Dummy ENDP

END _Init


OllyDbg shows the following:

Code:

00401010 >/$ 68 00404000 push offset list
00401015 |. E8 07000000 call Dummy
0040101A |. 6A 00 push 0
0040101C \. E8 0B000000 call ExitProcess
00401021 >/$ EB 00 jmp short 00401023
00401023 \> C2 0400 ret 4


And as you can see Dummy_label is missing. I am using the following command line for the compilation and linking:

ml /Zi /c /Cp /Zd /coff /Cp /Fm /FR test.asm
link /debug /subsystem:console test.obj kernel32.lib

It would be great if anyone could help me. Im trying to use OllyDbg as a tool to help teach assembler and I think this is important. By the way, if I compile using tasm I am able to see symbolic code labels but would like to use masm.

Thx in advance.

fr33ke
September 12th, 2006, 15:34
A workaround would be to save a MAP file during compilation, and then load that in Ollydbg with a plugin like GODUP.

TempoMat
September 13th, 2006, 01:05
@tru_ruf:
Your dummy_label is not missing at all.

The lines lets call it Syntax 1->
Dummy_label:
ret 4

could also be written as Syntax 2->
Dummy_label: ret 4

So "jmp short 00401023" is an exact interpretation of syntax 2, which is what you coded using syntax 1.

Cheers.

true_ruf
September 13th, 2006, 02:56
Firstly, thx for ur answers

Quote:
[Originally Posted by fr33ke]
A workaround would be to save a MAP file during compilation, and then load that in Ollydbg with a plugin like GODUP.


Yes i have thought about it but would like to know if there is an easier way.


Quote:
[Originally Posted by TempoMat]@tru_ruf:
Your dummy_label is not missing at all.

The lines lets call it Syntax 1->
Dummy_label:
ret 4

could also be written as Syntax 2->
Dummy_label: ret 4

So "jmp short 00401023" is an exact interpretation of syntax 2, which is what you coded using syntax 1.

Cheers.


Yup, i see ur point, but my question is if i could see "jmp Dummy_label" during debuging. I can see it if i compile using tasm but would like to change to masm (may be to do some 64 bits programming). I think "jmp short 00401023", although an exact interpretation, is more difficult to understand than using the label, remember i want to use it for teaching.