diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2011-10-01 17:20:50 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2011-10-01 17:20:50 (GMT) |
commit | 02cb3aa4e7b18b644b034a5c659c332becf99c9b (patch) | |
tree | 8d816e5f93820c6ef5ba804d7c0776a65d78329a /src/analysis | |
parent | e0266175537ec220544c050874be215b11c902fa (diff) |
Defined the first real [python] plugin.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@210 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/binary.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 15be43e..f5ff3fb 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -365,17 +365,56 @@ static void g_openida_binary_init(GOpenidaBinary *binary) GOpenidaBinary *g_openida_binary_new_from_file(const char *filename) { GOpenidaBinary *result; /* Adresse à retourner */ + GPluginModule **pglist; /* Liste de greffons */ + size_t pgcount; /* Taille de cette liste */ + size_t i; /* Boucle de parcours */ + + + char *file = strdup(filename); result = g_object_new(G_TYPE_OPENIDA_BINARY, NULL); + + + + printf("%s\n", filename); + + + + pglist = get_all_plugins_for_action(PGA_FORMAT_MATCHER, &pgcount); + + if (pgcount > 0) + { + printf("===>>>> FOUND :: %d\n", pgcount); + + + /* + for (i = 0; i < pgcount; i++) + g_plugin_module_execute_action_on_binary(pglist[i], binary, PGA_CODE_PROCESS); + */ + free(pglist); + + } + + + + + + + + + log_variadic_message(LMT_PROCESS, _("Opening '%s' file..."), filename); result->filename = strdup(filename); + /* result->bin_data = map_binary_file(filename, &result->bin_length); if (result->bin_data == NULL) goto lbf_error; + */ - result->format = G_EXE_FORMAT(load_new_format(FMT_EXEC, result->bin_data, result->bin_length)); + result->format = G_EXE_FORMAT(load_new_format(FMT_EXEC, file, + &result->bin_data, &result->bin_length)); if (result->format == NULL) { log_simple_message(LMT_INFO, _("Unknown binary format")); |