Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ssignment 1.pal x * Course Hero f Facebook x + annuce/content/enforced/46128-202020CSCI-352-01E/Assignment%201.pdf?_&d21SessionVal=VOLtoBtrkDnH96e2nLoNzvXHM You are going to write a Python program that represents a command line version

image text in transcribed

ssignment 1.pal x * Course Hero f Facebook x + annuce/content/enforced/46128-202020CSCI-352-01E/Assignment%201.pdf?_&d21SessionVal=VOLtoBtrkDnH96e2nLoNzvXHM You are going to write a Python program that represents a command line version of a hexadecimal editor. This program will be similar to the Linux built-in command line hexadecimal editors such as xxd and hexdump. The program will first ask the user to enter the name of any file you want to read. Your program will then print the binary contents of the file into the standard output (screen). The output will be divided into three main sections: the offset values in decimal, sixteen space-separated hexadecimal bytes, followed by the same sixteen bytes but in ASCII value. The figure below shows an example of the first 48 bytes of an output, and the three different sections: 00000000 | do 66 c1 ea 10 f7 76 la 86 d6 8a 56 40 8a e8 colll.f....V....V@... 00000016 ||e4 06 Oa cc b8 01 02 cd 13 66 61 Of 82 75 ff 81 |1.........fa..u.. 00000032 || c3 00 02 66 40 49 75 94 c3 42 4f 4f 54 4d 47 52||1 ... f@Iu.. BOOTMGR offset Hexadecimal Values ASCII Values . Notice that in the 2nd section there a space between the 8th and 9 byte. Each output line represents 16 bytes. The first column shows the decimal offset, where the first byte from the first line represents the oth byte: the second line starts with byte 16th and so on. The final section only shows the printable ASCII characters. These are the ASCII characters can be printed on the screen (usually they are the characters with ASCII values between 0x 20 and 0x7E The rest of the unprintable bytes are replaced by a period (). The following built-in Python functions will be useful in this situation: chr, hex, ord. More information about these functions can be found here: https://docs.python.org/3/library/functions.html What to hand in Submit your program electronically through D2L. Please hand in the Python program (py file oripynb) ssignment 1.pal x * Course Hero f Facebook x + annuce/content/enforced/46128-202020CSCI-352-01E/Assignment%201.pdf?_&d21SessionVal=VOLtoBtrkDnH96e2nLoNzvXHM You are going to write a Python program that represents a command line version of a hexadecimal editor. This program will be similar to the Linux built-in command line hexadecimal editors such as xxd and hexdump. The program will first ask the user to enter the name of any file you want to read. Your program will then print the binary contents of the file into the standard output (screen). The output will be divided into three main sections: the offset values in decimal, sixteen space-separated hexadecimal bytes, followed by the same sixteen bytes but in ASCII value. The figure below shows an example of the first 48 bytes of an output, and the three different sections: 00000000 | do 66 c1 ea 10 f7 76 la 86 d6 8a 56 40 8a e8 colll.f....V....V@... 00000016 ||e4 06 Oa cc b8 01 02 cd 13 66 61 Of 82 75 ff 81 |1.........fa..u.. 00000032 || c3 00 02 66 40 49 75 94 c3 42 4f 4f 54 4d 47 52||1 ... f@Iu.. BOOTMGR offset Hexadecimal Values ASCII Values . Notice that in the 2nd section there a space between the 8th and 9 byte. Each output line represents 16 bytes. The first column shows the decimal offset, where the first byte from the first line represents the oth byte: the second line starts with byte 16th and so on. The final section only shows the printable ASCII characters. These are the ASCII characters can be printed on the screen (usually they are the characters with ASCII values between 0x 20 and 0x7E The rest of the unprintable bytes are replaced by a period (). The following built-in Python functions will be useful in this situation: chr, hex, ord. More information about these functions can be found here: https://docs.python.org/3/library/functions.html What to hand in Submit your program electronically through D2L. Please hand in the Python program (py file oripynb)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions