Skip to content

add new signatures #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2025
Merged

add new signatures #281

merged 2 commits into from
May 10, 2025

Conversation

BJNFNE
Copy link
Collaborator

@BJNFNE BJNFNE commented May 10, 2025

Summary by CodeRabbit

  • New Features
    • Added support for detecting the HSM binary format based on its unique signature.
    • Added support for detecting the MB2 binary format using its specific signature.
    • Added support for detecting the HNM binary format through signature identification.
    • Added support for detecting the MDL binary format using its signature.
    • Added support for detecting the VVD binary format using its signature.
    • Added support for detecting the IVF binary format by its signature.
    • Added support for detecting the VTF binary format by its signature.
  • Bug Fixes
    • Improved detection logic for the STK archive format by refining flag handling.

Copy link

coderabbitai bot commented May 10, 2025

Warning

Rate limit exceeded

@BJNFNE has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1084f53 and 98eb5b4.

📒 Files selected for processing (9)
  • db/Binary/archive.LAB.sg (1 hunks)
  • db/Binary/archive.STK.sg (0 hunks)
  • db/Binary/bin.HNM.1.sg (1 hunks)
  • db/Binary/bin.HSM.1.sg (1 hunks)
  • db/Binary/bin.IVF.1.sg (1 hunks)
  • db/Binary/bin.MB2.1.sg (1 hunks)
  • db/Binary/bin.MDL.1.sg (1 hunks)
  • db/Binary/bin.VTF.1.sg (1 hunks)
  • db/Binary/bin.VVD.1.sg (1 hunks)

Walkthrough

Eight new detection rule files have been added for the binary formats "HSM," "MB2," "HNM," "MDL," "VVD," "IVF," and "VTF." Each file defines a detect() function that checks for a specific signature string within the binary data to identify the corresponding format. Additionally, a modification was made to the archive.STK detection logic by removing an explicit else branch resetting the detection flag.

Changes

File(s) Change Summary
db/Binary/bin.HSM.1.sg Added detection rule for "HSM" format; checks for "'1LMB'" signature at the start of the binary.
db/Binary/bin.MB2.1.sg Added detection rule for "MB2" format; checks for "'BNAM'" signature within the binary.
db/Binary/bin.HNM.1.sg Added detection rule for "HNM" format; checks for "HNM6" signature at the start of the binary.
db/Binary/bin.MDL.1.sg Added detection rule for "MDL" format; checks for "IDST1" signature at the start of the binary; includes author info and reference URL.
db/Binary/bin.VVD.1.sg Added detection rule for "VVD" format; checks for "IDSV" signature at the start of the binary; includes author info and reference URL.
db/Binary/bin.IVF.1.sg Added detection rule for "IVF" format; checks for "DKIF" signature at the start of the binary.
db/Binary/bin.VTF.1.sg Added detection rule for "VTF" format; checks for "VTF" signature at the start of the binary.
db/Binary/archive.STK.sg Removed explicit else branch resetting detection flag bDetected to false when signature check fails.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DetectionRule (HSM/MB2/HNM/MDL/VVD/IVF/VTF)
    participant BinaryData

    User->>DetectionRule (HSM/MB2/HNM/MDL/VVD/IVF/VTF): Call detect(BinaryData)
    DetectionRule (HSM/MB2/HNM/MDL/VVD/IVF/VTF)->>BinaryData: Check for signature
    BinaryData-->>DetectionRule (HSM/MB2/HNM/MDL/VVD/IVF/VTF): Return signature presence
    DetectionRule (HSM/MB2/HNM/MDL/VVD/IVF/VTF)-->>User: Return detection result
Loading

Possibly related PRs

  • implement new signatures #273: Adds new binary format detection rules based on simple signature checks, similar in structure and purpose to this PR.
  • implement W3D script #268: Adds new detection rule files with detect() functions identifying binary formats by signature strings at the start of the binary data.
  • add STK script #255: Adds detection scripts for different binary archive formats using signature checks, related in approach to the detection rules added here.

Poem

In the warren of bytes, eight signatures gleam,
HSM, MB2, HNM, MDL, VVD join the team.
IVF and VTF hop into the light,
Each with a signature shining bright.
Archive.STK sheds a branch, light and free,
Hopping through binaries with glee!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
db/Binary/bin.HNM.1.sg (1)

7-9: Consider adding a comment about the HNM format.

It would be helpful to add a brief comment explaining what the HNM format is and what the signature "HNM6" represents for better understanding and maintainability.

function detect() {
+    // Check for HNM6 signature (HNM is a binary format for...)
    if (Binary.compare("'HNM6'")) {
        bDetected = true;
    }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc2bd6 and 079f0df.

📒 Files selected for processing (3)
  • db/Binary/bin.HNM.1.sg (1 hunks)
  • db/Binary/bin.HSM.1.sg (1 hunks)
  • db/Binary/bin.MB2.1.sg (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • db/Binary/bin.HSM.1.sg
  • db/Binary/bin.MB2.1.sg
🔇 Additional comments (4)
db/Binary/bin.HNM.1.sg (4)

1-3: Well-documented author attribution.

The header comments clearly identify the purpose of the file and the author, which is good practice.


4-4: LGTM: Format initialization looks correct.

The initialization of the format to "HNM" aligns with the file's purpose.


11-11: LGTM: Standard result return pattern.

Returning the result using the result() function follows the pattern used in other detection rules.


6-12:

❌ Incorrect review comment

Verify string format in Binary.compare.

The signature check looks functional, but the nested quotes in "'HNM6'" are worth verifying. If the intention is to match the literal string "HNM6" (without quotes), you might need to remove the inner quotes depending on how the Binary.compare function works.


🏁 Script executed:

#!/bin/bash
# Find other examples of Binary.compare usage in the codebase to verify the correct format
echo "Checking for other examples of Binary.compare usage:"
rg "Binary\.compare\(" --type js -A 1 -B 1

Length of output: 451


Ignore string-format suggestion: nested quotes are required
The "'HNM6'" argument matches the literal bytes syntax used by Binary.compare (see help/Binary.js examples: "'7z'BCAF271C", "'WAVEfmt '"). No change needed.

Likely an incorrect or invalid review comment.

@BJNFNE BJNFNE force-pushed the implement branch 4 times, most recently from 0978da3 to 295f9b3 Compare May 10, 2025 12:32
@DosX-dev DosX-dev merged commit 86816cf into horsicq:master May 10, 2025
1 check passed
@BJNFNE BJNFNE deleted the implement branch May 10, 2025 15:09
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.

2 participants