开发者

How to simply get a machine code of exactly one assembly instruction?

开发者 https://www.devze.com 2023-02-03 15:40 出处:网络
How to simplyget a code of exactly one开发者_Go百科 assembly instruction? For example for \"mov eax 0x14\".

How to simply get a code of exactly one开发者_Go百科 assembly instruction?

For example for "mov eax 0x14". I want to get it in linux terminal preferably with gcc or gdm.


$ echo "mov eax, 0x14" | as -o /dev/null -al -msyntax=intel -mnaked-reg
GAS LISTING             page 1


   1 0000 B8140000  mov eax,0x14
   1      00


rasm2 from the radare2 package fits this purpose nicely:

$ rasm2 'nop'
90
$ rasm2 -d '90'
nop

http://radare.org/y/?p=examples&f=rasm

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号