Questions tagged [hexdump]
The hexdump tag has no usage guidance.
53
questions
0
votes
0
answers
90
views
Shift the address in the hex file with Offset
I want to update the hexfile start address with offset. For example, i have a hex file name abc.hex and start with address 0x0000 to 0xFFFF. But I want to shift the context in the hexfile to the ...
2
votes
0
answers
72
views
Should programs terminate on ENOSPC error?
In bash, the command hexdump -C /dev/urandom > hexdump.txt does not terminate.
It keeps going indefinitely, even if the filesystem is full.
read(0, "\326\210L0\rL<\177\207\214\3\2237\vi\315\...
1
vote
1
answer
156
views
Unix ext2 superblock - file system creation date
I am trying to find the creation date on an ext2 file system. I seem to get a current date using dumpe2fs.
The problem is that the original ext2 superblock specification does not contain such ...
1
vote
0
answers
134
views
Iterative hexdump to find a value
As you can see the output of a hexdump command. I would like to iterate throughout the hard disk (or some limit) in order to find a value as a while-loop, in example APSB value.
The step are in my ...
0
votes
0
answers
118
views
How to recreate wildcard lines from `hexdump` output?
I have a problem: I have some old hexdumps laying around as text files.
I want to recreate the files they represent because I'm interested in what these files were.
The problem is: When I created ...
0
votes
2
answers
602
views
read raw data from disk and convert
please help to find a way to convert the data as follows:
I read from disk using dd utility
dd if=/dev/sdb skip=8388608 count=560 iflag=skip_bytes,count_bytes |hexdump -C
and I am getting
...
2
votes
2
answers
2k
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 ...
2
votes
2
answers
590
views
Have hexdump do print a line everytime the Ascii 0a reached [closed]
as $ hexdump -C data print the hex content of file in 16 bytes a line
How then to, by set its option, to print a line everytime the Ascii 0a (newline) is encountered ?
0
votes
2
answers
275
views
Grub bootup steps
Am installing gentoo. At Grub bootloader but can’t seem to find kernel, which is odd because it’s existence was verified before restarting the machine. There doesn’t seem to be a “root” or “kernel” ...
3
votes
1
answer
486
views
Bad byte count while using hexdump
I am trying to display a binary file with records consisting of:
8 bytes unsigned int
4 bytes unsigned int
4 bytes unsigned int
4 bytes unsigned int
4 bytes unsigned int
I try to display it using ...
1
vote
1
answer
1k
views
How to jump X bytes down in hexedit?
I am looking through a memory dump
B79C6440 64 6F 6E 65 00 00 6C 5F 75 62 6C 65 20 73 68 6F done..l_uble sho
B79C6450 77 5F 00 00 5F 6F 6E 5F 72 75 70 00 00 61 63 6B w_.._on_rup..ack
...
0
votes
1
answer
726
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
414
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:
...
0
votes
1
answer
385
views
Understanding the dig's DNS query: Does dig set non zero value for Z field?
When I was scrutinizing the DNS query sent by the dig, I found something odd from what RFC's state. I don't know the different variants of DNS protocols out there, but from RFC 1035
Z : Reserved ...
0
votes
0
answers
163
views
Search for a hex pattern throughout a volume
The inode table of my USB device was removed (/dev/sda). I am hoping to recover a file that contained a unique string which in hex format is:
"6d 61 79 32 30 32 30"
Is it possible to search ...
0
votes
2
answers
318
views
Recover hexdump asterisk with original content
Say I've generated two hexdump, which include the asterisk.
First file (xxd -r works):
hexdump random.dat
0000000 6161 6161 6161 6161 6161 6161 6161 6161
*
0000020 6161 6261 6262 6262 6262 6262 6262 ...
8
votes
2
answers
10k
views
What is the difference between the od, hd, hexdump and xxd commands?
What is the difference between the od, hd, hexdump and xxd commands ?
They are all commands for dumping files and they can all dump it in various formats such as hexadecimal, octal or binary. Why ...
5
votes
2
answers
626
views
Why does hexdump try to read through EOF?
When run from a terminal, hexdump does not react to a single ^D at the beginning of the line, as cat, od, bc, etc. do, unless there was no input yet:
prompt% hexdump -C
<control-D>
prompt% ...
2
votes
2
answers
3k
views
Get absolute memory addresses instead of relative offsets from hexdump
I'm trying to get a better understanding of memory addresses. I've just begun examining binaries with hexdump. Ex output:
0000000 cf fa ed fe 07 00 00 01 03 00 00 80 02 00 00 00
0000010 0e 00 00 00 ...
6
votes
2
answers
11k
views
How to get Hexdump output in same format as hexedit?
I'm trying to get the output of my hexdump command to look similar to hexedit default. I've been playing with the format strings using -e, but since there are not very good documentation, that ...
1
vote
1
answer
1k
views
How to include a backslash \ in the hexdump output format string?
What I want to see:
$ printf "\U1F600\n"|hexdump -v -e '1/1 " %03o"'|tr ' ' '\\'
\360\237\230\200\012
What I tried:
$ printf "\U1F600\n"|hexdump -v -e '1/1 "\\%03o"'
hexdump: bad conversion ...
9
votes
4
answers
14k
views
Get hex-only output from objdump
Say for example I've got this C function:
void f(int *x, int *y)
{
(*x) = (*x) * (*y);
}
When saved to f.c, compiling with gcc -c f.c produces f.o. objdump -d f.o gives this:
f.o: file ...
2
votes
0
answers
880
views
Why "hexdump" displays a new empty line?
I have noticed a strange behavior when hexdump displays the hex values of a file, I have executed the following command:
hexdump -C 1.txt
And I got the following result:
Notice how hexdump ...
10
votes
2
answers
4k
views
How to make hexdump not wait for 16 characters from stdin to display their hex values?
If I opened hexdump without any argument in the terminal:
hexdump
When I type something in the terminal and press Enter, hexdump will display the hex values for whatever characters I type.
But ...
2
votes
1
answer
2k
views
Why does xxd not show the byte order mark?
I have a Java class which the compiler refuses to compile due to \ufeff at the start of the file. I can view the fact that the BOM is present by vim -b file.java, but neither xxd nor hexdump show the ...
11
votes
3
answers
30k
views
Converting from binary to hex and back
Given a binary file, how do you convert it to a hex string and back, using only standard tools like sed and cut, on a minimal system with busybox installed?
These tools are not available:
perl
...
1
vote
1
answer
89
views
Grep output from USBPcap
I hope cygwin questions fits here.
If I try:
USBPcapCMD.exe -d \\.\USBPcap4 -o - | hexdump -C
it gives me the expected result. But if I try to grep that result I get nothing:
USBPcapCMD.exe -d \\....
2
votes
1
answer
2k
views
Hexdump format syntax - color
I'm trying to display a hexdump of a file and highlight carriage returns in red. I'm having a really hard time understanding the format of the formats option (-e).
Is it something like:
hexdump -e "...
4
votes
3
answers
3k
views
Portable one-byte per line hex dump
Suppose we want a minimalist one-byte per line ASCII hex dump. Under Linux using GNU od, this works:
echo foo | od -An -tx1 -w1 -v
Output:
66
6f
6f
0a
But that won't work with BSD derivatives,...
6
votes
1
answer
64k
views
How to convert hexdump to text?
I know that xxd is used to convert texts to hexdump but I want to do the opposite: convert an hex dump to text! Is there some command that I can use? Thanks for the help!
4
votes
1
answer
3k
views
Print one byte signed number with hexdump
I want to read /dev/input/mice with hexdump. Format is described at here at StackOverflow. What I need is to read one byte (flags), print it in hex format, then read two bytes (x and y move offset) ...
3
votes
1
answer
207
views
Can hexdump display its text translations in alternate encodings?
Hexdump's canonical format displays an ASCII translation of whatever it's looking at in the right column. I have a binary file, containing non-ASCII strings, for which I know some (not all) of the ...
1
vote
0
answers
300
views
Is there a utility that allows to create structured data from tcpdump hexdumps?
Sometimes I have to use tcpdump to troubleshoot problems with networking protocols that tcpdump does not know how to parse.
Is there a utility that could read tcpdump packets in hex dump format and ...
3
votes
1
answer
4k
views
hexdump: How to suppress offset column in hex mode
I wanted to get 16 bytes from a binary file, starting from 5th byte, no separation of bytes or words by spaces.
hexdump will do what I want, just the offset column is disturbing the output:
$ ...
5
votes
1
answer
3k
views
What do these numbers in a 'hexdump' of a file mean?
I created a simple file, 1.txt:
echo "hello" >> 1.txt
Then I dumped it:
hexdump 1.txt
And the terminal output:
0000000 68 65 6c 6c 6f 0a
0000006
What ...
3
votes
0
answers
1k
views
Procedure to figuring out U-Boot environment location from binary/hex dump
TL;DR:
I have a u-boot (version 1.6.1) enabled board, I have dumped the partition that contains the environment variables to a binary file using dd and now am stumped at finding out how to translate ...
1
vote
1
answer
3k
views
Strange ascii from hexdump of text file
I saw this question Why does Ctrl-D (EOF) exit the shell? and wanted to try the example on the second answer.
So i've created a file and used hexdump:
federico@home ~ $ cat > test.txt
prova
^C
...
0
votes
1
answer
2k
views
Commands for data manipulation of binary to octave/hex formats?
I need to convert binary data to hex/octave/any suitable format and back to binary when I am splitting one big 1GB file into files containing 777 events each which are not of the same size such that ...
5
votes
1
answer
2k
views
What is the meaning of Star symbol * in Hex data?
I see sometimes star symbol (*) in the hex editor, like
...
00001d0 0000 0000 0000 0000 0000 0000 0000 0000
*
00001f0 0000 0000 0000 0000 0008 0000 0000 0000
...
It is probably some sort of ...
43
votes
7
answers
27k
views
Is there an alternative to sed that supports unicode?
For example:
sed 's/\u0091//g' file1
Right now, I have to do hexdump to get hex number and put into sed as follows:
$ echo -ne '\u9991' | hexdump -C
00000000 e9 a6 91 ...
8
votes
3
answers
10k
views
Hexdump of a string starting at new lines?
Say I have a multi-line strings, but the entries on it are short; if I try to hexdump, then I get something like this:
echo "something
is
being
written
here" | hexdump -C
#00000000 73 6f 6d 65 74 ...
1
vote
1
answer
3k
views
Convert serialized Java object to human readable
I have object of class
class X {
private DateTime dt;
"constructor, set/get"
}
I have one instance of this object serialized in file.bin.
I want to show content of `file.bin on the Linux ...
51
votes
6
answers
45k
views
How to dump a binary file as a C/C++ string literal?
I have a binary file I would like to include in my C source code (temporarily, for testing purposes) so I would like to obtain the file contents as a C string, something like this:
\x01\x02\x03\x04
...
1
vote
1
answer
690
views
Hexdump binary file while honoring separators
I have a binary file where records are separated by newlines. hexdump just dumps everything with a fixed column width. Is there a tool to hexdump this file, while honoring the newline separator? (Any ...
2
votes
1
answer
3k
views
hexedit: change number of columns (bytes per line)
I am using hexedit to show/edit disk MBR (512 Bytes, copied with dd).
When I open the file, hexedit displays the file as 9 columns, 4 bytes
per column (36 bytes per line). That is very unfortunate. I ...
4
votes
1
answer
4k
views
Why do I get different output from hexdump compared to xxd?
Why does hexdump seem to miss out parts of the file, while xxd does not? The file is 32 bytes. So xxd output is correct.
$ xxd test.bin
0000000: 8888 8888 8888 8888 8888 8888 8888 8888 .................
7
votes
3
answers
4k
views
Achieving hexdump-like format, that includes binary strings, on the command line?
I really like hexdump, especially because you can define a custom format; say:
$ echo -e '\x00\x01\x02\x03' | hexdump -v -e '1/1 "%_ad: "' -e '4/1 "%02X "' -e '1/1 " : "' -e '4/1 "%_p"' -e '1/1 "\n"'
...
7
votes
3
answers
2k
views
Why do ls and hexdump disagree about my file size?
I have a file I created (in vim), for testing purposes (testing UTF-8 output in an SSH client). Odd things, however, are happening to this file.
I wondered what bytes were in the file, so I used ...
4
votes
3
answers
813
views
Why can't I edit links and directories directly?
There are programs such as hexedit that allow one to edit each bit of a file, and as I keep hearing that in Unix "everything is a file", I tried to edit some directory, expecting bytes referring to ...
10
votes
1
answer
3k
views
What does `*` mean using hexdump -C?
I've been doing an exersice in attempt to understanding some of what's going on under the hood of a program. I wrote a small C program, and compiled it on i386 Linux (Ubuntu 12.04) using gcc. I then ...