Skip to content

Commit

Permalink
Merge branch 'elf-info' of https://github.com/n1073645/CyberChef
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Jun 9, 2022
2 parents 8c71b0b + 049690f commit 23b1685
Show file tree
Hide file tree
Showing 6 changed files with 1,381 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/config/Categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@
"Extract RGBA",
"View Bit Plane",
"Randomize Colour Palette",
"Extract LSB"
"Extract LSB",
"ELF Info"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions src/core/lib/Stream.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ export default class Stream {
* Interpret the following bytes as a string, stopping at the next null byte or
* the supplied limit.
*
* @param {number} numBytes
* @param {number} [numBytes=-1]
* @returns {string}
*/
readString(numBytes) {
readString(numBytes=-1) {
if (this.position > this.length) return undefined;

if (numBytes === -1) numBytes = this.length - this.position;

let result = "";
for (let i = this.position; i < this.position + numBytes; i++) {
const currentByte = this.bytes[i];
Expand Down
Loading

0 comments on commit 23b1685

Please sign in to comment.