From 15230bbb9b1f69def9b0e1b41a097638c0fda734 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 28 Apr 2020 09:11:18 +0000 Subject: deploy: fef4d6ff2ad9f48e6dccde0f061453e6a3ac624e --- binary/xxd.html | 245 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 binary/xxd.html (limited to 'binary/xxd.html') diff --git a/binary/xxd.html b/binary/xxd.html new file mode 100644 index 0000000..ac248b4 --- /dev/null +++ b/binary/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
+
+

ASCII to hex stream

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

Hex 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