diff options
| author | Timo Savinen <tjsa@iki.fi> | 2005-11-15 18:53:17 +0000 |
|---|---|---|
| committer | Hadrien Dorio <hadrien.dorio@gmail.com> | 2017-12-16 00:24:06 +0100 |
| commit | dcefa7a144fb35b23d1ca339d58f3b9e58e7faa3 (patch) | |
| tree | 733c9942e36b0c7ecaf7597036806d7f1d2a536a /doc | |
| parent | 63ae206f2970076a9d09e90d7fbcb17ec1fa26e4 (diff) | |
| download | binary-block-editor-dcefa7a144fb35b23d1ca339d58f3b9e58e7faa3.tar.gz binary-block-editor-dcefa7a144fb35b23d1ca339d58f3b9e58e7faa3.zip | |
0.1.8
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/bbe.1 | 30 | ||||
| -rw-r--r-- | doc/bbe.html | 35 | ||||
| -rw-r--r-- | doc/bbe.info | 63 | ||||
| -rw-r--r-- | doc/bbe.texi | 43 |
4 files changed, 109 insertions, 62 deletions
@@ -25,7 +25,7 @@ .\" .br insert line break .\" .sp <n> insert n+1 empty lines .\" for manpage-specific macros, see man(7) -.TH "BBE" "1" "2005-10-20" "" "" +.TH "BBE" "1" "2005-11-13" "" "" .SH "NAME" bbe \- binary block editor .SH "SYNOPSIS" @@ -127,6 +127,12 @@ Before printing a block, the input stream offset at the begining of the block is B \fIf\fR Before printing a block, the block number is printed (first block == 1) \fIf\fR can be H, D or O for Hexadecimal, Decimal or Octal format of block number. +.TP +> \fIfile\fR +Before printing a block, the contents of file \fIfile\fR is printed. +.TP +< \fIfile\fR +After printing a block, the contents of file \fIfile\fR is printed. .LP \fBByte commands\fR .TP @@ -170,21 +176,27 @@ w \fIfile\fR Write bytes from the current block to file \fIfile\fR. Commands before w\-command have effect to what will be written. %B or %nB in \fIfile\fR will be replaced by current block number. n in %nB is field length, leading zero in n causes the block number to be left padded with zeroes. .TP -& \fIbyte\fR -Performs binary and with \fIbyte\fR. +& \fIc\fR +Performs binary and with \fIc\fR. .TP -| \fIbyte\fR -Performs binary or with \fIbyte\fR. +| \fIc\fR +Performs binary or with \fIc\fR. .TP -^ \fIbyte\fR -Performs binary xor with \fIbyte\fR. +^ \fIc\fR +Performs binary xor with \fIc\fR. .TP ~ Performs binary negation. +.TP +u \fIn\fR \fIc\fR +All bytes from start of the block to offset \fIn\fR are replaced by \fIc\fR. +.TP +f \fIn\fR \fIc\fR +All bytes starting from offset \fIn\fR to end of the block are replaced by \fIc\fR. .LP Nonvisible characters in strings can be escaped same way as in block definition strings. Character '/' in s and y commands can be any visible character. .LP -Note that the D, A, I, F, B, c, s, i, y, p and d commands cause the length of input and output streams to be different. +Note that the D, A, I, F, B, c, s, i, y, p, <, > and d commands cause the length of input and output streams to be different. .SH "EXAMPLES" .TP @@ -203,4 +215,4 @@ Blocks between strings "\\x2f\\x34\\x6a" and "\\xff\\xff" are written to file /t .BR sed (1). .SH "AUTHOR" -Timo Savinen <tjsa@iki.fi>. +Timo Savinen <tjsa@iki.fi > diff --git a/doc/bbe.html b/doc/bbe.html index 0066ea9..1c3505f 100644 --- a/doc/bbe.html +++ b/doc/bbe.html @@ -7,7 +7,7 @@ <link title="Top" rel="top" href="#Top"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- -This file documents the `bbe' - binary block editor +This file documents version 0.1.8 of `bbe', a binary block editor. Copyright (C) 2005 Timo Savinen @@ -48,7 +48,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <h2 class="unnumbered">bbe</h2> -<p>This file documents the <span class="command">bbe</span> - binary block editor +<p>This file documents version 0.1.8 of <span class="command">bbe</span>, a binary block editor. <p>Copyright © 2005 Timo Savinen @@ -306,7 +306,11 @@ Stream offset starts at zero. <var>f</var> can have one of following values: </dl> <br><dt><code>B </code><var>f</var><dd>Before block contents the current block number and colon is printed in format specified by <var>f</var>. -Block numbering starts at one. <var>f</var> can have one of the sames codes as <code>F</code>-command +Block numbering starts at one. <var>f</var> can have one of the sames codes as <code>F</code>-command. + + <br><dt><code>> </code><span class="file">file</span><dd>Before printing a block, the contents of file <span class="file">file</span> is printed. + + <br><dt><code>< </code><span class="file">file</span><dd>After printing a block, the contents of file <span class="file">file</span> is printed. </dl> <h4 class="subheading">Byte commands are:</h4> @@ -331,6 +335,10 @@ in range <code>'0'</code> – <code>'9'</code> are not converted. <br><dt><code>l </code><var>n</var><dd>Commands appearing after <code>l</code>-command have no effect concerning bytes starting from the byte number <var>n</var> of the block. + <br><dt><code>u </code><var>n</var> <var>c</var><dd>All bytes from start of the block to offset <var>n</var> are replaced by <var>c</var>. + + <br><dt><code>f </code><var>n</var> <var>c</var><dd>All bytes starting from offset <var>n</var> to the end of the block are replaced by <var>c</var>. + <br><dt><code>p </code><var>format</var><dd>Contents of block is printed in formats specified by <var>format</var>. <var>format</var> can contain following format codes: <dl> <dt><var>H</var><dd>Hexadecimal. @@ -351,7 +359,8 @@ in range <code>'0'</code> – <code>'9'</code> are not converted. <br><dt><code>s/</code><var>search</var><code>/</code><var>replace</var><code>/</code><dd>All occurences of <var>search</var> are replaced by <var>replace</var>. <var>replace</var> can be empty. Separator <code>/</code> can be replaced by any character not present in <var>search</var> or <var>replace</var>. - <br><dt><code>w </code><span class="file">file</span><dd>Contents of blocks are written to file <span class="file">file</span>. <strong>Note</strong>: Data inserted by commands <code>A</code> and <code>I</code> + <br><dt><code>w </code><span class="file">file</span><dd>Contents of blocks are written to file <span class="file">file</span>. <strong>Note</strong>: Data inserted by commands <code>A</code>, <code>I</code>, +<code>></code> and <code><</code> are written to file <span class="file">file</span> and <code>j</code> and <code>l</code> commands have no effect on <code>w</code>-commands. Zero size files are not preserved.<br> Filename can contain format string <code>%B</code> or <code>%nB</code>, these format strings are replace by current block number (starting from one), causing every block to have it's own file. In <code>%nB</code>, the <code>n</code> is field width in range 0-99. If <code>n</code> has a leading zero, then the block numbers will be left padded with zeroes. @@ -359,11 +368,11 @@ In <code>%nB</code>, the <code>n</code> is field width in range 0-99. If <code>n <br><dt><code>y/</code><var>source</var><code>/</code><var>dest</var><code>/</code><dd>Translate bytes in <var>source</var> to the corresponding bytes in <var>dest</var>. <var>source</var> and <var>dest</var> must have equal length. Separator <code>/</code> can be replaced by any character not present in <var>source</var> or <var>dest</var>. - <br><dt><code>& c</code><dd>Performs binary and with <var>c</var> on block contents. + <br><dt><code>& </code><var>c</var><dd>Performs binary and with <var>c</var> on block contents. - <br><dt><code>| c</code><dd>Performs binary or with <var>c</var> on block contents. + <br><dt><code>| </code><var>c</var><dd>Performs binary or with <var>c</var> on block contents. - <br><dt><code>^ c</code><dd>Performs exclusive or with <var>c</var> on block contents. + <br><dt><code>^ </code><var>c</var><dd>Performs exclusive or with <var>c</var> on block contents. <br><dt><code>~</code><dd>Performs binary negation on block contents. </dl> @@ -385,10 +394,6 @@ systems are not tested. <dl> <dt><em>Strings in block definition</em><dt><em>Search string in </em><code>s</code><em> command</em><dd>are limited to <em>16384</em> bytes. -<br> - - <br><dt><em>Total data to be inserted by </em><code>s</code><em> and </em><code>i</code><em> commands</em><dd>is <em>245760</em> bytes, that means the total data in command definitions, of course it can be inserted several times. -<br> </dl> <div class="node"> @@ -411,13 +416,13 @@ and if the end of input stream is found before 128'th byte of the last block is <li>Start of the block is searched. If found, data before block is written to output stream (unless <span class="option">-s</span> is defined) and step 2 is executed. - <li>Block commands affecting the start of the block (<code>I</code>, <code>D</code>, <code>J</code>, <code>N</code>, <code>F</code> and <code>B</code>) are executed. + <li>Block commands affecting the start of the block (<code>I</code>, <code>D</code>, <code>J</code>, <code>N</code>, <code>F</code>, <code>></code> and <code>B</code>) are executed. <li>The block is scanned byte by byte and all byte commands (lower case letters) are executed. <strong>Note</strong>: Commands are executed on results of previous commands, if e.g. the first byte of the block is deleted, the following commands don't 'see' the removed byte. - <li>When end of the block is reached the end of the block commands (<code>A</code>) are executed. + <li>When end of the block is reached the end of the block commands (<code>A</code> and <code><</code>) are executed. <li>Next block is searched, data between the blocks, if not suppressed with <span class="option">-s</span>, is written to output stream. </ol> @@ -486,7 +491,9 @@ The start sequence is not printed.<br> <br><dt><span class="samp">bbe -b "/\xff\xd8\xff/:/\xff\xd9/" -s -e "w pic%02B.jpg" -o /dev/null manual.pdf</span><dd>Extract jpg-images from pdf-file to separate jpg-files (assuming that the jpg start/stop sequences does not appear in other context than jpg-images). -Files will be named as <span class="file">pic01.jpg</span>, <span class="file">pic02.jpg</span>, <span class="file">pic03.jpg</span>,<small class="dots">...</small> +Files will be named as <span class="file">pic01.jpg</span>, <span class="file">pic02.jpg</span>, <span class="file">pic03.jpg</span>,<small class="dots">...</small> <br> + + <br><dt><span class="samp">bbe -b "_<body>_:_</body>_" -s -o temp nicebody.html</span><dt><span class="samp">bbe -b "_<body>_:_</body>_" -e "D;< temp" -o tmpindex.html index.html</span><dt><span class="samp">mv tmpindex.html index.html</span><dd>The body part of the html-document <span class="file">index.html</span> is replaced by the body of the document <span class="file">nicebody.html</span>. </dl> <div class="node"> diff --git a/doc/bbe.info b/doc/bbe.info index 771d0c0..63cb3ba 100644 --- a/doc/bbe.info +++ b/doc/bbe.info @@ -1,6 +1,6 @@ This is bbe.info, produced by makeinfo version 4.7 from bbe.texi. - This file documents the `bbe' - binary block editor + This file documents version 0.1.8 of `bbe', a binary block editor. Copyright (C) 2005 Timo Savinen @@ -23,7 +23,7 @@ File: bbe.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) bbe *** -This file documents the `bbe' - binary block editor +This file documents version 0.1.8 of `bbe', a binary block editor. Copyright (C) 2005 Timo Savinen @@ -302,7 +302,13 @@ Block commands are: `B F' Before block contents the current block number and colon is printed in format specified by F. Block numbering starts at one. - F can have one of the sames codes as `F'-command + F can have one of the sames codes as `F'-command. + +`> `file'' + Before printing a block, the contents of file `file' is printed. + +`< `file'' + After printing a block, the contents of file `file' is printed. Byte commands are: ------------------ @@ -335,6 +341,13 @@ block, first byte is number zero. Commands appearing after `l'-command have no effect concerning bytes starting from the byte number N of the block. +`u N C' + All bytes from start of the block to offset N are replaced by C. + +`f N C' + All bytes starting from offset N to the end of the block are + replaced by C. + `p FORMAT' Contents of block is printed in formats specified by FORMAT. FORMAT can contain following format codes: @@ -367,9 +380,9 @@ block, first byte is number zero. `w `file'' Contents of blocks are written to file `file'. *Note*: Data - inserted by commands `A' and `I' are written to file `file' and - `j' and `l' commands have no effect on `w'-commands. Zero size - files are not preserved. + inserted by commands `A', `I', `>' and `<' are written to file + `file' and `j' and `l' commands have no effect on `w'-commands. + Zero size files are not preserved. Filename can contain format string `%B' or `%nB', these format strings are replace by current block number (starting from one), causing every block to have it's own file. In `%nB', the `n' is @@ -381,13 +394,13 @@ block, first byte is number zero. SOURCE and DEST must have equal length. Separator `/' can be replaced by any character not present in SOURCE or DEST. -`& c' +`& C' Performs binary and with C on block contents. -`| c' +`| C' Performs binary or with C on block contents. -`^ c' +`^ C' Performs exclusive or with C on block contents. `~' @@ -407,9 +420,6 @@ GB), other systems are not tested. _Strings in block definition_ _Search string in `s' command_ are limited to _16384_ bytes. -_Total data to be inserted by `s' and `i' commands_ - is _245760_ bytes, that means the total data in command - definitions, of course it can be inserted several times. File: bbe.info, Node: bbe programs, Next: Problems, Prev: Invoking bbe, Up: Top @@ -432,7 +442,7 @@ Basic execution cycle: executed. 2. Block commands affecting the start of the block (`I', `D', `J', - `N', `F' and `B') are executed. + `N', `F', `>' and `B') are executed. 3. The block is scanned byte by byte and all byte commands (lower case letters) are executed. *Note*: Commands are executed on @@ -440,7 +450,7 @@ Basic execution cycle: is deleted, the following commands don't 'see' the removed byte. 4. When end of the block is reached the end of the block commands - (`A') are executed. + (`A' and `<') are executed. 5. Next block is searched, data between the blocks, if not suppressed with `-s', is written to output stream. @@ -510,6 +520,11 @@ Few examples: that the jpg start/stop sequences does not appear in other context than jpg-images). Files will be named as `pic01.jpg', `pic02.jpg', `pic03.jpg',... +`bbe -b "_<body>_:_</body>_" -s -o temp nicebody.html' +`bbe -b "_<body>_:_</body>_" -e "D;< temp" -o tmpindex.html index.html' +`mv tmpindex.html index.html' + The body part of the html-document `index.html' is replaced by the + body of the document `nicebody.html'. File: bbe.info, Node: Problems, Prev: bbe programs, Up: Top @@ -530,15 +545,15 @@ problems. Tag Table: -Node: Top766 -Node: Overview1811 -Node: Samples2298 -Node: Invoking bbe3696 -Node: Invocation4230 -Node: Block5242 -Node: Commands7288 -Node: Limits11616 -Node: bbe programs12169 -Node: Problems16270 +Node: Top781 +Node: Overview1841 +Node: Samples2328 +Node: Invoking bbe3726 +Node: Invocation4260 +Node: Block5272 +Node: Commands7318 +Node: Limits11994 +Node: bbe programs12372 +Node: Problems16758 End Tag Table diff --git a/doc/bbe.texi b/doc/bbe.texi index a56d989..5e8ade6 100644 --- a/doc/bbe.texi +++ b/doc/bbe.texi @@ -6,10 +6,10 @@ @finalout @c %**end of header -@set VERSION 0.1.7 +@set VERSION 0.1.8 @copying -This file documents the @command{bbe} - binary block editor +This file documents version @value{VERSION} of @command{bbe}, a binary block editor. Copyright @copyright{} 2005 Timo Savinen @@ -308,7 +308,13 @@ Octal. @item B @var{f} Before block contents the current block number and colon is printed in format specified by @var{f}. -Block numbering starts at one. @var{f} can have one of the sames codes as @code{F}-command +Block numbering starts at one. @var{f} can have one of the sames codes as @code{F}-command. + +@item > @file{file} +Before printing a block, the contents of file @file{file} is printed. + +@item < @file{file} +After printing a block, the contents of file @file{file} is printed. @end table @subheading Byte commands are: @@ -340,6 +346,12 @@ Commands appearing after @code{j}-command have no effect concerning bytes 0-@var @item l @var{n} Commands appearing after @code{l}-command have no effect concerning bytes starting from the byte number @var{n} of the block. +@item u @var{n} @var{c} +All bytes from start of the block to offset @var{n} are replaced by @var{c}. + +@item f @var{n} @var{c} +All bytes starting from offset @var{n} to the end of the block are replaced by @var{c}. + @item p @var{format} Contents of block is printed in formats specified by @var{format}. @var{format} can contain following format codes: @table @var @@ -369,7 +381,8 @@ All occurences of @var{search} are replaced by @var{replace}. @var{replace} can character not present in @var{search} or @var{replace}. @item w @file{file} -Contents of blocks are written to file @file{file}. @strong{Note}: Data inserted by commands @code{A} and @code{I} +Contents of blocks are written to file @file{file}. @strong{Note}: Data inserted by commands @code{A}, @code{I}, +@code{>} and @code{<} are written to file @file{file} and @code{j} and @code{l} commands have no effect on @code{w}-commands. Zero size files are not preserved.@* Filename can contain format string @code{%B} or @code{%nB}, these format strings are replace by current block number (starting from one), causing every block to have it's own file. In @code{%nB}, the @code{n} is field width in range 0-99. If @code{n} has a leading zero, then the block numbers will be left padded with zeroes. @@ -379,13 +392,13 @@ In @code{%nB}, the @code{n} is field width in range 0-99. If @code{n} has a lead Translate bytes in @var{source} to the corresponding bytes in @var{dest}. @var{source} and @var{dest} must have equal length. Separator @code{/} can be replaced by any character not present in @var{source} or @var{dest}. -@item & c +@item & @var{c} Performs binary and with @var{c} on block contents. -@item | c +@item | @var{c} Performs binary or with @var{c} on block contents. -@item ^ c +@item ^ @var{c} Performs exclusive or with @var{c} on block contents. @item ~ @@ -406,11 +419,6 @@ There are however, some limitations in block and command definitions: @item Strings in block definition @itemx Search string in @code{s} command are limited to @emph{16384} bytes. -@* - -@item Total data to be inserted by @code{s} and @code{i} commands -is @emph{245760} bytes, that means the total data in command definitions, of course it can be inserted several times. -@* @end table @@ -429,7 +437,7 @@ Start of the block is searched. If found, data before block is written to output step 2 is executed. @item -Block commands affecting the start of the block (@code{I}, @code{D}, @code{J}, @code{N}, @code{F} and @code{B}) are executed. +Block commands affecting the start of the block (@code{I}, @code{D}, @code{J}, @code{N}, @code{F}, @code{>} and @code{B}) are executed. @item The block is scanned byte by byte and all byte commands (lower case letters) are executed. @@ -437,7 +445,7 @@ The block is scanned byte by byte and all byte commands (lower case letters) are the following commands don't 'see' the removed byte. @item -When end of the block is reached the end of the block commands (@code{A}) are executed. +When end of the block is reached the end of the block commands (@code{A} and @code{<}) are executed. @item Next block is searched, data between the blocks, if not suppressed with @option{-s}, is written to output stream. @@ -525,7 +533,12 @@ The least significant nybble of bytes after @code{x5f} is cleared.@* @item bbe -b "/\xff\xd8\xff/:/\xff\xd9/" -s -e "w pic%02B.jpg" -o /dev/null manual.pdf Extract jpg-images from pdf-file to separate jpg-files (assuming that the jpg start/stop sequences does not appear in other context than jpg-images). -Files will be named as @file{pic01.jpg}, @file{pic02.jpg}, @file{pic03.jpg},@dots{} +Files will be named as @file{pic01.jpg}, @file{pic02.jpg}, @file{pic03.jpg},@dots{} @* + +@item bbe -b "_<body>_:_</body>_" -s -o temp nicebody.html +@itemx bbe -b "_<body>_:_</body>_" -e "D;< temp" -o tmpindex.html index.html +@itemx mv tmpindex.html index.html +The body part of the html-document @file{index.html} is replaced by the body of the document @file{nicebody.html}. @end table |

