Yank/Paste(拉伸/粘贴)

Radare2 has an internal clipboard to save and write portions of memory loaded from the current io layer.

This clipboard can be manipulated with the y command.

The two basic operations are

  • copy (yank)

  • paste

The yank operation will read N bytes (specified by the argument) into the clipboard. We can later use the yy command to paste what we read before into a file.

You can yank/paste bytes in visual mode selecting them with the cursor mode (Vc) and then using the y and Y key bindings which are aliases for y and yy commands of the command-line interface.

[0x00000000]> y?
|Usage: y[ptxy] [len] [[@]addr] # See wd? for memcpy, same as 'yf'.
| y              show yank buffer information (srcoff len bytes)
| y 16           copy 16 bytes into clipboard
| y 16 0x200     copy 16 bytes into clipboard from 0x200
| y 16 @ 0x200   copy 16 bytes into clipboard from 0x200
| yz [len]       copy string (from current block) into clipboard
| yp             print contents of clipboard
| yx             print contents of clipboard in hexadecimal
| ys             print contents of clipboard as string
| yt 64 0x200    copy 64 bytes from current seek to 0x200
| ytf file       dump the clipboard to given file
| yf 64 0x200    copy 64 bytes from 0x200 from file
| yfa file copy  copy all bytes from file (opens w/ io)
| yy 0x3344      paste clipboard

Sample session:

You can perform a yank and paste in a single line by just using the yt command (yank-to). The syntax is as follows:

最后更新于

这有帮助吗?