Sprayxe / unreal.js

A pak reader for games like VALORANT & Fortnite written in pure JavaScript
https://unreal.js.org
MIT License
59 stars 7 forks source link
fortnite javascript nodejs pakreader paks reader typescript ue4 valorant

UPDATE: I (Sprayxe) am no longer maintaining this project. I simply lost motivation to work on it due to several reasons. If you want to keep maintaining the project send me a DM via discord! Thanks to all the people who helped me in this project and thanks to all the people who used or are still using this library. Cya!

LICENCE TYPESCRIPT JAVASCRIPT NODEJS DISCORD0\ NPM

LOGO_0

unreal.js

A pak reader for games like VALORANT & Fortnite written in Node.JS

Notice

This library is in VERY early development so it might be unstable. Please also keep in mind that JavaScript is not really made for this kind of stuff so the usage of this library is experimental. We still try fixing most issues though so report if you experience any!\

Features

Prerequisites

Installation

npm i unreal.js\ This library has optional dependencies like canvas and dxt-js which are used in ue4 texture conversion. If you don't want to install these dependencies, use: npm i unreal.js --no-optional.

Documentation

Here

Usage

Basics: FileProvider

The file provider is basically the heart of the library and from there you control basically all features.

IMPORTANT: When using the library with Fortnite V14.40 and above, you need oo9core_8_win64.dll present in your working directory (you can download it using Oodle.downloadDLL()). You will also need a .usmap mappings file corresponding to your fortnite version.\ You will also experience longer mounting times than e.g VALORANT.

Basics: Loading an asset

Basics: Exporting sounds

Basics: Exporting textures

  // this will find an export which matches the class 'UTexture2D'
  const tex = pkg.getExportOfType(UTexture2D)
  // use 'pkg.getExportOfTypeOrNull(UTexture2D)' if you check for undefined/null manually
  const image = Image.convert(tex) // converts texture to image (import Image class from unreal.js)
  // writes it it a file
  writeFileSync("image.png", image)

Basics: Loading locres

Advanced: Loading a pak file manually

const reader = new PakFileReader("PATH", GAME) // Create a new instance
reader.aesKey = "KEY" // Set an aes key (can be left out if pak is not encrypted)
reader.readIndex() // Read the index
reader.extract(reader.files.first()) // Gets the first file and extracts it as Buffer

Replace:

Advanced: Loading a package manually

// load a pak package (e.g valorant)
const pkg = new PakPackage(UASSETBUFFER, UEXPBUFFER, UBULKBUFFER, NAME, PROVIDER, GAME)
// load an io package (mostly used in fortnite)
const pkg2 = new IoPackage(UASSETBUFFER, PACKAGEID, STOREENTRY, GLOBALPACKAGESTORE, PROVIDER, GAME)

Replace:

Support, Feedback, Contact

Inspiration

LOGO_1