diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-07-04 12:21:26 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-07-04 12:21:26 (GMT) |
commit | a60e81ac70b3d829f486ce7b6534005a9d025206 (patch) | |
tree | 0e3b284a12a1f8f4932f5cd05247a556cf8c5bf9 /src/analysis/binary.c | |
parent | b6893c7b85c34f7a3c65ac76bfd9d95b1c4ebf55 (diff) |
Defined general rendering options using a GLib object.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@89 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r-- | src/analysis/binary.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index e74680e..d7d050b 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -70,7 +70,7 @@ struct _openida_binary GArchProcessor *proc; /* Architecture du binaire */ GRenderingLine *lines; /* Lignes de rendu en place */ - disass_options options; /* Options de désassemblage */ + GRenderingOptions *options; /* Options de désassemblage */ }; @@ -137,11 +137,13 @@ openida_binary *load_binary_file(const char *filename) result->proc = get_arch_processor_from_format(result->format); - result->options.show_address = true; - result->options.show_code = true; + result->options = g_rendering_options_new(result->format, result->proc); - result->options.format = result->format; - result->options.proc = result->proc; + g_rendering_options_show_address(result->options, MRD_BLOCK, true); + g_rendering_options_show_code(result->options, MRD_BLOCK, true); + + g_rendering_options_show_address(result->options, MRD_GRAPH, true); + g_rendering_options_show_code(result->options, MRD_GRAPH, false); disassemble_openida_binary(result); @@ -300,9 +302,9 @@ exe_format *get_openida_binary_format(const openida_binary *binary) * * ******************************************************************************/ -disass_options *get_openida_binary_options(const openida_binary *binary) +GRenderingOptions *get_openida_binary_options(const openida_binary *binary) { - return &binary->options; + return binary->options; } @@ -642,7 +644,7 @@ void disassemble_openida_binary(openida_binary *binary) instr = g_arch_processor_decode_instruction(binary->proc, &binary->bin_data[start], &pos, len, start, addr); - line = g_code_line_new(addr, instr, &binary->options); + line = g_code_line_new(addr, instr, binary->options); g_rendering_line_add_to_lines(&binary->lines, line); } @@ -657,7 +659,7 @@ void disassemble_openida_binary(openida_binary *binary) routine_desc = g_binary_routine_to_string(routines[k]); - line = g_comment_line_new(routine_offset, routine_desc, &binary->options); + line = g_comment_line_new(routine_offset, routine_desc, binary->options); g_rendering_line_insert_into_lines(&binary->lines, line, true); free(routine_desc); |