非常类似的问题,如CreateProcessA 函数在 MASM64 (ml64.exe) 中不起作用,但在我的情况下,我认为它不适用于 64x 中的对齐或指针数据类型。所以代码是
;ml64.exe CreateProcessA.asm /link /subsystem:console /entry:main /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64" /defaultlib:kernel32.lib
extrn CreateProcessA : proc
PROCESS_INFORMATION struct
hProcess qword ?
hThread qword ?
dwProcessId dword ?
dwThreadId dword ?
PROCESS_INFORMATION ends
STARTUPINFOA struct
cb qword sizeof ( STARTUPINFOA )
lpReserved qword ?
lpDesktop qword ?
lpTitle qword ?
dwX dword ?
dwY dword ?
dwXSize dword ?
dwYSize dword ?
dwXCountChars dword ?
dwYCountChars dword ?
dwFillAttribute dword ?
dwFlags dword ?
wShowWindow word ?
cbReserved2 word 3 dup ( ? )
lpReserved2 qword ?
hStdInput qword ?
hStdOutput qword ?
hStdError qword ?
STARTUPINFOA ends
.const
NORMAL_PRIORITY_CLASS equ 020h
.data
processInfo PROCESS_INFORMATION <>
startupInfo STARTUPINFOA <>
szProcName db "C:\Windows\System32\cmd.exe", 00h
.code
main proc
lea rax, processInfo
lea rbx, startupInfo
push rax
push rbx
push 00h
push 00h
push NORMAL_PRIORITY_CLASS
push 00h
sub rsp, 20h
mov r9, 00h
mov r8, 00h
mov rdx, 00h
lea rcx, szProcName
call CreateProcessA
main endp
end
错误 - kernelbase.dll 中的访问冲突
movaps xmmword ptr ss:[rsp+C0],xmm0
有人可以澄清我的代码有什么问题吗?