News:

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

Main Menu

error using ntdll.(inc|lib)

Started by Nox, June 13, 2018, 08:54:45 AM

Previous topic - Next topic

Nox

Hi everybody!

I have a problem when I try build 64-bit binary using ntdll include and lib.


include \masm32\include64\ntdll.inc
include \masm32\include64\masm64rt.inc
includelib \masm32\lib64\ntdll.lib

.data?

    .code

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

start proc


invoke NtAllocateVirtualMemory, -1, 1, 0, 4096, MEM_COMMIT, PAGE_READWRITE

Ret

start endp

    end



@echo off

set appname=nullpage

del %appname%.obj
del %appname%.exe

"C:\masm32\bin64\ml64.exe" /c %appname%.asm

"C:\masm32\bin64\link.exe" /SUBSYSTEM:CONSOLE /MACHINE:X64 /ENTRY:start /nologo %appname%.obj

dir %appname%.*

pause


output error

Microsoft (R) Macro Assembler (x64) Version 14.13.26129.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Assembling: nullpage.asm
\masm32\include64\ntdll.inc(1) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(4) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(7) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(10) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(13) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(16) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(19) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(22) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(25) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(28) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(31) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(34) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(37) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(40) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(43) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(46) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(49) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(52) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(55) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(58) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(61) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(64) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(67) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(70) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(73) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(76) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(79) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(82) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(85) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(88) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(91) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(94) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(97) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(100) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(106) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(112) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(115) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(118) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(121) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(127) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(133) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(136) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(139) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(142) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(148) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(154) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(160) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(166) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(172) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(178) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(184) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(190) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(196) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(202) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(208) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(214) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(220) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(226) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(229) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(232) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(235) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(238) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(241) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(247) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(253) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(256) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(259) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(262) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(265) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(268) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(271) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(274) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(277) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(280) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(283) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(286) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(289) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(292) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(295) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(298) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(301) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(304) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(307) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(310) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(313) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(316) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(319) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(322) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(325) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(328) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(331) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(334) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(337) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(340) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(343) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(346) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(349) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(352) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(355) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(358) : error A2006:undefined symbol : PPROC
\masm32\include64\ntdll.inc(361) : fatal error A1012:error count exceeds 100; st
opping assembly
LINK : fatal error LNK1181: cannot open input file 'nullpage.obj'
Volume in drive C is OS
Volume Serial Number is 7056-A24A

Directory of C:\projects-masm\x64\allocnullpage

12/06/2018  07:52 p.m.               421 nullpage.asm
               1 File(s)            421 bytes
               0 Dir(s)  271.060.041.728 bytes free
Press any key to continue . . .


someone know what happend?

Regards!

felipe

Probably you need to include first the win64.inc file.  :idea:
Welcome to the forum!  :icon14:

felipe

Oh, sorry my wrong. I didn't noticed that you include the masm64rt.inc. I think you should include that first and all other include files (that aren't already in that "main" include file) after it.  :idea:

Nox

Yep I change the order

Now, I have other  output error :'(

Microsoft (R) Macro Assembler (x64) Version 14.13.26129.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Assembling: nullpage.asm
\masm32\include64\ntdll.inc(4016) : error A2008:syntax error : equ
LINK : fatal error LNK1181: cannot open input file 'nullpage.obj'
Volume in drive C is OS
Volume Serial Number is 7056-A24A

Directory of C:\projects-masm\x64\allocnullpage

12/06/2018  08:22 p.m.               429 nullpage.asm
               1 File(s)            429 bytes
               0 Dir(s)  271.066.652.672 bytes free
Press any key to continue . . .


Thanks for the wellcome :D

Regards!

felipe

You are right, i have commented that line (in the ntdll include file) and now assembled and linked fine:

externdef __imp_fabs:PPROC   
;fabs equ <__imp_fabs>   ; This is line 4016.


Maybe is some kind of name conflict (repeated names). Don't know. But Hutch is the author and maybe you can have more luck with him.  :idea:

jj2007

include \Masm32\MasmBasic\Res\JBasic.inc
Init           
  PrintLine Chr$("This code was assembled with ", @AsmUsed$(1), " in ", jbit$, "-bit format")
  jinvoke SetLastError, 0
  jinvoke NtAllocateVirtualMemory, -1, 1, 0, 4096, MEM_COMMIT, PAGE_READWRITE
  Inkey Err$()
EndOfCode


This code was assembled with UAsm64 in 64-bit format

Operation completed.


Works fine, but what do you need it for? Did you read the forum rules?

Quote3. Legality of content is not a negotiable matter in the forum.

felipe

Yes that's true Nox.
Btw, seems like the problem is because fabs is a fpu instruction.  :idea: