
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
binary-file-modifier
Advanced tools
二进制固件文件修改工具(TypeScript 版本)。支持指定地址、位宽(8/16/32/64)、大小端(be/le)进行写入,同时提供事件回调与配置锁定。
# 项目内安装(库/CLI)
npm install binary-file-modifier
# 或
cnpm install binary-file-modifier
# 全局安装(使用 CLI)
npm install -g binary-file-modifier
# 或
cnpm install -g binary-file-modifier
# 开发依赖安装(测试、示例运行)
cnpm install -D vitest ts-node
cnpm run build
基础写入示例(src/examples/basic-usage.ts):
import { BinModifier } from '../binModifier';
const bm = new BinModifier(undefined, {
filePath: '/path/to/firmware.bin',
address: 0,
bitLength: 8,
endian: 'be',
showBytes: true,
logger: console,
});
const fileObj = bm.writeInt(0xff);
await bm.writeToDisk(fileObj);
高级功能示例(事件监听与配置锁定,src/examples/advanced-features.ts):
bm.on('before:write', (ctx) => console.log('before', ctx));
bm.on('after:write', (ctx) => console.log('after', ctx));
bm.lock();
构建后可使用 CLI:
# 显示帮助
node dist/cli.js --help
# 或通过 bin 包装
node bin/firmware-modifier --help
# 或使用发布后的可执行别名
binary-file-modifier --help
# 写入示例:将 0x12345678 写入 0x10 位置,32 位小端
node dist/cli.js --file ./sample.bin --address 0x10 --bits 32 --endian le --value 305419896 --show
参数说明:
--file 固件文件路径--address 写入地址(支持十六进制如 0x7C00 或十进制)--bits 位宽:8/16/32/64--endian 大小端:be 或 le--value 写入整数值(范围受位宽限制)--show 是否打印写入前后字节# 运行示例
cnpm run example:basic
cnpm run example:advanced
# 运行测试
cnpm run test
src/examples 目录FAQs
二进制固件文件修改工具 - JavaScript版本
We found that binary-file-modifier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.