(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.)