Skip to content
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

Incorrect display of unparsed elements when using non-contigious type #180

Open
podcherklife opened this issue Jul 28, 2024 · 0 comments
Open

Comments

@podcherklife
Copy link

podcherklife commented Jul 28, 2024

If element is non-contigious e.g. has 'instances' section part that points to a different part of the file, hex viewer displays some parts of the file as unparsed when toggling "disable lazy parsing".

Apparently this happens because fillInterals in ParsedTreeHandler.getNode function discards intervals that have start <= lastEnd. I tried to remove this condition and then sort intervals by start, and that seemed to fix the problem, however I did not go further than that.

example .ksy :

meta:
  id: test
  file-extension: test_input


seq:
  - id: header
    type: header
  - id: elements
    type: element
    repeat: expr
    repeat-expr: header.elements_count
  
    
    
types:
  element: 
    seq:
      - id: element_body_offset
        type: u1
      - id: element_body_size
        type: u1
    instances:
      body:
        pos: element_body_offset
        size: element_body_size
        type: str
        encoding: ASCII
  header:
    seq:
      - id: elements_count
        type: u1

Test file (it is not actually a zip) test_input.zip

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

No branches or pull requests

1 participant