Author Topic: x64_dbg  (Read 17335 times)

shankle

  • Member
  • ****
  • Posts: 868
x64_dbg
« on: April 09, 2015, 09:29:14 PM »
I'm tired of the hassle of tying to debug 64-bit programs with messagebox.
x64_dbg (still under development) seemed like it would do what I want.
Show my code with symbols like softice used to do.
I tried putting the code in the linker to use the debugger and got an error.
"/debug/debugtype:cv/pdb"myproggie.pdb".

Question is now how to proceed. I think x64_dbg is not usable with GoLink.
It was suggested that I use other linkers.

Gunther

  • Member
  • *****
  • Posts: 4197
  • Forgive your enemies, but never forget their names
Re: x64_dbg
« Reply #1 on: April 10, 2015, 12:48:44 AM »
Hi shankle,

you could try jWlink instead. Here is a link for downloading it.

Gunther
You have to know the facts before you can distort them.

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #2 on: April 10, 2015, 02:18:56 AM »
Thank You Gunther for responding.
I know GoAsm has a program called GoDebug.
As far as I know it's only for 32-bit programs.
Am I correct???

Vortex

  • Member
  • *****
  • Posts: 2791
Re: x64_dbg
« Reply #3 on: April 10, 2015, 03:44:20 AM »
Hi shankle,

GoBug is only 32-bit :

Quote
Debugger - "GoBug" - A free Win32 symbolic debugger for assembler programmers, together with "Testbug" its accompanying test program and Win32+assembler demo program. It is itself written entirely in assembler, using my assembler GoAsm and my linker GoLink.
Go to the GoBug site for more details and for free download here.

http://www.godevtool.com/

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #4 on: April 10, 2015, 03:50:59 AM »
Thank you Vortex.
That settles that. Must learn to love the messagebox I guess.

fearless

  • Member
  • ****
  • Posts: 578
    • Github
Re: x64_dbg
« Reply #5 on: April 10, 2015, 09:33:43 PM »
messagebox is a painful way to debug, have you tried Donkey's vKim like tools: http://www.masmforum.com/board/index.php?topic=16317.0

also what is the output from the linker's when you used those arguments?

plus im wondering if there needs to be a space seperating the arguments, so:
Code: [Select]
/debug /debugtype:cv /pdb:"myproggie.pdb"
instead of
Code: [Select]
/debug/debugtype:cv/pdb"myproggie.pdb"and the pdb arg might need the : as well
try it with jwlink and link and post up the console output to see if we can help figure it out for you

fearless

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #6 on: April 11, 2015, 01:23:48 AM »
This is in reply to the request by Fearless.
In reference to Messageboxes: Painful  is hardly adequate.

Set INCLUDE=e:\codejps
Set PATH=e:\codejps
GoAsm /x64/b/c someP64.asm
GoLink /unused someP64.obj
/debug/debugtype:cv/pdb:someP64.pdb

This is what the above generated:
   E:\codejps>/debug /debugtype:cv/pdb:"someP64.pdb"
   '/debug' is not recognized as an internal or external command
   
   someP64 is in the codejps folder.
   Other programs work with the above minus the
   debug line.
   
Although I appreciate the work that Donkey has done
in the Vkim like tools and I applaud him for it,
it is way over my head.

I've never used jwlink.
   
« Last Edit: April 11, 2015, 03:47:21 AM by shankle »

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: x64_dbg
« Reply #7 on: April 11, 2015, 01:31:20 AM »
if you don't like message boxes...

it's easy to add a status bar
then, a simple macro to put text in it
nice thing about that is, you don't have to acknowledge it with a click

fearless

  • Member
  • ****
  • Posts: 578
    • Github
Re: x64_dbg
« Reply #8 on: April 11, 2015, 03:54:35 AM »
does it complain if you just put /debug/debugtype:cv ?

also maybe try and specify a complete path like e:\codejps\myproject\myproject.pdb for the /pdb: argument and see if it likes that.

The vKim like tools shouldnt be too difficult to include, just add (for x64) in your source .asm

Code: [Select]
   #define DBG64LIB "c:\GoAsm\dbg\Debug64.lib"
   #define DEBUGEXE "c:\GoAsm\dbg\DbgWin.exe"
   #include "c:\GoAsm\dbg\Debug64.a"

