summaryrefslogtreecommitdiff
path: root/src/binary.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary.c')
-rw-r--r--src/binary.c58
1 files changed, 56 insertions, 2 deletions
diff --git a/src/binary.c b/src/binary.c
index 16be5ef..d55eb4a 100644
--- a/src/binary.c
+++ b/src/binary.c
@@ -444,6 +444,7 @@ void fill_snippet(GtkSnippet *snippet, GtkWidget *panel, GtkWidget *panel2)
size_t comments_count;
code_line_info **comments_list;
+ rendering_line *lines;
rendering_line *line;
code_line_info **list;
@@ -463,6 +464,8 @@ void fill_snippet(GtkSnippet *snippet, GtkWidget *panel, GtkWidget *panel2)
size_t k;
+ disass_options options;
+
proc = create_x86_processor();
pos = 0;
@@ -490,10 +493,61 @@ void fill_snippet(GtkSnippet *snippet, GtkWidget *panel, GtkWidget *panel2)
//exit(0);
- line = build_binary_prologue("/tmp/hello", bin_data, length);
+ lines = build_binary_prologue("/tmp/hello", bin_data, length);
+
+
+
+ options.show_address = true;
+ options.show_code = true;
+
+ options.format = format;
+ options.proc = proc;
+
+
+ parts = get_elf_default_code_parts(format, &parts_count);
+
+
+ for (i = 0; i < parts_count; i++)
+ {
+ get_bin_part_values(parts[i], &pos, &len, &base);
+
+
+
+ start = pos;
+ pos = 0;
+
+ while (pos < len)
+ {
+ offset = base + pos;
+
+
+ instr = decode_instruction(proc, &bin_data[start], &pos, len, start, offset);
+
+
+ line = create_code_line(instr, &options);
+ add_line_to_rendering_lines(&lines, line);
+
+ }
+
+
+ /****
+ ret = munmap(bin_data, length);
+ ****/
+
+ /*
+ gtk_snippet_build_content(snippet);
+ */
+
+ }
+
+
+
+
+
+
- gtk_snippet_set_rendering_lines(snippet, line);
+ gtk_snippet_set_rendering_lines(snippet, lines);
return;