summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-01-26 21:37:49 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-01-26 21:37:49 (GMT)
commit262c95e0b088a56e9fd919edc57ad19f85e2e40e (patch)
tree8510a15924423abb3208610f724d911f2f79b9a6 /src/analysis/disass
parent0993276d6450919c6d178182c5fd26497b62d5fc (diff)
Begun to rewrite the whole plugins system.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@461 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/disassembler.c49
1 files changed, 6 insertions, 43 deletions
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 9907a52..126c116 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -192,11 +192,6 @@ static GDelayedDisassembly *g_delayed_disassembly_new(GLoadedBinary *binary, GBi
* *
******************************************************************************/
-#include <time.h>
-
-#include <sys/time.h>
-#include <sys/resource.h>
-
static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtStatusBar *statusbar)
{
@@ -213,14 +208,9 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
- clock_t begin, end;
- double time_spent;
- struct rusage usage;
- unsigned long ustart;
- unsigned long uend;
-
+ routines = g_binary_format_get_routines(G_BIN_FORMAT(disass->format), &routines_count);
/* Première étape */
@@ -229,12 +219,8 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
+ process_disassembly_event(PGA_DISASSEMBLY_STARTED, disass->binary);
- begin = clock();
-
- getrusage(RUSAGE_THREAD, &usage);
- ustart = usage.ru_utime.tv_sec * 1000000 + usage.ru_utime.tv_usec;
- ustart += usage.ru_stime.tv_sec * 1000000 + usage.ru_stime.tv_usec;
*disass->instrs = disassemble_binary_content(disass->binary, statusbar);
@@ -248,24 +234,13 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
- getrusage(RUSAGE_THREAD, &usage);
- uend = usage.ru_utime.tv_sec * 1000000 + usage.ru_utime.tv_usec;
- uend += usage.ru_stime.tv_sec * 1000000 + usage.ru_stime.tv_usec;
-
-
- end = clock();
-
- time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
-
- printf("[[ TIME ]] Disassembly :: %.2g (%.2g)\n", time_spent, (uend - ustart) / 1000000.0);
-
//gtk_extended_status_bar_remove(statusbar, id);
- run_plugins_on_binary(disass->binary, PGA_BINARY_DISASSEMBLED, true);
+ //run_plugins_on_binary(disass->binary, PGA_BINARY_DISASSEMBLED, true);
do
@@ -301,13 +276,6 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
qsort(routines, routines_count, sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_compare);
- begin = clock();
-
-
- getrusage(RUSAGE_THREAD, &usage);
- ustart = usage.ru_utime.tv_sec * 1000000 + usage.ru_utime.tv_usec;
- ustart += usage.ru_stime.tv_sec * 1000000 + usage.ru_stime.tv_usec;
-
print_disassembled_instructions(disass->buffer, disass->format, *disass->instrs,
routines, routines_count, statusbar, id);
@@ -316,21 +284,16 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
- getrusage(RUSAGE_THREAD, &usage);
- uend = usage.ru_utime.tv_sec * 1000000 + usage.ru_utime.tv_usec;
- uend += usage.ru_stime.tv_sec * 1000000 + usage.ru_stime.tv_usec;
- end = clock();
+ process_disassembly_event(PGA_DISASSEMBLY_ENDED, disass->binary);
- time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
-
- printf("[[ TIME ]] Printing :: %.2g (%.2g)\n", time_spent, (uend - ustart) / 1000000.0);
+ printf("---fin\n");
//gtk_extended_status_bar_remove(statusbar, id);
- run_plugins_on_binary(disass->binary, PGA_BINARY_PRINTED, true);
+ //run_plugins_on_binary(disass->binary, PGA_BINARY_PRINTED, true);