aaru-dps / Aaru

Aaru Data Preservation Suite
Other
487 stars 35 forks source link

`media info` is missing a couple newlines [5.3.1, 6.x] #750

Open Whovian9369 opened 1 year ago

Whovian9369 commented 1 year ago

Version

Development commit

Commit hash

b1ac16c5

Tested debug version?

Which operating systems have you used?

What is the architectural bit size you're using?

What processor are you using?

Device manufacturer

ASUS

Device model

BW-16D1HT

Bus the device uses to attach to the computer

USB cable or card reader manufacturer

No response

USB cable or card reader model

No response

What were you doing when it failed?

Description

There are not newlines where I believe there should be newlines in the output for aaru media info, specifically right before the word "Offset" in the following text block.

Blu-ray DI Unit format dependent contents as hex follows:Offset   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
000000   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000010   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................

Blu-ray Burst Cutting Area:
Blu-ray Burst Cutting Area in hex follows:Offset   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
000000   FC 42 44 4F 01 21 01 03 00 00 00 00 00 00 00 00   üBDO.!..........
000010   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000020   08 40 00 01 9F 6C 63 F1 4D FA 8B 9E FC 45 26 54   .@...lcñMú..üE&T
000030   09 40 00 01 1F E7 03 93 45 3D B5 56 55 58 E7 23   .@...ç..E=µVUXç#

Exact command line used

aaru.exe m info 'D:'

Expected behavior

There to be newlines at the given locations.

Actual behavior

There are not newlines at the given locations.

Output of command execution with debug output enabled

I do not believe this applies.

Media details

Original media is a Playstation 4 disc, but I do not believe it to be otherwise relevant to this issue.

robin-francois commented 1 year ago

Issue seems to be the following lines: https://github.com/aaru-dps/Aaru.Decoders/blob/bd76adc35e1536654fead662288b0fd82b0d061f/Bluray/DI.cs#L392-L395

Adapting to the following may fix the issue sb.AppendFormat("Blu-ray DI Unit format dependent contents as hex follows:").AppendLine();

robin-francois commented 1 year ago

We might want to have a look at all occurrences of the `ByteArrayToHexArrayString function: https://github.com/search?p=2&q=org%3Aaaru-dps+ByteArrayToHexArrayString&type=Code