PHPackages                             thies4321/knytt-stories-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thies4321/knytt-stories-tools

ActiveStandard[Utility &amp; Helpers](/categories/utility)

thies4321/knytt-stories-tools
=============================

Knytt Stories tools written in PHP

1.0.0(1y ago)14MITPHPPHP ^8.2

Since Sep 11Pushed 1y ago2 watchersCompare

[ Source](https://github.com/thies4321/knytt-stories-tools)[ Packagist](https://packagist.org/packages/thies4321/knytt-stories-tools)[ Docs](https://github.com/thies4321/knytt-stories-tools)[ RSS](/packages/thies4321-knytt-stories-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

knytt-stories-tools
===================

[](#knytt-stories-tools)

Knytt Stories tools written in PHP. Currently only has a .knytt.bin parser. This is based on the works of Looki.

Basic usage
-----------

[](#basic-usage)

```
$bin = new \KnyttStoriesTools\KnyttBin('/path/to/file.knytt.bin');
$bin->getRootDir() // (string) Nifflas - Tutorial
$bin->getSize() // (int) 45452
```

Get filenames from bin file
---------------------------

[](#get-filenames-from-bin-file)

```
$bin = new \KnyttStoriesTools\KnyttBin('/path/to/file.knytt.bin');
$bin->getFileNames();
```

output example:

```
[
    "DefaultSavegame.ini",
    "Icon.png",
    "Info.png",
    "Map.bin",
    "World.ini",
]
```

Get data for single file from bin file
--------------------------------------

[](#get-data-for-single-file-from-bin-file)

```
$bin = new \KnyttStoriesTools\KnyttBin('/path/to/file.knytt.bin');
$bin->getFile('Icon.png');
```

output example:

```
[
    "size" => 662,
    "data" => b"ëPNG\r\n\x1A\n\0\0\0\rIHDR\0\0\0\x1E\0\0\0\x1E\x08\x06\0\0\0;0«ó\0\0\0\tpHYs\0\0\v\x13\0\0\v\x13\x01\0Ü£\x18\0\0\0\x04gAMA\0\0▒Ä|¹Qô\0\0\0 cHRM\0\0z%\0\0Çâ\0\0¨ \0\0ÇÚ\0\0u0\0\0Û`\0\0:ÿ\0\0\x17oÆ_┼F\0\0\x02\fIDATx┌b³  ?\x03.└╚╚(╔@$\0Ü¾£ü\x04\0\x10@,x,ò\x05R┬@\Fä9]@§,@╦\x1F\x13k1@\01Ô‗1ð / Á\x15─¥x±"N\x03¶§§aLoáY█êÁ\x18 ÇÿpX¬CäE$ÚC\x07\0\x01─äC\\x0Eõ█ªª&¼ûó[\x0EUÀ\x15¬Å(\0\x10@L°$ıııQ,à\x059êFÂ▄┴┴üüT\0\x10@L─*DÅg|±N\f\0\x08 &å\x01\x02\0\x01D▓┼ö·\x14\x06\0\x02êà\x18E°R2╣\0 Çê▓©¼\fw\x19ÊııEû┼\0\x01äÁ\0A.
