diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -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"); + } } } |