Author Topic: 64 bit debuggers for masm 64  (Read 580 times)

markallyn

  • Member
  • **
  • Posts: 63
64 bit debuggers for masm 64
« on: October 01, 2017, 08:30:44 AM »
Hello everyone,

I am to trying to use Windbg (64-bit).  I have Windbg running, but I don't know how to provide it with debug symbols.  I'm assembling with ml64.exe and linking with polink.  What switches do I need to set?  I've exhausted my ability to Google on this one.

Thanks,
Mark Allyn

felipe

  • Member
  • ***
  • Posts: 283
  • I love assembly language programming.
Re: 64 bit debuggers for masm 64
« Reply #1 on: October 01, 2017, 03:29:42 PM »
I think aw27 knows a lot of windbg. But if it's too complicated to start with, you can try x64dbg instead.  ;)
Felipe.

sinsi

  • Member
  • ****
  • Posts: 996
Re: 64 bit debuggers for masm 64
« Reply #2 on: October 01, 2017, 04:09:26 PM »
Do you mean using the Microsoft symbols? That uses an environment variable
Quote
_NT_SYMBOL_PATH=srv*c:\symbols*http://msdl.microsoft.com/download/symbols

Windbg should load the pdb file from the program directory automatically.
I can walk on water but stagger on beer.

Vortex

  • Member
  • *****
  • Posts: 1704
Re: 64 bit debuggers for masm 64
« Reply #3 on: October 01, 2017, 06:50:42 PM »
Hi markallyn,

I use x64dbg. It's a very good tool.

aw27

  • Member
  • ****
  • Posts: 709
Re: 64 bit debuggers for masm 64
« Reply #4 on: October 01, 2017, 07:56:49 PM »
I think aw27 knows a lot of windbg.
Nobody knows a lot about Windbg, it has infinite possibilities.  :icon_rolleyes:
The most import first step is to get a decent Workspace. A suggestion is this one.

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #5 on: October 02, 2017, 03:14:56 AM »
Thanks all of you for trying to help-

Sinsi:  How do I get a PDB file from Polink?  There seems to be no /PDB switch.

Vortex and Felipe:  I've tried to install x64dbg, but when I unzip to the window where I am supposed to be able to launch x64, nothing happens when I click on that button.  Can you suggest what I should do?

Thanks again for your help.

Mark Allyn

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #6 on: October 02, 2017, 03:30:13 AM »
Hello Sinsi,

Also, I am using Polink because when I try to generate a PDB file from link.exe the linker kicks out the following fatal error message:  "incorrect MSPD100.DLL version: recheck installation of this product".  There is a dll by that name in the directory with the link executable, by the way.

Mark

felipe

  • Member
  • ***
  • Posts: 283
  • I love assembly language programming.
Re: 64 bit debuggers for masm 64
« Reply #7 on: October 02, 2017, 04:36:22 AM »
Sorry, i have installed (but don't remember, maybe there is nothing to install) x32dbg and x64dbg some months ago and can't remember right now how i did it. Also i don't have the time now for doing it again. Try to check the debbuger page for instructions.  :idea:
Felipe.

Vortex

  • Member
  • *****
  • Posts: 1704
Re: 64 bit debuggers for masm 64
« Reply #8 on: October 02, 2017, 05:18:56 AM »
Hi mark,

x64dbg is a portable application. Downloaded today the latest version snapshot_2017-09-12_00-45.zip and extracted the content to the folder C:\x64dbg

Executing the 64-bit debugger :

Code: [Select]
C:\x64dbg\release\x64\x64dbg.exe

LiaoMi

  • Member
  • **
  • Posts: 145
Re: 64 bit debuggers for masm 64
« Reply #9 on: October 02, 2017, 05:23:07 AM »
Hi mark,

x64dbg is a portable application. Downloaded today the latest version snapshot_2017-09-12_00-45.zip and extracted the content to the folder C:\x64dbg

Executing the 64-bit debugger :

Code: [Select]
C:\x64dbg\release\x64\x64dbg.exe

snapshot_2017-09-30_14-39.zip  ::)

Vortex

  • Member
  • *****
  • Posts: 1704
Re: 64 bit debuggers for masm 64
« Reply #10 on: October 02, 2017, 05:28:27 AM »
Here, the latest release dates September 12 ( snapshot_2017-09-12_00-45.zip ) :

https://sourceforge.net/projects/x64dbg/files/snapshots/

Checking github, the latest release is snapshot_2017-10-01_14-37.zip :

https://github.com/x64dbg/x64dbg/releases

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: 64 bit debuggers for masm 64
« Reply #11 on: October 02, 2017, 08:06:31 AM »
The x64dbg design was ruthlessly stolen from Olly, with one important difference: To make x64dbg work properly, you need to set SkipInt3Stepping=1 in x64dbg.ini; otherwise it will get stuck at your int 3.

sinsi

  • Member
  • ****
  • Posts: 996
Re: 64 bit debuggers for masm 64
« Reply #12 on: October 02, 2017, 09:02:13 AM »
Hi Mark,
I don't use polink but mslink uses two switches, /debug /debugtype:coff
I can walk on water but stagger on beer.

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: 64 bit debuggers for masm 64
« Reply #13 on: October 02, 2017, 10:25:18 AM »
Apparently, /Zi /Zf for the assembler and /debug for the linker are enough.

I've installed the latest x64dbg now, and it works most of the time (on my Win7-64 machine, x64dbg often crashes on exit; it has problems saving its database); here is a testbed, paste in RichMasm and hit F6.

include \Masm32\MasmBasic\Res\JBasic.inc        ; install
Init           ; OPT_64 1      ; in RichMasm, hit F6 to launch \Masm32\x64Dbg\release\x64\x64dbg.exe
  int 3
  PrintLine Chr$("This code was assembled with ", @AsmUsed$(1), " in ", jbit$, "-bit format")
  MsgBox 0, "Wow, it works!!!!", "Hi", MB_OK or MB_SETFOREGROUND
EndOfCode

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #14 on: October 02, 2017, 11:28:19 AM »
Hello everyone,

Thanks to all of you for helping out on this.  Here is current status.

After struggling with the x64dbg zip file I finally--though I can't quite figure out how--managed to install it.  It seems to run OK.  Question:  what switches do I need in ml64.exe and polink in order to get usable debug information?  Polink objects strongly to using the /DEBUG switch and complains about codeview symbols being present in the .obj file.  What's with that?  It complains even when I don't use /Zi and /Zd in the assemble step.  Perhaps a different linker?

Sinsi: Someday when I've grown up I will try again to do Windbg, but until I can figure out what's going on with this MSPDB100.DLL that seems to be a dead end.  This problem, as mentioned earlier, is why I turned to Polink.

jj2007:  I am hunting for x64dbg.ini.  Haven't found it yet.

I'm still not there yet, but pluggin' away.

Mark