shramos / polymorph

Polymorph is a real-time network packet manipulation framework with support for almost all existing protocols
GNU General Public License v2.0
445 stars 61 forks source link

~/.polymorph dir //WIP #3

Open XaviTorello opened 5 years ago

XaviTorello commented 5 years ago

Use ~/.polymorph dir

// Do not merge, the idea is to integrate it into a devel branch and keep working on it, but I can just PR to master.

This improves Polymorph to be able to store all files (conditions, templates, temps, ...) inside a $home based polymorph directory.

By default this points to ~/.polymorph, and at init time it ensures that the needed structure exists

In this case, we validate:

- ~/.polymorph
- ~/.polymorph/conditions
- ~/.polymorph/templates
- ~/.polymorph/conditions/executions
- ~/.polymorph/conditions/postconditions
- ~/.polymorph/conditions/preconditions

New settings class supports us to set library based properties and prerequisites.

It adapts all IO operations to use new settings.paths

It also provides a new way to perform hot module loading based on the imp library, see new method utils.import_file

Additionally, templates save process ensures that .json extension is included, and dumps the template to the templates folder ~/.polymorph/templates.


WIP, some things to do


Will fix #2