Hashcat Restore file: JavaScript parsing library

File extension


KS implementation details

License: CC0-1.0

This page hosts a formal specification of Hashcat Restore file using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.


Runtime library

All parsing code for JavaScript generated by Kaitai Struct depends on the JavaScript runtime library. You have to install it before you can parse data.

The JavaScript runtime library is available at npm:

npm install kaitai-struct


See the usage examples in the JavaScript notes.

Parse structure from an ArrayBuffer:

var arrayBuffer = ...;
var data = new HashcatRestore(new KaitaiStream(arrayBuffer));

After that, one can get various attributes from the structure by accessing fields or properties like:

data.version // => get version

JavaScript source code to parse Hashcat Restore file


// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

(function (root, factory) {
  if (typeof define === 'function' && define.amd) {
    define(['kaitai-struct/KaitaiStream'], factory);
  } else if (typeof module === 'object' && module.exports) {
    module.exports = factory(require('kaitai-struct/KaitaiStream'));
  } else {
    root.HashcatRestore = factory(root.KaitaiStream);
}(typeof self !== 'undefined' ? self : this, function (KaitaiStream) {
 * @see {@link https://hashcat.net/wiki/doku.php?id=restore|Source}

var HashcatRestore = (function() {
  function HashcatRestore(_io, _parent, _root) {
    this._io = _io;
    this._parent = _parent;
    this._root = _root || this;

  HashcatRestore.prototype._read = function() {
    this.version = this._io.readU4le();
    this.cwd = KaitaiStream.bytesToStr(KaitaiStream.bytesTerminate(this._io.readBytes(256), 0, false), "UTF-8");
    this.dictsPos = this._io.readU4le();
    this.masksPos = this._io.readU4le();
    this.padding = this._io.readBytes(4);
    this.currentRestorePoint = this._io.readU8le();
    this.argc = this._io.readU4le();
    this.padding2 = this._io.readBytes(12);
    this.argv = [];
    for (var i = 0; i < this.argc; i++) {
      this.argv.push(KaitaiStream.bytesToStr(this._io.readBytesTerm(10, false, true, true), "UTF-8"));

  return HashcatRestore;
return HashcatRestore;