Questions tagged [xxd]

`xxd` is a Linux Hexdump command

On the Linux platform, the command xxd (available via most package managers) works as a hexdump tool.

From man xxd

xxd creates a hex dump of a given file or standard input. It can also 
convert a hex dump back to its original binary form. Like uuencode(1) and 
uudecode(1) it allows the transmission of binary data in a `mail-safe' ASCII 
representation, but has the advantage of decoding to standard output. 
Moreover, it can be used to perform binary file patching.  
107 questions
0
votes
2 answers

How to generate sha256 hashes of hexadecimal binary data in c++?

I need a function in C++ that generate similar result what this command generate in linux. echo -n "616161616161616" | xxd -r -p | sha256sum -b | awk '{print $1}' What this command does is: given an hexadump, convert it to binary file format,…
user2761603
  • 13
  • 1
  • 3
0
votes
0 answers

find cropped area of image inside the basic image with xxd

I done the following: I made a screenshot of my linux desktop with gnome-screenshot then converted it to a bmp image and dumped it as raw hex values with xxd -ps.[resolution:969x1920] From the bmp image i made before, i cropped a small area and…
0
votes
1 answer

xxd not doing anything on alpine linux

I'm trying to use xxd to follow a tutorial but it's not printing anything from the Alpine Linux container that I'm trying to run it in. I am running: xxd -ps -c 1000 . When I do this, it just prints out the usage instructions: ~ #…
cilphex
  • 6,006
  • 6
  • 34
  • 44
0
votes
1 answer

Bash Command not found after xxd

I'm attempting to get a whitespace-trimmed plain hex dump of a binary file Command: aes.key.hex=$(xxd -p /tmp/aes.key | tr -d '[:space:]') Failure: bash: aes.key.hex=097b7be16b52de77437882889fc96a27132217867970b014016f5de3e6864b37: command not…
user3613290
  • 461
  • 6
  • 18
0
votes
1 answer

How do I find password related information of a password protected PDF?

I was trying to gather information about password used to protect a PDF. I used PeePDF and xxd editor to view all the objects of password protected PDF.I came to know password info is stored in trailer part of PDF structure.When I run this command ,…
0
votes
2 answers

Why does xxd add chars?

I am trying to reverse an od command from a system where I have no hexdump or base64 tools. I do this like that (of course, in reality, the encoding takes place at the "small" system, the decoding is done on my workstation, but to test it, I try the…
Bowi
  • 1,378
  • 19
  • 33
0
votes
1 answer

xxd without line number but keep character encoding

I know that using -p can output in plain hexdump style, but I want to keep the character encoding in the righthand column and separation of the output. Does xxp have any options to do this?
NiaBie
  • 55
  • 1
  • 9
0
votes
0 answers

How is binary stored on disk

I have worked with xxd utility which translates binary to ascii format and vice versa, but I am not really sure what it dos behind the scene. Assume I have the following hexdump: 0100 0000 0500 0000 0000 0000 0000 0000 ................ Clearly…
Joe
  • 1
0
votes
1 answer

Could a simple C program mimic the default 'xxd' command such that its diff'd output would return 0?

I'm trying to write a C executable that will yield identical output to that of a default xxd command. For example, lets say I have a fairly small text file named test.txt and an executable named myxxd So, I first make a benchmark for comparison by…
Grant
  • 891
  • 1
  • 9
  • 15
0
votes
1 answer

When piping to xxd, why is some text passed through without modification?

netstat -lntup |grep 3306 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN mysqld is…
user7988893
0
votes
0 answers

Extracting data similar to the output of xxd from binary files

I have a binary file that represents the output of a sensor. On my bash-terminal I can show the data of the file using xxd -b atis.es which results in an output like this: 00000000: 01000101 01110110 01100101 01101110 01110100 00100000 Event …
Max
  • 1,471
  • 15
  • 37
0
votes
2 answers

Inconsistencies when packing hex string

I am having some inconsistencies when using hexdump and xxd. When I run the following command: echo -n "a42d9dfe8f93515d0d5f608a576044ce4c61e61e" \ | sed 's/\(..\)/\1\n/g' \ | awk '/^[a-fA-F0-9]{2}$/ { printf("%c",strtonum("0x" $0)); }' \ |…
bng44270
  • 339
  • 2
  • 6
0
votes
0 answers

xxd - how to insert a long text at a specific offset

How can I insert hex datas at a specific offset? more than 256? I tried something like : echo "00054cc0: 16c65206...5656c6c652eaa" | xxd -c 256 -r - myFile.bin How can I do if I want to insert a long text or a text file here?
stef toto
  • 1
  • 1
0
votes
0 answers

Using xdd for Assignment on linux in c

I am trying to compare the last value from a joystick file driver located at /dev/input/js0 Just for testing, in the linux shell I am using xxd to make the hex dump: xxd -c1 -p /dev/input/js0 And I see the value I am looking for, until here…
0
votes
3 answers

put some hex string to xxd using stdin does not generate any output

I have a problem with gathering data by xxd from stdin. Here is the command: xxd -r -p | dd of=/home/user/test/hex.bin obs=16 when I execute this command in shell, then it waits for input. I tried to put '0006303030304e430006303030304e43' then…
user2311165
  • 53
  • 1
  • 8