如何创建使用十六进制二进制可执行文件? [英] How to create a binary executable using hex?

查看:165
本文介绍了如何创建使用十六进制二进制可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直用汇编级编程最近,我能够用NASM的装配水平code转换为机器级code或并从中提取十六进制code,但如何是逆可能吗?我需要写与正在只给出了十六进制二进制可执行文件。我需要转换以下十六进制<$c$c>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一个可执行的,我该怎么做呢?

I have been working with assembly level programming lately and I am able to convert the assembly level code to the machine level code using nasm or as and extract the hex code from it, But how is the inverse possible ? I need to write binary executable files with only the hex being given. I need to convert the following hex 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 to an executable, How do I do it ?

推荐答案

A.S:

.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工具链的命令

gnu toolchain commands

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

修改

这需要较长的时间来输入此编辑做的比谷歌搜索

it took longer to type this edit than do the google search

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

这篇关于如何创建使用十六进制二进制可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