News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

masm assembly as asm assembly

Started by thomas_remkus, January 20, 2007, 11:48:38 PM

Previous topic - Next topic

thomas_remkus

Is there a setting where I can get the MASM assembly to output an .ASM (or equ) file that is the assembly after all the macros? Or maybe, is there a way to have a debug version of my code so I can have all my comments in the code when I'm attempting to learn from the OllyDbg output?

BogdanOntanu

1)Yes, there is an option to generate a LISTING file and it has an sub option to expand all macros into the listing.

2)You can do a debug build that will contain references to the source line numbers and thus you can see your source and all variable names, arguments, labels and structures when debugging with OllyDbg.

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

jj2007

Anyone around who could give real advice here?
I am using OllyDbg 2.0 and this:

\masm32\bin\ml /nologo /Fl /c /coff /Zd /Zi /Fo test
\masm32\bin\link /SUBSYSTEM:Windows /DEBUG /DEBUGTYPE:COFF test.obj

EDIT: Olly help says Borland format is supported. Any way to get this format from Masm?

My exe is bloated three times, and contains the names of my global variables, but Olly still treats me with cryptic references:

CPU Disasm
Address   Hex dump          Command                     Comments
00401385  ³. 8945 F4        mov dword ptr ss:[local.4],
00401388  ³. C745 D0 0B0000 mov dword ptr ss:[local.13]

Furthermore, I can't get any code highlighting. EDIT: Solved! Do NOT expect the Options menu to do it for you; instead, right-click into the CPU window, submenu "appearance", sub-menu "highlighting"
Same applied to previous 1.1 version. Help greatly appreciated (not of the type: "Tip: check the command line options", please).

BogdanOntanu

Try this:


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


Open minimum.exe in Ollydbg and you should have symbols. Ollydbg expects PDB debug information. It works ok for Olly version 1.10.

You can also go to View->Source FIles and double click your main source file... then you will see the current source code line when steeping into the ASM code in the CPU panel.

Replace minimum.asm with your program....
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

jj2007

Quote from: BogdanOntanu on May 21, 2008, 05:45:33 AM
You can also go to View->Source FIles and double click your main source file...
No View->Source in my version. Is that an Add-In??

BogdanOntanu

No, no add-on. View->Source Files menu exists in Olly standard configuration.
Maybe you are not using OllyDbg version 1.10 ?

Here you have a picture: http://www.oby.ro/files/olly_src.png

Oh and BTW if you use this "command line" to compile:

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


Then you will also see the names of all symbols in the CPU panel.

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

Jimg

I have found that adding /Fl causes problems for no logical reason.  Try without it.

jj2007

Your combined hints plus my intuitive decision to try it with link instead of polink made it work in the end - thanxalot!