Skip to content

Add pattern for JXL #388

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add pattern for JXL #388

wants to merge 3 commits into from

Conversation

dxan29a
Copy link

@dxan29a dxan29a commented Apr 20, 2025

@Mrmaxmeier
Copy link
Contributor

Can you move this logic to Box or Header? 🙂

if (lbox == 1) {
  size = xlbox - 16;
} else {
  size = lbox - 8;
}

@dxan29a
Copy link
Author

dxan29a commented Apr 26, 2025

Hi @Mrmaxmeier, thanks for the advice! I was thinking that this way could explicitly show the field name in each different box instead of a general field name for each box. I believe it should be implemented in an elegant code style, but this is what I came up with. What do you think?

@WerWolv
Copy link
Owner

WerWolv commented May 10, 2025

Thanks a lot for the pattern! There seems to be some issue still when running the pattern on test file though. I don't know enough about the format really though. Here's the log from the CI

Executing pattern jxl.hexpat using test file jxl.hexpat.jxl
    [ERROR] [ Stack Trace ]
    [ERROR] <Source Code>:119:36 at address 0x0008
    [ERROR] 119 |         u8 remaining_bytes[lbox - 8];
                                         ^
    [ERROR] <Source Code>:120:5 at address 0x0008
    [ERROR] 120 |     }
          ^
    [ERROR] <Source Code>:115:8 at address 0x0008
    [ERROR] 115 | struct UnknownBox<auto lbox,
              ^^^^^^^^^^
    [ERROR] <Source Code>:136:45 at address 0x0008
    [ERROR] 136 |                    UnknownBox<header.lbox,
                          ^^^^^^^^^^
    [ERROR] <Source Code>:137:5 at address 0x0008
    [ERROR] 137 |     }
          ^
    [ERROR] <Source Code>:123:8 at address 0x0000
    [ERROR] 123 | struct Box {
             ^^^
    [ERROR] <Source Code>:140:1 at address 0x0000
    [ERROR] 140 | Box boxes[while(!std::mem::eof(
       ^^^
    [ERROR] Error happened with cursor at address 0xFF0A0054
    [ERROR] 

    [ERROR] runtime error: Array expanded past end of the data.
  -->   in <Source Code>:119:36
119 |         u8 remaining_bytes[lbox - 8];
                                         ^
Error when executing pattern!
119:36  runtime error: Array expanded past end of the data.
  -->   in <Source Code>:119:36
119 |         u8 remaining_bytes[lbox - 8];
                                         ^

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