mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Update and clean up to file entropy measurement.
- Updated to newer file analyzer api.
This commit is contained in:
parent
b81510592a
commit
9c692bad39
2 changed files with 16 additions and 20 deletions
|
@ -3,7 +3,8 @@ module Files;
|
|||
|
||||
export {
|
||||
redef record Files::Info += {
|
||||
## The information density of the contents of the file, expressed as a number of bits per character.
|
||||
## The information density of the contents of the file,
|
||||
## expressed as a number of bits per character.
|
||||
entropy: double &log &optional;
|
||||
};
|
||||
}
|
|
@ -1,29 +1,24 @@
|
|||
// See the file in the main distribution directory for copyright.
|
||||
|
||||
#include "plugin/Plugin.h"
|
||||
#include "file_analysis/Component.h"
|
||||
|
||||
#include "Entropy.h"
|
||||
|
||||
namespace plugin { namespace Bro_FileEntropy {
|
||||
namespace plugin {
|
||||
namespace Bro_FileEntropy {
|
||||
|
||||
class Plugin : public plugin::Plugin {
|
||||
protected:
|
||||
void InitPreScript()
|
||||
public:
|
||||
plugin::Configuration Configure()
|
||||
{
|
||||
SetName("Bro::FileEntropy");
|
||||
SetVersion(-1);
|
||||
SetAPIVersion(BRO_PLUGIN_API_VERSION);
|
||||
SetDynamicPlugin(false);
|
||||
AddComponent(new ::file_analysis::Component("ENTROPY", ::file_analysis::Entropy::Instantiate));
|
||||
|
||||
SetDescription("Entropy test file content");
|
||||
|
||||
AddComponent(new ::file_analysis::Component("ENTROPY",
|
||||
::file_analysis::Entropy::Instantiate));
|
||||
|
||||
extern std::list<std::pair<const char*, int> > __bif_events_init();
|
||||
AddBifInitFunction(&__bif_events_init);
|
||||
plugin::Configuration config;
|
||||
config.name = "Bro::FileEntropy";
|
||||
config.description = "Entropy test file content";
|
||||
return config;
|
||||
}
|
||||
};
|
||||
} plugin;
|
||||
|
||||
Plugin __plugin;
|
||||
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue