How would I go about creating a hexdump type of view of an imported binary file? for example, (format is
<file offset> | <hex contents> | <ascii representation>
)
Which I could then perform an analysis on top of.
UPDATE
I have gotten pretty close with the following
hexdata = ReadByteArray["..file"];
hexshowAmount = 80;
hex = (hexdata[[1 ;; hexshowAmount]] // Normal);
tbl = hex // Partition[#, UpTo@16] &;
nrows = Length@tbl;
ncols = Length@tbl[[1]];
myFunc[val_] := PrimeQ[val]; (* Must Return True or False *)
labels = Flatten@
Table[If[myFunc[tbl[[i]][[j]]], {i, j} -> Hue[RandomReal[], .2, .9],
Nothing], {i, nrows}, {j, ncols}];
tbl // Grid[Map[BaseForm[#, 16] &, #, {2}], Frame -> All,
Alignment -> Center, Spacings -> {1, 1},
Background -> {None, None, labels}, ItemSize -> {2, 2}] &
Open for improvements though.