Shitty Nim code that reads in a file and converts it into \x hex representation, for the use of shellcode binaries.
Go to file
John Hammond f0ca9ef01c Added support for nim shellcode format 2023-06-28 01:37:05 -04:00
src Added support for nim shellcode format 2023-06-28 01:37:05 -04:00
.gitignore Added support for nim shellcode format 2023-06-28 01:37:05 -04:00
README.md Fixing compile and installation instructions 2023-06-28 00:06:16 -04:00
binnim.nimble Added nimble dependency handler 2023-06-28 00:05:08 -04:00

README.md

binnim

John Hammond | Tuesday, June 27th, 2023


binnim is a small command-line utility written in Nim to display files in \x hex representation.

The intent is to use this on shellcode binary files to rapidly get strings to use for exploit development.

Perhaps one day this will include more representations of data, but for now, this suits my needs.

This is probably bad code, but it was an excuse to write some Nim.

Compile

nimble build

Install

nimble install

Usage

./binnim --help

Usage:
  binnim [optional-params] [filenames: string...]
Options:
  -h, --help                 print this cligen-erated help
  --help-syntax              advanced: prepend,plurals,..
  -w=, --width=  int   20    set width
  -q, --quotes   bool  true  set quotes

Example Output

./binnim ~/shellcode.bin
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x04\xa0"
"\x00\x00\x04\xa0\x01\x03\x00\x00\x00\xf5\x97\xa2\xff\x00\x00\x00\x06\x50\x4c\x54"
"\x45\x00\x00\x00\xff\xff\xff\xa5\xd9\x9f\xdd\x00\x00\x00\x02\x74\x52\x4e\x53\xff"
"\xff\xc8\xb5\xdf\xc7\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x12\x00\x00\x0b"
"\x12\x01\xd2\xdd\x7e\xfc\x00\x00\x04\x49\x49\x44\x41\x54\x78\x9c\xed\xd0\x41\x72"
"\xe4\x38\x0c\x00\xc1\xfe\xff\xa7\x67\xaf\x0e\x0e\x40\x55\xcf\x65\x1d\xa1\xac\x8b"
"\x6d\x89\x04\x52\xfe\xfc\xf9\x85\x7d\xfe\x6f\xc0\x14\x54\x0d\xaa\x06\x55\x83\xaa"
"\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50"
"\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d"
"\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa"
"\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50"
"\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d"
"\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\xb5\xbf\x50\x9f\x4b\xd3\xd9\xf3\xf7\xed"
"\xde\x57\x73\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"
"\x5e\x8d\x3a\x9f\x9d\x4b\xa7\x73\x13\xe2\x76\xfe\xb6\x0f\x0a\x0a\x0a\x0a\x0a\x0a"
"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x6a\x5b\xb2\x2d\xfa\x06\xb9\xcd\x85"
"\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x7a\xba\x7c"
"\x42\xb6\x6e\x1f\x02\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05"
"\x05\x05\xf5\xaf\xa8\x13\x34\x3d\xbb\x01\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"
"\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\x0a\xaa\x62\x9f\xde\xd5\xb9\x50\x50\x50\x50\x50"
"\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\xe7\xe0\xb3\x13\xf0\xed\xcf"
"\xdb\x5c\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\xa8"
"\xda\x84\xfc\xf9\xee\x3c\xf3\xf5\x7c\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28"
"\x28\x28\x28\x28\x28\xa8\xd7\xa2\x3e\x43\xe7\xf3\x1b\x6e\x7b\x76\xfb\x09\x05\x05"
"\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x35\xa1\xb6\x8b\x1b"
"\x78\xfb\xb0\xed\xa3\xd6\xf9\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50"
"\x50\x50\x50\x50\xaf\x47\xdd\x9e\x3f\x01\x7e\x9e\x29\x08\x28\x28\x28\x28\x28\x28"
"\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\xa8\x09\xb1\xfd\x3e\xc1\x27\xd4\xd3"
"\xb3\x0d\x08\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\xf5"
"\x5e\xd4\x74\xe9\x33\xb4\xdd\xbb\x2d\x3d\xe7\xad\xff\x10\x28\x28\x28\x28\x28\x28"
"\x28\x28\x28\x28\x28\x28\x28\x28\x28\x28\xa8\x57\xa3\xa6\x21\xe3\xe5\xdb\xe0\x03"
"\xb7\x7d\xd0\xf8\x81\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50"
"\x50\x50\xaf\x45\x9d\x03\xcf\xa1\x4f\xf8\xf3\x43\x2a\x0e\x0a\x0a\x0a\x0a\x0a\x0a"
"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x6a\x02\x4d\x0b\x9e\x96\x4f\xf3\x9e"
"\x3e\x0c\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x6a"
"\x1a\xbe\x0d\xdd\xa0\xd3\x99\xed\xe3\x26\x10\x14\x14\x14\x14\x14\x14\x14\x14\x14"
"\x14\x14\x14\x14\x14\x14\x14\x14\xd4\x89\xda\xce\xdc\x96\xdf\x3a\x81\x50\x50\x50"
"\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x1b\x62\x1a\xf6\x74"
"\x66\x9b\xf7\xf4\xb1\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50"
"\x50\x50\x50\xe7\xf2\x6d\xd9\x74\x6f\xc3\x6e\x90\x6d\x2e\x14\x14\x14\x14\x14\x14"
"\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\xd4\x06\x9c\x96\x4e\xdd\xde\xdf\x66"
"\x42\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\xbd\x1b\xf5"
"\xd4\x86\x9e\xb0\xb7\x77\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50"
"\x50\x50\x50\x50\x13\x6a\xba\x74\x2e\x39\x61\xdb\x82\x09\x77\xc3\x40\x41\x41\x41"
"\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x6d\x87\xb7\x85\x13\x70"
"\xfb\xfb\x36\x1f\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a"
"\x0a\xea\xe7\xa5\x73\xe9\xf6\xfc\x76\xf6\x7c\xb7\x9d\x81\x82\x82\x82\x82\x82\x82"
"\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\xfa\x16\xb5\x0d\x9e\x10\xe7\xb9\xc7"
"\x19\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x50\x01"
"\x35\x41\xa6\x45\x1b\x74\x02\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
"\x41\x41\x41\x41\x41\x8d\x07\x2f\x0b\xcb\xdf\x13\x06\x0a\x0a\x0a\x0a\x0a\x0a\x0a"
"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x6a\x5a\xbe\x75\x5b\xf2\x73\xc1\x76\xf6"
"\xdc\x31\x81\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"
"\xde\x8d\xfa\x0d\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41"
"\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35"
"\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa"
"\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41"
"\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35"
"\xa8\x1a\x54\x0d\xaa\x06\x55\x83\xaa\x41\xd5\xa0\x6a\x50\x35\xa8\x1a\x54\x0d\xaa"
"\x06\x55\xfb\x95\xa8\xff\x00\xfc\xc3\x4c\xf5\x46\x8d\xbe\x64\x00\x00\x00\x00\x49"
"\x45\x4e\x44\xae\x42\x60\x82"