Skip to content

Conversation

@dogdie233
Copy link

No description provided.

@dogdie233
Copy link
Author

Make a new archive type for NekoNyan/Sprite steam games
image
image

Since it is impossible(i think) to confirm whether this DAT file belongs to this game, it is necessary to ask the user each time they open the DAT file if it is a game made by NekoNyan/Sprite

@kyororay
Copy link

dogdie233さん、ありがとうございます。
下記ゲームタイトルでアンパックできることを確認しました。
[250328][sprite] 恋と選挙とチョコレート Steam版

ただ、アーカイブを開く際にゲームブランドの確認処理が行われていないため、
他のゲームブランド(Cyberworks等)のdatアーカイブを開く際にもNekoNyan/Spriteのスキームダイアログが表示されてしまいます。

Since it is impossible(i think) to confirm whether this DAT file belongs to this game

⇒ graphics.datと同じディレクトリに存在する「app.info」の中身を確認すれば、
  ゲームブランドがNekoNyanであるかどうかを確認できると思います。
  app.infoはUTF8エンコードの文字列で記載されているので、
  StreamReaderで読み込んだ後に判定処理を行うのが良いと思います。

添付のSpriteArcDAT.csの38行目にゲームブランドの確認処理を追記していますので、
参考にしていただけると幸いです。

添付ファイル:SpriteArcDAT.cs
SpriteArcDAT.zip

@dogdie233
Copy link
Author

dogdie233さん、ありがとうございます。 下記ゲームタイトルでアンパックできることを確認しました。 [250328][sprite] 恋と選挙とチョコレート Steam版

ただ、アーカイブを開く際にゲームブランドの確認処理が行われていないため、 他のゲームブランド(Cyberworks等)のdatアーカイブを開く際にもNekoNyan/Spriteのスキームダイアログが表示されてしまいます。

Since it is impossible(i think) to confirm whether this DAT file belongs to this game

⇒ graphics.datと同じディレクトリに存在する「app.info」の中身を確認すれば、   ゲームブランドがNekoNyanであるかどうかを確認できると思います。   app.infoはUTF8エンコードの文字列で記載されているので、   StreamReaderで読み込んだ後に判定処理を行うのが良いと思います。

添付のSpriteArcDAT.csの38行目にゲームブランドの確認処理を追記していますので、 参考にしていただけると幸いです。

添付ファイル:SpriteArcDAT.cs SpriteArcDAT.zip

わー、app.infoを読み込むのは本当にいいアイデアですね。フォルダ名を読み込むことしか考えていなかったので、このアイデアをありがとうございます。後ほどこの検出機能を追加します。重ねて感謝いたします。
(translated by gemini)

@kyororay
Copy link

dogdie233さん

app.infoの読み込みによる検出機能が追加されていることをソースコード、及び実動作から確認しました。
app.infoからゲームブランドだけでなくゲームタイトルも読み込むことで、
スキームダイアログの表示を無くすことができていますね。

とても素晴らしい修正内容だと思います。
ご対応いただき、ありがとうございました。

@crskycode
Copy link
Owner

crskycode commented Sep 27, 2025

  • Maintain the code style consistent with GARbro's style as much as possible.
  • Move the parameters to database file.

@dogdie233
Copy link
Author

this feature is low priority, so i want to wait another PR merge to avoid conflict

Format.json should append follow to SchemeMap:

    "DAT/NEKONYAN/SPRITE": {
      "KnownGame": {
        "NekoNyanSoft/Aokana": {
          "fileCountBeginByte": 16,
          "genKeyInitMul": 7391,
          "genKeyInitAdd": 42828,
          "genKeyInitShift": 17,
          "genKeyRoundAdd": 56,
          "genKeyRoundAnd": 239,
          "genKeyRoundShift": 1,
          "decryMod1": 253,
          "decryAdd": 3,
          "decryMod2": 89,
          "decryXor": 153
        },
        "NekoNyanSoft/AokanaEXTRA1": {
          "fileCountBeginByte": 16,
          "genKeyInitMul": 7391,
          "genKeyInitAdd": 42828,
          "genKeyInitShift": 17,
          "genKeyRoundAdd": 56,
          "genKeyRoundAnd": 239,
          "genKeyRoundShift": 1,
          "decryMod1": 253,
          "decryAdd": 3,
          "decryMod2": 89,
          "decryXor": 153
        },
        "NekoNyanSoft/AokanaEXTRA2": {
          "fileCountBeginByte": 12,
          "genKeyInitMul": 4892,
          "genKeyInitAdd": 42816,
          "genKeyInitShift": 7,
          "genKeyRoundAdd": 156,
          "genKeyRoundAnd": 206,
          "genKeyRoundShift": 3,
          "decryMod1": 179,
          "decryAdd": 3,
          "decryMod2": 89,
          "decryXor": 119
        },
        "NekoNyanSoft/KoiChoco": {
          "fileCountBeginByte": 12,
          "genKeyInitMul": 5892,
          "genKeyInitAdd": 41280,
          "genKeyInitShift": 7,
          "genKeyRoundAdd": 341,
          "genKeyRoundAnd": 220,
          "genKeyRoundShift": 2,
          "decryMod1": 235,
          "decryAdd": 31,
          "decryMod2": 87,
          "decryXor": 165
        }
      }
    },

@dogdie233
Copy link
Author

Formats.dat have been uploaded

if (toc_size > view.MaxOffset - header_size)
return null; // file too small

using (var toc_buffer = ArrayPool<byte>.Shared.RentSafe(toc_size))
Copy link
Author

@dogdie233 dogdie233 Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should i remove ArrayPoolGuard and use new byte[] instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants