diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -5,6 +5,8 @@ #include <libelf.h> #include <gelf.h> +#include <libelfu/libelfu.h> + #include "elfhandle.h" #include "options.h" #include "printing.h" @@ -57,8 +59,25 @@ int main(int argc, char **argv) } /* Copy the input ELF to the output file */ - if (opts.fnOutput) { - elfu_copyElf(hOut.e, hIn.e); + if (!opts.fnOutput) { + if (opts.copy) { + fprintf(stderr, "Error: Missing output file name for requested operation.\n"); + } + } else { + if (opts.copy) { + elfu_copyElf(hOut.e, hIn.e); + } + } + + /* Generate a memory model of the file */ + if (opts.model) { + ElfuElf *me; + + me = elfu_modelFromElf(hIn.e); + + if (me) { + printf("Model successfully loaded.\n"); + } } |