win64的格式是什么?
What is the format of win64?
nasm -f win64
生成的win64
格式是什么格式?
这个节目:
extern GetStdHandle, WriteConsoleA, ExitProcess
section .bss
dummy resd 1
section .data
msg db "abc"
msglen equ $ - msg
section .text
_start:
mov rcx, STD_OUTPUT_HANDLE
call GetStdHandle
mov rcx, rax
mov rdx, msg
mov r8, msglen
mov r9, dummy
push NULL
call WriteConsoleA
mov rcx, 0
call ExitProcess
NULL equ 0
STD_OUTPUT_HANDLE equ -11
生成一个包含某些内容的目标文件,例如包含的外部函数(GetStdHandle
、WriteConsoleA
和 ExitProcess
)、abc
字符串和变量名(msg
).
它的确切格式是什么?我在网上找不到任何 Win64 规范。
第一次看到this link时,完全没有意识到它谈到了图像文件格式(PE)和对象文件格式 (COFF)。目标文件格式正是我要找的。引用:
This document specifies the structure of executable (image) files and object files under the Microsoft Windows family of operating systems. These files are referred to as Portable Executable (PE) and Common Object File Format (COFF) files, respectively. The name "Portable Executable" refers to the fact that the format is not architecture specific.
(强调我的)
nasm -f win64
生成的win64
格式是什么格式?
这个节目:
extern GetStdHandle, WriteConsoleA, ExitProcess
section .bss
dummy resd 1
section .data
msg db "abc"
msglen equ $ - msg
section .text
_start:
mov rcx, STD_OUTPUT_HANDLE
call GetStdHandle
mov rcx, rax
mov rdx, msg
mov r8, msglen
mov r9, dummy
push NULL
call WriteConsoleA
mov rcx, 0
call ExitProcess
NULL equ 0
STD_OUTPUT_HANDLE equ -11
生成一个包含某些内容的目标文件,例如包含的外部函数(GetStdHandle
、WriteConsoleA
和 ExitProcess
)、abc
字符串和变量名(msg
).
它的确切格式是什么?我在网上找不到任何 Win64 规范。
第一次看到this link时,完全没有意识到它谈到了图像文件格式(PE)和对象文件格式 (COFF)。目标文件格式正是我要找的。引用:
This document specifies the structure of executable (image) files and object files under the Microsoft Windows family of operating systems. These files are referred to as Portable Executable (PE) and Common Object File Format (COFF) files, respectively. The name "Portable Executable" refers to the fact that the format is not architecture specific.
(强调我的)