Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@connectedyard/node-intelhex
Advanced tools
Building and converting between intel-hex and binary data
Conversion between binary and intel-hex files, and programmatic construction of intel-hex files.
var intelhex = require('@connectedyard/node-intelhex');
intelhex.binaryFileToIntelHexFile( "binaryFile.bin", "intelHex.hex" );
intelhex.intelHexFileToBinaryFile( "intelHex.hex", "binaryFile.bin" );
Convert a file using binaryFileToIntelHexFile( binaryFileName, intelHexFileName, startAtAddress )
Convert a buffer in memory using binaryToIntelHex( buffer, startAtAddress )
Use startAtAddress
to specify the starting memory location of the first byte in the binary file. For example, the binary data
may need to be loaded at 0x18000, so use binaryToInelHex( buffer, 0x18000 )
Convert a file using intelHexFileToBinaryFile( intelHexFileName, binaryFileName, options )
Convert a text string to a buffer in memory using intelHexToBinary( intelHexString, options )
Use options
to specify any of the following:
{
startAtOffsetZero: boolean, // default=false, binary file begins at address zero, even when first data address in intelFile is > 0
maxBinaryAddress: integer, // default=0x20000000, maximum binary address, determines size of buffer required in RAM
verbose: boolean, // default=false, logs processing to console
}
Build an intel-hex programmatically using var processor = new intelhex.BufferToIntelHexProcessor( startAddress )
and the following functions:
processor.setAddress( address ); // location for the next block data
processor.appendBuffer( buffer, littleEndian); // append data from buffer, default is littleEndian=false
processor.appendWords( words, littleEndian ); // append data from array of words, default is littleEndian=false
processor.appendHexString( hexString ); // append bytes from hex string
processor.writeHexStringAtAddress(address, hexString); // set the current address and append bytes from the hex string
processor.close(); // finish and append file terminator
var intelHexFileData = processor.contents; // retrieve finished data string
From https://en.wikipedia.org/wiki/Intel_HEX
Only I16HEX formatting is supported, which supports 32 bit addressing through the Extended Segment Address.
The Intel Hex Line Format is :llaaaatt[dd...]cc
Where
Record Types are
This module only uses extended segment addresses (02)
The default hex line terminator is \n
, which can be changed by setting processor.lineTerminator
.
FAQs
Building and converting between intel-hex and binary data
The npm package @connectedyard/node-intelhex receives a total of 1 weekly downloads. As such, @connectedyard/node-intelhex popularity was classified as not popular.
We found that @connectedyard/node-intelhex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.