UNPKG

unreal.js

Version:

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

112 lines (111 loc) 2.89 kB
/// <reference types="node" /> /// <reference types="ref-napi" /> import { FPakInfo } from "./objects/FPakInfo"; import { GameFile } from "./GameFile"; import { FArchive } from "../reader/FArchive"; import { VersionContainer } from "../versions/VersionContainer"; import { AbstractAesVfsReader } from "../vfs/AbstractAesVfsReader"; /** * UE4 Pak File Reader */ export declare class PakFileReader extends AbstractAesVfsReader { get hasDirectoryIndex(): boolean; get encryptionKeyGuid(): import("../..").FGuid; /** * UE4 Reader * @type {FArchive} * @public */ Ar: FArchive; /** * Info about pak * @type {FPakInfo} * @public */ pakInfo: FPakInfo; /** * Aes key for pak * @type {?Buffer} * @public */ aesKey: Buffer; /** * Creates an instance * @param {string} path Path to file * @param {?VersionContainer} versions Versions * @param {?Buffer} source Source buffer if it's not an existing file * @constructor * @public */ constructor(path: string, versions?: VersionContainer, source?: Buffer); /** * Whether if it is encrypted or not * @returns {boolean} * @public */ get isEncrypted(): boolean; /** * Extracts a file * @param {GameFile} gameFile File to extract * @returns {Buffer} * @public */ extract(gameFile: GameFile): Buffer; /** * Reads index of pak * @returns {Array<GameFile>} Files * @public */ readIndex(): GameFile[]; /** * Reads index of old pak * @returns {Array<GameFile>} Files * @public */ private readIndexLegacy; /** * Reads index of new pak * @returns {Array<GameFile>} Files * @public */ private readIndexUpdated; /** * Reads bit entry * @param {FByteArchive} Ar Reader to use * @returns {FPakEntry} Entry * @private */ private readBitEntry; /** * Replaces a file extension * @param {string} k Source * @param {string} v Replacement * @returns {string} * @private * @static */ private static extension; /** * Reads and decrypts data * - DEPRECATED: Inline this method * @param {number} num Amount of bytes to read * @param {boolean} isEncrypted Whether if those are encrypted * @returns {Buffer} Bytes * @private * @deprecated */ private readAndDecrypt; /** * Fixes a mount point * @param {string} mountPoint Current mount point * @returns {string} * @private */ private static fixMountPoint; /** * Checks index bytes * @returns {Buffer} Index bytes * @public */ indexCheckBytes(): Buffer; }