News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

x64_dbg

Started by shankle, April 09, 2015, 09:29:14 PM

Previous topic - Next topic

shankle

#15
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    

TWell

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

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

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
;------------------------------------------------------------------
;
;      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

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

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

        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

Quote from: shankle on April 13, 2015, 04:17:51 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

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

#24
Quote from: shankle on April 13, 2015, 04:37:08 AM
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

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

shankle

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

Using commands:
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

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

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

Quote from: shankle on April 15, 2015, 03:39:40 AM
Got a lot of "ntdll" and none of my code.

Just hit F9 once, like in Olly.