【叩かれて】Emacs Lisp道場【強くなれ】at UNIX
【叩かれて】Emacs Lisp道場【強くなれ】 - 暇つぶし2ch214:名無しさん@お腹いっぱい。
04/05/26 15:39
(defun display-binaried-file (file)
(interactive "fFilename: ")
(with-output-to-temp-buffer "Binary"
(with-temp-buffer
(let ((addr 0)
s)
(insert-file-literally file)
(goto-char (point-min))
(while (re-search-forward "\\=\\(?:.\\|\n\\)\\{1,8\\}" nil t)
(princ (format "%08X:" addr))
(setq s (match-string 0)
addr (+ 8 addr))
(mapc (lambda (c)
(princ " ")
(dotimes (i 8)
(princ (if (zerop (logand 128 c)) "0" "1"))
(setq c (lsh c 1))))
s)
(princ (format "%s %s\n"
(make-string (* 9 (- 8 (length s))) ?\040)
(mapconcat (lambda (c)
(if (and (<= 32 c) (< c 127))
(char-to-string c)
"."))
s
nil))))))))



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch