简单的汇编指令转二进制工具
这个小工具的作用是输入一条汇编指令,然后输出其16进制数据。生成一些补丁代码的时候很方便
要注意的是这个工具依赖gcc的,是AT&T的语法,Windwos下依赖cygwin
例如
#asm2hex i386 "inc %r14d"
Size: 3
Code: 41 FF C6 inc %r14d
简直是方便过头了。
现在暂时只支持i386和x86_64,不过别的架构也是同理。
提个大概的方法,例如ARM
arm-linux-androideabi-gcc -S org.c -o arm.s
接着要对arm.s做点修改
修改的地方主要是i386.s里的_start _end标签,还有这两个标签之间的<code>,然后就是_start标签前面的jmp _end
还有就是尾部的_size标签,_addr标签,和_asm_str标签
相信懂行的看下asm2hex,org.c的代码就懂了。
(The function of this small tool is to input one piece of data, and then output its 16 pieces of data.
It is very convenient to generate some patch code
If this tool does not rely on gcc, it is AT&T's syntax, and under Windwos, pay attention to relying on cygwin
E.g
#asm2hex i386 "inc %r14d"
Size: 3
Code: 41 FF C6 inc %r14d
Clean is too convenient.
For now, only i386 and x86_64 are supported, but they are not the same.
Give a rough idea, such as ARM
arm-linux-androideabi-gcc -S org.c -o arm.s
Then we need to make some changes to arm.s
The modification is mainly the _start _end tag in i386.s, and the <code> between these two tags, and then the jmp _end in front of the _start tag
There is the tail _size tag, _addr tag, and _asm_str tag
I believe those who know how to read asm2hex will understand the code of org.c.)
页:
[1]