From 21e8db012f8c46f75e43a40da3f3e2676363c291 Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 14 Mar 2020 18:01:23 +0000 Subject: deploy: 951ccb67565f34a0aa1b23ad6eef647aed5e0b4b --- xxd.html | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 xxd.html (limited to 'xxd.html') diff --git a/xxd.html b/xxd.html new file mode 100644 index 0000000..b2ebdfd --- /dev/null +++ b/xxd.html @@ -0,0 +1,245 @@ + + + + + + xxd - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

xxd(1)

+
  xxd [opts]
+    -p          dump continuous hexdump
+    -r          convert hexdump into binary ('revert')
+    -e          dump as little endian mode
+    -i          output as C array
+
+

from ascii to hex stream

+
  echo -n 'aabb' | xxd -p
+    >> 61616262
+
+

from hex stream to binary stream

+
  echo -n '61616262' | xxd -p -r
+    >> aabb
+
+

ascii to binary

+
  echo -n '\x7fELF' | xxd -p | xxd -p -r | file -p -
+    >> ELF
+
+

ascii to C array (hex encoded)

+
  xxd -i <(echo -n '\x7fELF')
+    >> unsigned char _proc_self_fd_11[] = {
+    >>   0x7f, 0x45, 0x4c, 0x46
+    >> };
+    >> unsigned int _proc_self_fd_11_len = 4;
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3