RadASM and ollydbg and Symbol's

Started by Teloboy, May 18, 2008, 04:37:46 PM

Previous topic - Next topic

Teloboy

I am unable to get Ollydbg to use the local symbols generated when I use 'Run with debug'.
I have these in the project options :



link option   ----------     5,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /VERSION:4.0 /LIBPATH:"$L" /OUT:"$5",3,4

Run With Debug ----    0,0,"$E\OllyDbg",5

Anyone know what I am doing wrong ?


thanks

Mark Jones

Quote from: Teloboy on May 18, 2008, 04:37:46 PM
/DEBUGTYPE:CV

I thought OllyDbg did not support codeview format, but I could be wrong. Check Olly to make sure.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

BogdanOntanu

Olly does support PDB debug info

for example using minimum.asm example from in MASM32 if you build it like this:

\masm32\bin\ml /c  /Zd /coff minimum.asm
\masm32\bin\Link /SUBSYSTEM:WINDOWS  /DEBUG  minimum.obj


When you open minimum.exe in OllyDbg  you will see all of your source code symbols.

BTW this does not have a connection with RadASM.

Rad Asm is an IDE that handles source code stuff like: projects, code completion, code folding, API parameters, go to function definition and reference, view functions, variables, constants, macros, etc per file and per project, design dialogs and resources  etc; and it does this very good.

But for debugging you have to experiment with OllyDbg and understand your compiler and linker options.

Even more: if you go to Olly's View menu and choose Source Files and then click your source file it will show your source as you steep in code.

PS. There is only ONE people that knows what you are doing "wrong" and that one is YOU.



Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Teloboy

Thanks for that, I did try assembling/linking in a cmd window then trying ollydbg, but still had the same issue. I also looked under the view menu but there's no 'source files' option. the only option was files, which allowed you to bring up the asm files in a text window, which doesn't give the same result.  I am using version 2 on ollydbg, are you on a different version ?


BogdanOntanu

OllyDbg version 1.10

I have tested it and it does work.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Teloboy

I tried this on minimum.asm and couldn't see any lables however, when I looked at the source, it doesn't have any. so I modified it a little as follows :

; #########################################################################

      .386
      .model flat, stdcall
      option casemap :none   ; case sensitive

; #########################################################################

      include \masm32\include\windows.inc
      include \masm32\include\user32.inc
      include \masm32\include\kernel32.inc

      includelib \masm32\lib\user32.lib
      includelib \masm32\lib\kernel32.lib

; #########################################################################

    .code

start:

    jmp OverMe
      szDlgTitle    db "Minimum MASM",0
      szMsg         db "  --- Assembler Pure and Simple ---  ",0
    OverMe:

    push MB_OK
    push offset szDlgTitle
    push offset szMsg
    push 0
    call MessageBox

    push 0
    call ExitProcess

    ; --------------------------------------------------------
    ; The following are the same function calls using MASM
    ; "invoke" syntax. It is clearer code, it is type checked
    ; against a function prototype and it is less error prone.
    ; --------------------------------------------------------

    ; invoke MessageBox,0,ADDR szMsg,ADDR szDlgTitle,MB_OK
    ; invoke ExitProcess,0

end start

it now has a lable - OverMe. when I assemble and link it as follows :

\masm32\bin\ml /c  /Zd /coff minimum.asm
\masm32\bin\Link /SUBSYSTEM:WINDOWS  /DEBUG minimum.obj

and finally start the debugger
ollydbg.exe minimum.exe

now looking through all the windows etc., I am unable to find the lable OverMe.

what am I doing wrong ?

BogdanOntanu

change /Zd to /Zi in above command line and you will see the symbols ;)
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Teloboy

Thanks for the super quick response.....

just tried using Zi but still not seeing the lable OverMe. here's the listing :-

CPU Disasm
Address   Hex dump          Command                                  Comments
00401010  /> /EB 33         JMP SHORT 00401045
00401012  |. |4D 69 6E 69 6 ASCII "Minimum MASM",0
0040101F  |. |20 20 2D 2D 2 ASCII "  --- Assembler "
0040102F  |. |50 75 72 65 2 ASCII "Pure and Simple "
0040103F  |. |2D 2D 2D 20 2 ASCII "---  ",0
00401045  |> \6A 00         PUSH 0                                   ; /Type = MB_OK|MB_DEFBUTTON1|MB_APPLMODAL
00401047  |.  68 12104000   PUSH minimum.00401012                    ; |Caption = "Minimum MASM"
0040104C  |.  68 1F104000   PUSH minimum.0040101F                    ; |Text = "  --- Assembler Pure and Simple ---  "
00401051  |.  6A 00         PUSH 0                                   ; |hOwner = NULL
00401053  |.  E8 1A000000   CALL <JMP.&user32.MessageBoxA>           ; \USER32.MessageBoxA
00401058  |.  6A 00         PUSH 0                                   ; /ExitCode = 0
0040105A  |.  E8 19000000   CALL <JMP.&kernel32.ExitProcess>         ; \KERNEL32.ExitProcess
0040105F  |.  CC            INT3

Thanks

BogdanOntanu

Here you have a picture with Over_Me :

http://www.oby.ro/files/olly_dbg2.png

I have made the "Over_Me" label public and moved strings into .data section to simplify. Also the test for for jumping to Over_Me is dummy (will always fail).

The command line for building was:

del minimum.obj

\masm32\bin\ml /c /Zi /coff minimum.asm
\masm32\bin\Link /SUBSYSTEM:WINDOWS /DEBUG minimum.obj

pause


Probably there are many "variations" to my solution... experiment.

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Teloboy

Thanks for the screen shot, that help show me where to look. I deleted all files except the asm, recompiled and linked and it still didn't work. I then downloaded version 1.10 and that worked correctly, so it looks like its an issue with version 2.

I'll use 1.10 for a while.

Thanks again.....

Mark Jones

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

jj2007

Just to confirm that V2 has this problem - I went back to V1.1
The only advantage of V2 is that it has a better recognition of certain FPU opcodes.