Skip to content

stevemuller04/binutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

binutils

A collection of utilities for performing bitwise operations on files.

Build

Compile all binaries using:

go build -o build ./...

This will place the compiled executables in the build directory.

Documentation

binop

binop applies a bitwise operation across multiple input byte streams.

For each byte position, the selected bitwise operator is applied to the corresponding byte from every input stream. The first output byte is computed from the first byte of each input, the second output byte from the second byte of each input, and so on.

If an input file is shorter than the others, it is wrapped and read again from the beginning. The output stops once all file inputs have been fully consumed. Note that as a special case, standard input (-) cannot be wrapped.

Inputs are provided as command-line arguments and can be:

Format Meaning
filename Read bytes from a file
./filename Explicit file path (useful if the name conflicts with a special format)
- Standard input
0x<hex> Static byte string encoded as hexadecimal

binop is implemented as a single binary. The operation it performs depends on the name used to invoke the executable.

Create symbolic links for the desired operators:

ln -s binop <operator>

Supported operators:

Command Operation
and Bitwise AND
nand Bitwise NAND (NOT AND)
or Bitwise OR
xor Bitwise XOR (exclusive OR)

Example usage:

./xor file1.bin file2.bin 0xFF > result.bin

This command:

  1. Reads bytes from file1.bin
  2. Reads bytes from file2.bin
  3. Uses the static byte 0xFF
  4. Applies bitwise XOR to each byte position

The result is written to result.bin.

About

A collection of utilities for performing bitwise operations on files.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages