Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.