Skip to content

bengarrett/binbump

Repository files navigation

BINbump

Go Reference Go Report Card

BINbump converts binary screen dumps of the IBM PC graphic and BIOS text mode characters, and CGA, EGA, and VGA colors into a HTML fragment for use in a template or webpage.

See the reference documentation for usage, and examples, including changing the character sets and the color palette.

BINbump was created for and is in use on the website archive Defacto2, home to thousands of ANSI and binary texts and artworks that are now rendered in HTML.

Quick usage

package main

import (
	"log"
	"os"

	"github.com/bengarrett/binbump"
)

func main() {
	file, _ := os.Open("file.bin")
	defer file.Close()
	_, _ = binbump.WriteTo(file, os.Stdout)
}

HTML

BINbump will output a <div> "content division" element containing colors, styles, newlines, and text.

<html>
  <head>
    <title>Quick usage</title>
  </head>
  <style>
    @font-face {
      font-family: cascadia-mono;
      src: url(CascadiaMono.woff2) format("woff2");
    }
    pre {
      font-family: cascadia-mono, monospace, serif;
    }
  </style>
  <body>
    <pre><!--- binbump output ---><div><span style="color:#aaa;background-color:#000;">   </span><span style="color:#a50;background-color:#0a0;">HI‼︎</span><span style="color:#aaa;background-color:#000;">   </span></div>
    </pre>
  </body>
</html>

Not supported or known issues

  • XBIN

Sauce metadata

BINbump doesn't parse any SAUCE metadata, however this can be done with a separate bengarrett/sauce package.

Similar projects

About

Take binary encoded texts (.BIN) and transform them into HTML fragments

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages