xebin
is a small command-line utility for manipulating atari binary (executable) files.
It can list contents of binary file, merge several files into a single loadable file,
or pack file in a way similar to Piotr Fusik’s FlashPack.
xebin
is written in D programming language and tested
under Linux and, occasionally, Windows. However, it should be possible to build and run it on any
platform, for which D compiler is available.
It is designed to be easily embeddable in build scripts.
A general syntax is:
$ xebin command [options] [input_files]
You can place options wherever you wish in the command line, as well as join single-letter options together, if they do not require parameters.
For all specific commands below you can skip input files specification.
In such case, xebin
will read from standard input.
Similarly, xebin
writes its output to standard output, but you can (and usually
you should) specify an output file name with -o
or --output
option.
When using -v
or --verbose
option, additional output is always written to
stdout
.
You can see the list of available commands and options by typing:
$ xebin help
$ xebin l[ist] [input_files]
Example output:
D:\proj\tipview>xebin l tv10.xex 0. 8C00-903C (043D) 1. 91DD-A3B7 (11DB) 2. Run 91FD
With -v
contents of packed blocks are shown, e.g.:
D:\proj\fail\vrgb\xebin l vrgb10.xex 0. 4000-470E (070F) (FlashPack 1.0) 0. 3000-39A0 (09A1) 1. 3C21-3C48 (0028) 2. 3CC1-3CF1 (0031) 3. Run 3000 1. Init 4000
$ xebin m[erge] [-o=fn] [-v] [input_files]
Blocks from all files are concatenated in the order they appear in the list of input files.
Reduntant FFFF
headers are dropped.
-v
displays layout of resulting file.
$ xebin e[xtract] [-n=pos] [-r] [-o=fn] [-v] [input_files]
Default option is to extract first block of first input file, including its binary header.
Option -n=pos
or --position=pos
allows extracting other blocks.
Block numbering is continuous across all input files and starts from 0.
Only one block is extracted at a time.
Option -r
or --raw
strips header from extracted block.
-v
displays info about extracted block.
$ xebin d[isasm] [-o=fn] [input_files]
$ xebin p[ack] [-a=ad] [-s] [-o=fn] [-v] [input_files]
The command compresses a binary file using FlashPack algorithm. For each group of blocks between Init and Run blocks, it creates a single packed block with its own depacker. Init and Run blocks are copied unchanged.
xebin
tries to determine address of packed block so it won’t collide with
unpacked blocks. You can override its guess, or just give it a hand when it fails
to do so, by using -a=ad
or --address=ad
option. Address may be supplied
in decimal or hexadecimal (with 0x
or $
prefix) notation. Address prefixed
with -
is treated as address of the last byte of packed block.
-s
or --disable-os
will cause the interrupts and OS ROM be disabled during depacking.
Apart from an unnoticeable speed-up, it allows for placing unpacked blocks in areas
of RAM normally hidden under OS ROM.
-v
displays layout of resulting file and some statistics.
- xebin 1.1.0 (2011-04-20)
-
Fixed bug in auto address setting for packed data. Command line options and parameters work according to description. Added support for hexadecimal addresses. Added simple disassembler. Added option to extract block from binary file. Added option to list contents of compressed blocks.
xebin pack -v
shows some statistics. Build process simplified by incorporating xasm in xebin. - xebin 1.0.0 (2011-01-13)
-
Initial release.
It is impossible to set different addresses for multiple input files in pack option, as well as different settings for OS ROM and interrupts.
Issues with xebin
should be reported via this tracker.
- Piotr Fusik
-
Original FlashPack program, depacker routines, testing.
- Adrian Matoga
-
Programming.