summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 4ed0059..e664829 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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");
+ }
}