Comments (5)
I think what you're looking for is offset-adjust, not jump-to-offset.
from binwalk.
Not really. What i want to do is jump back in file and continue parsing.
from binwalk.
The jump-to-offset keyword is used to instruct binwalk where it should resume the scan (e.g., if binwalk finds a file system that is 2MB in size, there's no point in scanning the next 2MB of data). Keywords are interpreted by binwalk after libmagic has already processed the entire signature, so it can't be used to do what you're attempting.
Due to binwalk's requirement that signatures start at an offset of 0, if you want to process data that comes before your magic string then you'll need to write a plugin to handle that.
With that said, the zero-offset requirement can be quite limiting and is a hold over from older code. With the current code base it should be possible to allow for arbitrary signature offsets without affecting scan speed. I'll leave this issue open while I look into it.
from binwalk.
Ok, understood. I am looking at the source code now to write my own plugin, because there are a lot of limitations in magic file syntax.
And I want to write decoders for firmwares I am reversing.
As an example of magic syntax: to avoid false positive reaction I want to check that lelong value is less then file-size.
Another example: I want to search for magicB blob only if I found magicA before current offset.
from binwalk.
True, sometimes the magic file format just doesn't cut it, which is why binwalk has added some pseudo-extensions to the magic file format.
Speaking of which, the latest check in to the master branch validates the file-size keyword (i.e.., if file-size value plus the signature offset is bigger than the size of the file, it is considered invalid). You'll still need a plugin for only matching magicB if magicA was previously found though.
Additionally, the latest master code supports specifying non-negative offsets for your magic signatures which should alleviate your original issue.
from binwalk.
Related Issues (20)
- Anti-patterns in extractor.py module
- Binwalk stuck when extracting .xz archive
- Cannot extract anything from a device, not file
- If providing more than one file, binwalk uses verbose mode only.
- AttributeError: module 'binwalk' has no attribute 'scan'
- Symlink Error HOT 1
- ubireader problem HOT 6
- Unable to proceed from the installation guide.
- Add support for ArchLinux in deps.sh
- Would it be possible to use the built-in python module 'getpass' as a somewhat OS agnostic way to get the username? HOT 2
- Dockerfile fails to build due to ubi_reader changes HOT 1
- binwalk fails to extract after filename/extension confusion HOT 3
- Call plugins when Result is Valid
- Name 'np' is not defined while calculating file entropy. HOT 1
- deprecated nose dependency, deprecated used of setup.py test
- Python 3.12 compatibility issue: No module named 'imp' HOT 4
- Trouble extracting cpio embedded into kernel file
- Dead Project - Parent Company Killed by Microsoft :( - See readme HOT 6
- external extractor HOT 5
- [Feature Request] Extract RSA/Certificates and Private Keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binwalk.