यदि आपके पास फ़ाइल में लंबा टेक्स्ट या टेक्स्ट है तो आप binmake टूल का भी उपयोग कर सकते हैं जो आपको कुछ बाइनरी डेटा टेक्स्ट प्रारूप में वर्णन करने और बाइनरी फ़ाइल (या stdout पर आउटपुट) उत्पन्न करने की अनुमति देता है। यह अंतहीनता और संख्या स्वरूपों को बदलने और टिप्पणियों को स्वीकार करने की अनुमति देता है।
इसकी डिफ़ॉल्ट प्रारूप हेक्साडेसिमल लेकिन इस तक ही सीमित नहीं है।
सबसे पहले हो और संकलन binmake:
$ git clone https://github.com/dadadel/binmake
$ cd binmake
$ make
आप कर सकते हैं पाइप यह stdin
और stdout
का उपयोग कर:
$ echo '32 decimal 32 61 %x20 %x61' | ./binmake | hexdump -C
00000000 32 20 3d 20 61 |2 = a|
00000005
या फ़ाइलों का उपयोग करें।
# an exemple of file description of binary data to generate
# set endianess to big-endian
big-endian
# default number is hexadecimal
00112233
# man can explicit a number type: %b means binary number
%b0100110111100000
# change endianess to little-endian
little-endian
# if no explicit, use default
44556677
# bytes are not concerned by endianess
88 99 aa bb
# change default to decimal
decimal
# following number is now decimal
# strings are delimited by " or '
"this is some raw string"
# explicit hexa number starts with %x
%xff
अपने बाइनरी फ़ाइल file.bin
जनरेट करें::
$ ./binmake file.txt file.bin
$ hexdump file.bin -C
00000000 00 11 22 33 4d e0 77 66 55 44 88 99 aa bb 7b 74 |.."3M.wfUD....{t|
00000010 68 69 73 20 69 73 20 73 6f 6d 65 20 72 61 77 20 |his is some raw |
00000020 73 74 72 69 6e 67 ff |string.|
00000027
संपादित @Humpparitari के लिए धन्यवाद तो अपने पाठ फ़ाइल
file.txt
बनाने! – 1010