BinViewRequires LightWave 6.0 or later. Generic (Layout) and Command (Modeler).
The source code for BinView is one of the programming samples in the plug-in SDK. |
![]() |
| BinView is a binary file viewer. Programmers use utilities like BinView
(sometimes called hex editors) to debug code that reads and writes binary files. Most such
tools are limited to displaying the file data as bytes written in hexadecimal format, but
BinView can display the contents of binary files as any of the numeric types used by most
computers. You don't have to know, for example, that 3F 80 00 00 is the byte
pattern corresponding to the floating-point number 1.0. BinView can show it to
you both ways. You can also use BinView to look at text files. They aren't as easy to read, of course, but you can check, for example, which line ending is used by the file, something you can't see in most text editors. Different computers use 0D, 0A, or a combination of the two at the ends of lines. Poorly written software can confuse line endings, using more than one convention in a file, adding spurious characters, or using a convention that differs from the one used on the intended target platform. BinView is only a viewer, not an editor. It can't be used to change the contents of binary files. This is an intentional safety limitation. You can't damage a file just by looking at it in BinView. Source File You begin in BinView by choosing the file you want to look at. When you first open BinView, it automatically displays a file dialog so that you can choose the first file. Any time you want to look at a different file, click on the New button (or press the n key), or type a new filename in the edit field and press Enter. Data Window
The data window is divided into three columns. The offset column, on the left, numbers the bytes. The first byte in the file is byte 0 (or, speaking technically, the byte at offset 0 from the start of the file), the second row starts with byte 16, and so on. The file contents are displayed in the center column. The column on the right displays the same data, interpreted as printable characters, which makes it easy to see text embedded in the file. A row of controls just above the data window tells you about the display and lets you change what it shows.
Navigation You can move around in the file using the cursor keys. The left and right arrow keys shift by a single byte, and the up and down arrow keys shift the data a row at a time. You can also use the Page Up, Page Down, Home and End keys. To jump to specific byte offsets, type a number in the Jump edit field and press Enter. You can choose whether the jump is absolute (the * key), or relative to the current position forward (+) or backward (-). To repeat the jump, press j. To search for a specific sequence of bytes, type the sequence in the Search edit field and click the Search button or press Enter. BinView always searches forward from the current byte offset. To repeat a search, press s. BinView can interpret what you type as text (t), a mixture of text and hexadecimal byte values (h), or as the current data type of the display (c). If the search string is text, BinView looks for the literal characters in the string. For searches of the current data type, BinView parses the search string, converting it into the byte sequence that would be used to represent the values. In Text + Hex mode, the search string can contain both byte values, written as two-digit hex numbers separated by spaces, and printable characters, each preceeded by a forward slash (/).
The actual bytes for Current data type search strings depends, of course, on what you're displaying. Here I'm assuming Motorola Float. The byte values of text characters are their ASCII values. Print To File When I was writing the LightWave object file format supplement, I needed a way to display binary file contents in the document. Rather than copy the BinView display by hand, which would be tedious and error-prone, I created the Print To File dialog.
Press the p key to open the dialog. If the output file already exists, Write mode will replace it, while Append mode will only add the new output to the end of the existing file. You can print any or all of the three columns in the data window, and you can add a comment that will help you identify the file contents later. Keyboard Shortcut Summary
|