hexView=getMemoryViewForm().HexadecimalView m=hexView.PopupMenu mi=createMenuItem(m) mi.Caption="Copy as text to clipboard" mi.Shortcut="Ctrl+Alt+C" mi.OnClick=function(sender) if hexView.HasSelection then local bytes=readBytes(hexView.SelectionStart, hexView.SelectionStop-hexView.SelectionStart+1,true) for i=1,table.getn(bytes) do if (bytes[i] < 31) then bytes[i] = 46 elseif (bytes[i] >= 128) then bytes[i] = 32 end end local s=byteTableToString(bytes) writeToClipboard(s) end end m.items.insert(5,mi)