New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rpxlib

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rpxlib

A general purpose RPL/RPX library.

  • 0.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

RPXLib

A general purpose RPL/RPX library.

GitHub version downloads GitHub code size in bytes

npm release node-current license

  • Single dependency
  • Reading and writing support
  • Balanced between speed and data integrity

Usage

import * as rpxlib from 'rpxlib';
import fs from 'fs';

const rpxFileData = fs.readFileSync('./path/to/file.rpx');
const rpx = new rpxlib.RPL(rpxFileData);

// Modify rpx as desired

// Do not include the extension!
rpx.save('./path/to/save/file', true);
// Modified RPX will be at ./path/to/save/file.rpx

Notes

  • The library automatically handles and calculates section offsets, sizes, indexes, among other values and as such doesn't allow manually setting those.
  • In contrast, section virtual addresses are NOT handled or checked, the user must ensure those are valid manually.
    • However RPL.addressRanges is provided to assist with finding the right values to use.
  • Relocation sections are not parsed by default as they can be very large and slow to parse, it is recommended to read relocations manually from the raw data as you need them.
    • If you really want relocations parsed, you can pass an options object with parseRelocs: true to the RPL constructor.
      • You will be blocked from writing to the raw data of relocation sections if the relocations are parsed.
  • Most special section types do not allow writing directly to their raw data to prevent desync from the parsed data and the raw data.
    • The parsed data of special sections will be serialized and overwrite the raw data upon each request to read the raw data.
      • For this reason it's highly recommended to not repeatedly call Section.data without need as you will be repeatedly regenerating the data for special sections.
      • It's also highly recommended to use Section.size over Section.data.byteLength, as the former does not require the generation of the entire raw section data for special sections.
  • Program headers (segments) are parsed as read-only without data references and cannot be saved back.

Keywords

FAQs

Package last updated on 31 Aug 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc