-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support for post-unpack plugins #80
Comments
Hi, |
My rough idea was to add a method to The anatomy of the post extraction unpack plugin would be the same as any of the other plugins (name/version etc). Then modify the
The I think that I may still like the idea of adding a filter to the mix as well. This seems like a fairly minimal set of changes to implement, and would make for a better implementation for these specific use cases... Here are some use cases that I have encountered that rely on multiple files (usually there is a manifest file).
|
For the record: "fact_extractor is so neat, I use it everyday" <-- Me... I just said that, and it's true. |
What is the status of this by the way? Have you worked on a solution yet? I think we haven't on our side, though I see a possibility of trying out some ideas in the fall. |
So... the short version... I haven't started implementing it. The longer version: I have a system that uses
So if there is an archive that occurs in multiple fw, we shouldn't spend resources extracting it every time we see it. There are some inherent complexities that come with this, because you need to store a bunch of information about what plugins were used, and complexity about handling archives within archives etc... anyway, I'm going off on a tangent. All this to say that I rely on the plugin name and plugin version to determine if a file needs to be re-processed because of a change in the plugins. Now, if a post-unpack plugin can potentially be run after any other plugins, it introduces more complexity to that logic, and that needs some serious consideration to get right. So I delayed working on this until it bothers me enough to implement. Of course none of this is anything you, as maintainers, need to worry about. I'm encountering more instances where this will be useful though. It looks like Qualcomm really likes following this paradigm of having manifest files alongside binary files. I will definitely ping you and provide an update if/when I implement something like this. |
What I'm finding in a bunch of cases is a need for unpack plugins to have access to multiple files at the same time in order to complete a full unpack. Here is an example... I ported the following
go
code to python:packsparseimg.go
The idea with this is that there is a
rawprogram*.xml
file that holds information about how to unpack the img files that go with it. So for instance there can be severaluserdata_x.img
files, and the xml file contains the offsets of where to write the individual files in order to resemble the outer image.This isn't a problem if the outer container format is known. For instance, if it's a
tar
file I could add functionality to thepatool
plugin to check forrawprogram*.xml
files and process them. But now if the outer container is a7z
file, then I have to duplicate that functionality to the7z
plugin. I can put this functionality in a helper class that's available from several plugins, but that doesn't feel very extensible.What I'd like to see is a different type of plugin that registers a file pattern to look for in extracted files, if found, it calls this plugin with the directory that contains the extracted files so that it can re-assemble the .img files into something another plugin can then unpack in isolation.
In my opinion this makes it more module and extensible, but would like your opinion about this. Are you open to this plan? If I implement this in a fork will you consider a PR with this functionality? If this doesn't sound appealing or you have objections I'd love to hear them and I'll adjust accordingly.
The text was updated successfully, but these errors were encountered: