unneko

package module
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 9 Imported by: 0

README

unneko

An extractor for Revived Witch nekodata by Lico#6969

Usage as command line binary

Download unneko binary from release page and run in terminal

single nekodata file
$ ./unneko -o ./output inputfile.nekodata

or directory containing nekodata files
$ ./unneko -o ./output ./input/

In case the inputfile is a patch nekodata the file extension must be .patch.nekodata

Usage with windows GUI

For those on Windows and unfamiliar with basic command line usage, you can download unneko-win-x64.exe on the release page https://github.com/lico-n/unneko/releases. Then simply drag and drop nekodata file or a directory containing nekodata files on the unneko-win-x64.exe, the extracted files will appear in output directory.

It is possible that windows/smart defender will pop up a warning. This is a common false positive because the windows binary is unsigned. In this case press more information and run anyways.

Usage as library

import "github.com/lico-n/unneko"

func main() {
  // initialize with nekodata filepath, if it's patch nekodata must contain `.patch.nekodata` file extension
  r, err := unneko.NewReaderFromFile(inputFilePath)
  handleError(err)

  // alternatively initialize with in memory nekodata, must provide flag whether this is a patch file
  var inMemoryNekoData []byte
  isPatchFile := true 

  r, err = unneko.NewReader(inMemoryNekoData, isPatchFile)
  handleError(err)

  // iterate over all extracted files
  for r.HasNext() {
    file, err := r.Next()
    handleError(err)

    file.Path() // original file path of the extracted file 
    file.Data() // extracted data as byte array 
  }

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtractedFile

type ExtractedFile struct {
	// contains filtered or unexported fields
}

func (*ExtractedFile) Data

func (f *ExtractedFile) Data() []byte

func (*ExtractedFile) Path

func (f *ExtractedFile) Path() string

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(data []byte, isPatchFile bool) (*Reader, error)

func NewReaderFromFile

func NewReaderFromFile(file string) (*Reader, error)

func (*Reader) HasNext

func (r *Reader) HasNext() bool

func (*Reader) Next

func (r *Reader) Next() (*ExtractedFile, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL