aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2019-11-14 16:18:28 +0100
committerjohannst <johannes.stoelp@gmail.com>2019-11-14 16:18:28 +0100
commit578c685b3be3521f4a8adb800b13678fd3726f92 (patch)
tree0995a89f4bb9c0a866f655a8f3424de50129f877
parentfe8298a637792f8f5d075f7c11a5005d55d758fd (diff)
downloadnotes-578c685b3be3521f4a8adb800b13678fd3726f92.tar.gz
notes-578c685b3be3521f4a8adb800b13678fd3726f92.zip
added dump section to od
-rw-r--r--binary.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/binary.txt b/binary.txt
index 7510516..6445d2a 100644
--- a/binary.txt
+++ b/binary.txt
@@ -14,7 +14,10 @@
-ta print as named character
-tc printable chars or backslash escape
-w4 print 4 bytes per line
+ -j <n> skip <n> bytes from file, (hex if start with 0x)
+ -N <n> dump <n> bytes (hex of start with 0x)
+ ## ascii chars to hex string
echo -n AAAABBBB | od -An -w4 -tx4
>> 41414141
>> 42424242
@@ -24,6 +27,21 @@
>> del E L F nl
>> 177 E L F \n
+ ## extract part of file (eg .rodata section form ELF)
+ readelf -W -S foo
+ >> Section Headers:
+ >> [Nr] Name Type Address Off Size ES Flg Lk Inf Al
+ >> ...
+ >> [15] .rodata PROGBITS 00000000004009c0 0009c0 000030 00 A 0 0 16
+ od -j 0x0009c0 -N 0x30 -tx4 -w4 foo
+ >> 0004700 00020001
+ >> 0004704 00000000
+ >> *
+ >> 0004740 00000001
+ >> 0004744 00000002
+ >> 0004750 00000003
+ >> 0004754 00000004
+
# xxd(1) *xxd*
=========
args: