martinlindhe / feng

Binary file format template system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rework magic yaml section

martinlindhe opened this issue · comments

Current impl is limiting:

magic:
  - offset: 0000
    match: D4 76 8E 4B

We want something with multiple conditions, like gnu file has.

Maybe something like:

magic:
  - "0000: = D4 76 8E 4B"     # equals
    - "0004: > be:u32 1000"   # and is greater than

  - "0000: ! be:u32 1234"     # not equal
    - "0004: < le:u32 1500"   # and is less than

Also wanted:

  • minsize: 123 # file size must be at least 123 bytes