diff --git a/js/injected_methods.js b/js/injected_methods.js index 9521f744..39c7a58b 100644 --- a/js/injected_methods.js +++ b/js/injected_methods.js @@ -101,4 +101,15 @@ DataView.prototype.readString = function() { s += String.fromCharCode(c); } return s; -}; \ No newline at end of file +}; + +DataView.prototype.asHex = function() { + let s = ""; + for (let ii = 0; ii < this.byteLength; ii++) { + if (ii == this.offset) { + s += "/" + } + s += this.getUint8(ii).toString(16); + } + return s; +};