# 3.10 Yank/Paste

You can yank/paste bytes in visual mode using the 'y' and 'Y' key bindings that are alias for the 'y' and 'yy' commands of the shell. There is an internal buffer that stores N bytes from the current seek. You can write-back to another seek using the 'yy' one.

    [0x4A13B8C0]> y?
    Usage: y[ft] [length]
     > y 10 @ eip     ; yanks 10 bytes from eip
     > yy @ edi       ; write these bytes where edi points
     > yt [len] dst   ; copy N bytes from here to dst

Sample session:

    > s 0x100    ; seek at 0x100
    > y 100      ; yanks 100 bytes from here
    > s 0x200    ; seek 0x200
    > yy         ; pastes 100 bytes

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

    [0x4A13B8C0]> x
       offset   0 1  2 3  4 5  6 7  8 9  A B  0123456789AB
    0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ...9........
    0x4A13B8CC, ffff 81c3 eea6 0100 8b83 08ff ............
    0x4A13B8D8, ffff 5a8d 2484 29c2           ..Z.$.).

    [0x4A13B8C0]> yt 8 0x4A13B8CC @ 0x4A13B8C0
    [0x4A13B8C0]> x
       offset   0 1  2 3  4 5  6 7  8 9  A B  0123456789AB
    0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ...9........
    0x4A13B8CC, 89e0 e839 0700 0089 8b83 08ff ...9........
    0x4A13B8D8, ffff 5a8d 2484 29c2           ..Z.$.).
    [0x4A13B8C0]>