assembly NASM拒绝创建MessageBox()

rta7y2nd  于 2023-06-30  发布在  其他
关注(0)|答案(1)|浏览(105)

我正在学习nasm,并试图从gcc做一个消息框。我的代码是这样的:

%include "win32n.inc"

extern MessageBoxA
import MessageBoxA user32.dll
extern ExitProcess
import ExitProcess kernel32.dll

section .data USER32

title db "Hello", 0
message db "Hello World",0

section .text
global main

    main:
    push dword MB_OK
    push dword title
    push dword message
    push dword 0
    call [MessageBoxA]

    push dword 0
    call [ExitProcess]

然后我得到这个错误:

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Program Files (x86)\CodeBlocks\MinGW\bin\NASM>cd\nasm

C:\nasm>nasm -fwin32 msgboxnasm.asm
msgboxnasm.asm:1: fatal: unable to open include file `win32n.inc'

C:\nasm>
uyto3xhc

uyto3xhc1#

你可能会在这个链接中找到这样的代码:https://mathimaaran.angelfire.com/helloworld_tutorial.htm
您可以在上面的链接中找到如何下载de文件win32n.inc
此文件可从http://rs1.szif.hu/~tomcat/win32/win32n.zip下载

相关问题