modify for where your GoAsm is, for example if its stored in codejps then create a dbg folder, and copy the .a, .lib and dbgwin.exe into it:

Code: [Select]
   #define DBG64LIB "e:\codejps\dbg\Debug64.lib"
   #define DEBUGEXE "e:\codejps\dbg\DbgWin.exe"
   #include "e:\codejps\dbg\Debug64.a"

For x64 the debug.a (or debug.inc for x86) has all the macros that you use in it.

so for x86 masm i would use stuff like

Code: [Select]
Invoke MessageBox, hWnd, Addr szMsg, Addr szTitle, MB_OK
PrintDec eax ; shows return value in the DbgWin.exe program that will popup - or if its already running.

for x64 i dont know the specifics and for use with goasm, but i would imagine youll be using PrintQWORD macro's to see returned values

Other useful ones are PrintString, PrintStringByAddr, DumpMem, DbgDump

Maybe worth trying it out, will be 100 x better than messageboxes if you get it working:D
fearless

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #9 on: April 11, 2015, 09:30:31 AM »
Thank you Fearless for responding.
I hate to see you spending so much time on this but I appreciate it.
answers:
    /debug/debugtype:cv  -- the system cannot find the path specified

    /debug /debugtype:cv/e:\codejps\someP.asm\someP.pdb -- /debug is not
    recognized as an internal or external command

   

adeyblue

  • Member
  • **
  • Posts: 89
    • Airesoft
Re: x64_dbg
« Reply #10 on: April 12, 2015, 02:27:32 AM »
Try placing it onto the end of the GoLink line of the batch file, instead of on its own line. It'ill probably require spaces before each / too

fearless

  • Member
  • ****
  • Posts: 578
    • Github
Re: x64_dbg
« Reply #11 on: April 12, 2015, 04:12:08 AM »
Yes i agree. Sounds like coz its on its own line its thinking your trying to run a /debug command or batch file, and when it cant find it, it complains


so maybe try the full line in a cmd window, with spaces before each argument switch the '/' part:

Code: [Select]
GoLink /unused someP64.obj /debug /debugtype:cv /pdb:someP64.pdb
and let us know the output of that, if that line works, then just replace that in your batch file.
fearless

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #12 on: April 12, 2015, 07:49:28 AM »
        4-11-2015
   
Here is the result you requested with the debug stuck
at the end of the GoLink.
   
   e:\codejps>GoLink /unused someP64.obj /debug /debuggertype:
   cv /pdb:"someP64.pdb"
   
   error!
   Please give debug type:-
   coff = embedded coff symbols
   dbg = coff symbols in dbg file
   output file not made

fearless

  • Member
  • ****
  • Posts: 578
    • Github
Re: x64_dbg
« Reply #13 on: April 12, 2015, 09:50:59 AM »
Looking at the golink manual online (http://s.walters.free.fr/Esial/ECGo/GoAsm/Help/GoLink.htm) it appears golink only supports /debug coff and no other options.
Code: [Select]
GoLink /unused someP64.obj /debug coff
should add debugging information to the exe, but i dont know if this will be enough for the x64dbg debugger.

I looked at pelles c polink, jwlink and a few others but i cant see an option for a pdb file. The only one that will have it is the one from a visual c package (in a visual studio distribution)

You might have to download a visual studio of some type - express edition or whatever and copy the 64bit link.exe from that to wherever you goasm stuff is located. In the visual studio stuff the 64bit link.exe is normally located in C:\Program Files (x86)\Microsoft Visual Studio X\VC\BIN\amd64\link.exe - where X is the visual studio version.

Or maybe someone can put together a 64bit version for you from someone who has visual studio installed - it would need all the dependent .dlls in a package for use.
fearless

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook

rrr314159

  • Member
  • *****
  • Posts: 1378
Re: x64_dbg
« Reply #14 on: April 12, 2015, 11:04:07 AM »
You might have to download a visual studio of some type - express edition or whatever and copy the 64bit link.exe from that to wherever you goasm stuff is located.

- That one doesn't work for me either. When used with /debug complains "incorrect MSDB100.DLL version" but I have the correct version. Re-loaded it to make sure. Works fine for everything but /debug, Bill only knows why.

I could zip it and post it but, aren't there copyright issues involved? Don't want to get hutch in trouble :) But if someone can assure me it's legal I'd be happy to do so - altho like I say it doesn't work anyway
I am NaN ;)