3

我最近一直在使用汇编级编程,我能够使用 nasm 或 as 将汇编级代码转换为机器级代码,并从中提取十六进制代码,但是反之又如何呢?我需要编写仅给出十六进制的二进制可执行文件。我需要将以下十六进制转换7a\x65\x00\x5f\x73\x74\x61\x72\x74\x00\x5f\x5f\x62\x73\x73\x5f\x73\x74\x61\x72\x74\x00\x5f\x65\x64\x61\x74\x61\x00\x5f\x65\x6e\x64\x00为可执行文件,我该怎么做?

4

1 回答 1

2

作为:

.globl _start
_start:
.byte 0x7a,0x65,0x00,0x5f,0x73,0x74,0x61,0x72,0x74,0x00,0x5f,0x5f,0x62,0x73,0x73,0x5f,0x73,0x74,0x61,0x72,0x74,0x00,0x5f,0x65,0x64,0x61,0x74,0x61,0x00,0x5f,0x65,0x6e,0x64,0x00

gnu 工具链命令

as a.s -o a.o
ld a.o -o a

编辑

键入此编辑比谷歌搜索花费更长的时间

nasm 语法:

global _start
_start:
db 0x7a,0x65,0x00,0x5f,0x73,0x74,0x61,0x72,0x74,0x00,0x5f,0x5f,0x62,0x73,0x73,0x5f,0x73,0x74,0x61,0x72,0x74,0x00,0x5f,0x65,0x64,0x61,0x74,0x61,0x00,0x5f,0x65,0x6e,0x64,0x00
于 2013-07-29T15:21:37.350 回答