🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

grf-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grf-loader

A loader for GRF files (Ragnarok Online game file)

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

GRF Loader

GRF is an archive file format that support lossless data compression used on Ragnarok Online to store game assets. A GRF file may contain one or more files or directories that may have been compressed (deflate) and encrypted (variant of DES).

roBrowser project license: MIT node browser lint

About

  • Only supports GRF version 0x200.
  • It's working both on node and browser environments
  • Supports DES description.
  • Avoid bloating client/server memory (by not loading the whole file into the RAM)
  • Does not supports custom encryption

Installation

npm install grf-loader

Basic usage

  • Load a grf file on node.js
  • Load a grf from the browser
  • List all files content
  • Extract a file from the GRF

Load a grf file on node.js

import {GrfNode} from 'grf-loader';
import {openSync} from 'path';

const fd = openSync('path/to/data.grf', 'r');
const grf = new GrfNode(fd);

// Start parsing the grf.
await grf.load();

Load a grf from the browser

import {GrfBrowser} from 'grf-loader';

const blob = document.querySelector('input[type="file"]').files[0];
const grf = new GrfBrowser(blob);

// Start parsing the grf
await grf.load();

List all files content

Once the GRF is loaded, it's possible to list all files included inside it

grf.files.forEach((entry, path) => {
  console.log(path);
});

Extract a file from the GRF

Once the GRF is loaded, it's possible to extract all files you need

const {data, error} = await grf.getFile('data\\clientinfo.xml');

// data is a Uint8Array data, so we transform it into text
const content = String.fromCharCode.apply(null, data);
console.log(content);

Keywords

grf-loader

FAQs

Package last updated on 10 Jun 2020

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