summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 87b47ef..bd6d294 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,14 +59,26 @@ int main(int argc, char **argv)
}
- /* Generate a memory model of the file */
- if (opts.model) {
- ElfuElf *me;
+ /* Copy the input ELF to the output file */
+ if (!opts.fnOutput) {
+ if (opts.copy) {
+ fprintf(stderr, "Error: Missing output file name for requested operation.\n");
+ }
+ } else {
+ if (opts.copy) {
+ ElfuElf *me;
+
+ me = elfu_modelFromElf(hIn.e);
+
+ if (me) {
+ printf("Model successfully loaded.\n");
- me = elfu_modelFromElf(hIn.e);
+ elfu_modelToElf(me, hOut.e);
- if (me) {
- printf("Model successfully loaded.\n");
+ printf("Model converted to ELF, ready to be written.\n");
+ } else {
+ printf("Failed to load model.\n");
+ }
}
}