Author Topic: x64_dbg  (Read 17334 times)

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #15 on: April 12, 2015, 11:23:28 AM »
Thanks for your efforts Fearless.
Looks hopeless.
Have to much time invested in GoAsm to give it up now.

I downloaded Visual Studio (can't find out how to use it yet....)
Moved  "link.exe" from Visual Studio and put it in "codejps".

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

The above gave the following error:
      ERROR!
      did not recognize a switch: - /debugtype
      Output file not made    
« Last Edit: April 12, 2015, 01:14:55 PM by shankle »

TWell

  • Member
  • ****
  • Posts: 743
Re: x64_dbg
« Reply #16 on: April 12, 2015, 06:20:50 PM »
ms link 9 needs these files to make pdb:
link.exe
mspdb80.dll
mspdbcore.dll
mspdbsvr.exe
msobj80.dll

commandline:
link.exe Hello64World1_64.obj -entry:START -subsystem:console kernel32.lib -debug

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #17 on: April 13, 2015, 01:11:53 AM »
Thanks Twell for responding.
Not sure I understand your post.
Does it apply to GoLink?
Where do I put the .dlls you listed?
Are they part of Visual Studio?
I'm pretty sure that Link.exe will not work in GoAsm.

TWell

  • Member
  • ****
  • Posts: 743
Re: x64_dbg
« Reply #18 on: April 13, 2015, 01:48:26 AM »
My test was using GoAsm.exe , MS link.exe and x64_dbg.exe .
x64_dbg.exe show symbols START RCKEEP GetStdHandle WriteFile Message.
And link.exe and dlls was same folder.

Hello64World1_64.asm
Code: [Select]
;------------------------------------------------------------------
;
;      Hello64World1 - copyright Jeremy Gordon 2005-6
;
;      SIMPLE "HELLO WORLD" WINDOWS CONSOLE PROGRAM - for GoAsm 64-bits
;
;      Assemble using GoAsm /x64 Hello64World1 (produces PE COFF file)
;      Then link as windows console program using GoLink as follows:-
;      GoLink /console hello64world1.obj kernel32.dll
;      (add -debug coff if you want to watch the program in the debugger)
;
;      Note that the GetStdHandle and WriteFile calls are to kernel32.dll
;------------------------------------------------------------------
;
DATA SECTION
;
ALIGN 8           ;align qword following on 8-byte boundary
RCKEEP DQ 0       ;temporary place to keep things
Message DB 'Hello 64 World (from GoAsm)'
;
CODE SECTION
;
START:
ARG -11                 ;STD_OUTPUT_HANDLE
INVOKE GetStdHandle     ;get, in rax, handle to active screen buffer
;********************
ARG 0,ADDR RCKEEP       ;RCKEEP receives output from API
ARG 27                  ;length of string
ARG ADDR Message,RAX    ;rax=handle to active screen buffer
INVOKE WriteFile
XOR RAX,RAX             ;return zero
RET
So don't give up yet.

wjr

  • Member
  • **
  • Posts: 247
    • WJR's website
Re: x64_dbg
« Reply #19 on: April 13, 2015, 03:41:18 AM »
If you are going that route, you will need to use the GoAsm /ms conmmand line switch to decorate symbols for link.exe, which will also require LIB files for importing functions.

Have you tried the debugger with Pelles C?

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #20 on: April 13, 2015, 04:02:14 AM »
Thank you for responding WJR.
I have no idea what route I should take.
What lib files do I need to import?
I have not tried Pelles C debugger

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #21 on: April 13, 2015, 04:17:51 AM »
        4-12-2015
To Twell    
I have been unable to find the ".dlls" you referenced in #16.   

Set INCLUDE=e:\codejps
Set PATH=e:\codejps
GoAsm /x64/b/c/ms someP64.asm
GoLink /console someP64.obj kernel32.dll -debug coff

Using the above I got this result:
  e:\codejps>GoLink /console someP64.obj kernel32.dll -debug coff
  output file: someP.exe <with embedded coff debug symbols>
 
Wjr said I need to put a switch in GoAsm:  /MS (command line switch) 
This is the error I got when I added this switch:
Could not open an input file <_msvcrt.dll>
output file not made
 

TWell

  • Member
  • ****
  • Posts: 743
Re: x64_dbg
« Reply #22 on: April 13, 2015, 04:27:19 AM »
To Twell    
I have been unable to find the ".dlls" you referenced in #16.   
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE ?

Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 here

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #23 on: April 13, 2015, 04:37:08 AM »
Thanks again Twell,
I just downloaded Visual Studio 13  and have MVS 11 and 12.
So I should uninstall MVS 13 and install MVS 10 - RIGHT?

TWell

  • Member
  • ****
  • Posts: 743
Re: x64_dbg
« Reply #24 on: April 13, 2015, 02:26:17 PM »
So I should uninstall MVS 13 and install MVS 10 - RIGHT?
No, use that linker.
MSVS 2013:
link.exe
1033\linkui.dll
mspdb120.dll
mspdbcore.dll
mspdbsvr.exe
msobj120.dll
msvcp120.dll
msvcr120.dll

Code: [Select]
11 dumpbin.exe 24736 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
12 editbin.exe 24736 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
13 lib.exe 24720 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
14 link.exe 856208 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
16 ml.exe 438920 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
17 mspdb120.dll 259232 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
18 mspdbsrv.exe 125088 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
19 mspdbcore.dll 376488 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
21 msobj120.dll 94880 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
22 nmake.exe 102040 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\ vc_CompilerCore86.cab
2 linkui.dll 79512 12.0.21005.1 Program Files\Microsoft Visual Studio 12.0\VC\bin\1033\ vc_CompilerCore86Res.cab
« Last Edit: April 15, 2015, 04:24:40 AM by TWell »

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #25 on: April 14, 2015, 06:17:05 AM »
Thanks again TWell.
I found and put all the latest files you suggested from VS 2013 in c:\codejps.
Of course some of those files had many of the same name and I choose one of them.

This is the result I got after that:
 Could not open an input file <_msvcrt.dll>
 needed for forced dll or import by ordinal.
I did look for this .dll but could not find it,

TWell

  • Member
  • ****
  • Posts: 743
Re: x64_dbg
« Reply #26 on: April 14, 2015, 08:50:55 PM »
Using commands:
Code: [Select]
GoAsm.exe /x64 Hello64World1_64.asm
link.exe Hello64World1_64.obj -entry:START -subsystem:console kernel32.lib -debug
Hello64World1_64.exe was created.
GoAsm /ms option doesn't work in x64 mode ?


wjr

  • Member
  • **
  • Posts: 247
    • WJR's website
Re: x64_dbg
« Reply #27 on: April 15, 2015, 02:49:08 AM »
Thanks for finding that one, it currently does not work for the case of ARG before INVOKE. This will work in the soon upcoming GoAsm v0.60.0.0 (I still need to fix something for the /x86 /ms case).

It currently does work if you do not use ARG and place all function arguments after INVOKE.

shankle

  • Member
  • ****
  • Posts: 868
Re: x64_dbg
« Reply #28 on: April 15, 2015, 03:39:40 AM »
4-14-2015
Ok, got a clean compile after taking out the GoAsm /ms switch.
Got a lot of "ntdll" and none of my code. I was at this point many posts
previous. Nothing shows in "source".

jj2007

  • Member
  • *****
  • Posts: 13950
  • Assembly is fun ;-)
    • MasmBasic
Re: x64_dbg
« Reply #29 on: April 15, 2015, 03:50:36 AM »
Got a lot of "ntdll" and none of my code.

Just hit F9 once, like in Olly.