헥사, 바이너리 보는 법 질문

김유석의 이미지

이미지 파일의 헤더를 분석하려고 합니다.

이미지를 불러서 2진수나 16진수로 보려면 어떻게 해야 할까요?

(혹시 vim에서 지원 되나요?)

irdeal의 이미지


vi에서 일단 바이너리 파일을 열고..

:%!xxd 를 하면 hex로 볼수 있습니다..

:%xxd -r 는 hex를 다시 바이너리로 바꿔줍니다..

vi를 안쓰고..
그냥 shell에서 xxd를 이용해도 됩니다..

나는 나다. 내가 다른사람일수는 없다.
irdeal

May The Force Be With You
irdeal

dalgarak의 이미지

hexdump를 사용해도 됩니다.
-C 옵션으로 ascii와 함께 볼 수 있고,
-n [:num:] 으로 바이트 카운트만큼 볼 수도 있고,
-s 옵션으로 일정 구간의 오프셋만 볼 수도 있습니다.

간단하게 예를 들자면...

$ hexdump -C -n30 -s$(((skip=17 * 0x800));echo $skip) dban-beta.2006051000_i386.iso
00008800  00 43 44 30 30 31 01 45  4c 20 54 4f 52 49 54 4f  |.CD001.EL TORITO|
00008810  20 53 50 45 43 49 46 49  43 41 54 49 4f 4e        | SPECIFICATION|
0000881e

이런식으로 말이죠.
----
It's Friday I want to play,
on Saturday don't want to stay, at home
thinking of you
so let me party all night long.

from m-flo, Come again lyrics

http://luna.onionmixer.net

cinsk의 이미지

Emacs에서 제공하는 hexl-mode를 쓰시면 16진수로 보는 것, 편집 다 가능합니다. (마치 DOS 시절 PCtool을 쓰는 것처럼...) 파일을 연 다음 M-x hexl-mode를 실행하면 됩니다.

--
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://www.cinsk.org/cfaqs/

김유석의 이미지

도움 주셔서 감사합니다.

혹시 2진수로 보는 방법은 없을까요?

0101010111000111101010 이런식으로..

thyoo의 이미지

Windows에서 작업 하신다면
http://www.net3-tv.net/~m-tsuchy/tsuchy/download/tsxbn400.lzh
http://www.net3-tv.net/~m-tsuchy/tsuchy/tsxmacro.htm

매크로를 열어보면 아시겠지만 C언어 비스무레한 스크립트로
스트림 문법을 정의해 놓으면 지가 알아서
파싱한 값을 16진수로 보여줍니다.

Columbia 대학의 우리나라 학생들이 (그중에 제 동문도 있읍니다만)
맨든 Flavor라는 bitstring parser generator도 있읍니다.
http://flavor.sourceforge.net/
한 번 보시죠.
___________________________________
Less is More (Robert Browning)

___________________________________
Less is More (Robert Browning)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.