Questions tagged [xxd]
The xxd tag has no summary.
31 questions
3
votes
0
answers
78
views
How to display a UTF8 encoded text file as a hex dump but with the characters in the right column
This is the sample.txt Greek in UTF8:
ανθρώπους.
Από
ανθρώπους.
Από
When I run the command below I get the hex output but not the corresponding characters in the right column but instead I see ..........
0
votes
2
answers
380
views
From hexdump to ascii (xxd -r stuck writing zero bytes)
To diagnose secure boot issues, I'm looking at the sbat sections of all bootloaders on a machine:
sudo sh -c 'for f in /boot/efi/EFI/*/*.efi; do echo "$f"; objdump -j .sbat -s "$f" ...
0
votes
1
answer
4k
views
What does xxd -r -p do?
So I am trying to calculate a SHA1 digest (and base64 encode it) for an attachment I received so it matches their (base64 encoded) digest. Using ChatGPT, I was able to use the command below to succeed....
0
votes
4
answers
680
views
awk command to map ASCII char to hex code not working
I'm experimenting with awk and I thought it would be a cool idea to write a small program that maps every ASCII char with its hex code. this is what ive done so far:
The string is:
...
0
votes
1
answer
540
views
tying together the 'xxd' command with output
I have the following hex dump:
00000000: 2345 5854 5241 530a 0a31 2e20 746f 2061 #EXTRAS..1. to a
00000010: 6464 2075 7365 723a 2060 7375 646f 2075 dd user: `sudo u
00000020: 7365 7261 6464 205b ...
8
votes
1
answer
1k
views
Why is 0x00 being deleted when assigning a base64 decoded string to a variable
I'm using a Mac. In Bash, I'm trying to decode a base64 string and then try to print the Hex value. I'm using base64 -d command and then assigning it to a variable.
myText='YYN29+...
1
vote
1
answer
555
views
Should the `xxd` utility be listed as a dependency in my application?
I'm distributing a desktop application and I'm unsure if xxd should be listed as a (build) dependency.
My first though was not, since it's documented in the Linux manpages and therefore should be ...
1
vote
1
answer
824
views
Prevent xxd from adding newline to the output
On unix if I do
printf "aY.S'Hk([;jYJ}8eJ5)Wsd58/x}s]Pne3V-6:t@" | xxd -p -c 256
I get
61592e5327486b285b3b6a594a7d38654a352957736435382f787d735d50
6e6533562d363a7440
However on mac os (...
4
votes
2
answers
3k
views
How to format hexdump as xxd, possible for xxd -revert?
I wish to dump the raw content of a SD card into a file for inspection. Most parts of it are zeroes. Learnt from this SuperUser answer I could use pv to show the progress of od and hexdump. Both ETA ...
11
votes
2
answers
3k
views
How to print zeros and ones of a file
Long story short: how to print in a terminal the binary digits constituting a file e.g. a library .so or a simple text .txt file
PC hardware works with electrical signal (basically it's an ON/OFF ...
2
votes
1
answer
629
views
How to modify a hex string to LE-format before passing it to `xxd -r` to view its binary contents?
The hex string 0068732f6e69622f represents the ASCII string /bin/sh, when it's stored in memory in LE-format.
Is there any Linux utiltity that will take the hex string and reverse it bytes (...
0
votes
1
answer
993
views
How to `watch` output of `xxd` or `hexdump` command?
My tool is wtiting binary chars to stdout and I can view it in hex with
# ./md /dev/ttyUSB0 | xxd
0000000: 6f03 1100 0003 0084 8400 0000 0900 0a00 o...............
0000010: 0008 0004 0000 0000 2c00 ...
-6
votes
1
answer
466
views
Just started learning Kali Linux 3 weeks ago need help with maybe a hex dump?
For an assignment I was given this problem:
What has 8 faces and cannot see?
followed by this character set:
...
1
vote
1
answer
783
views
Patch Multiple Strings in a Binary file
I have a binary file type (many instances of these files) where I would like to replace the string "DC-GX850" with "DMC-GX95". Fortunately the two strings are of equal length. The ...
0
votes
2
answers
529
views
Parse text file with addresses, byte values, and comments to binary file
I'm attempting to start with a file in the following form:
00: 42 ; byte 0 is 0x42 / d
01: 52 ; byte 1 is 0x52 / r
02: 62 ; byte 2 is 0x62 / D
03: 72 ; byte 3 is 0x72 / R
07: 1f ; bytes 03..0e are ...