Added 'objdump.c' for dumping the text segment of NED a.out files as a binary blob.
[ned1] / neddis / neddis.c
index 306666e..c1fca70 100644 (file)
@@ -60,7 +60,7 @@ void
 print_usage(char ** argv)
 {
     printf( "NED Disassembler v%d (www.subgeniuskitty.com)\n"
 print_usage(char ** argv)
 {
     printf( "NED Disassembler v%d (www.subgeniuskitty.com)\n"
-            "Usage: %s -i <file>\n"
+            "Usage: %s -i <file> [-l] [-s]\n"
             "  -h         Help (prints this message)\n"
             "  -i <file>  Specify a binary image file to disassemble.\n"
             "  -s         Print summary of information in a.out exec header.\n"
             "  -h         Help (prints this message)\n"
             "  -i <file>  Specify a binary image file to disassemble.\n"
             "  -s         Print summary of information in a.out exec header.\n"
@@ -323,7 +323,7 @@ main(int argc, char ** argv)
     uint32_t offset = aout_exec.a_entry;
     /* Since all NED instructions are one word (4 bytes) wide, read in one word increments. */
     uint32_t i = 1;
     uint32_t offset = aout_exec.a_entry;
     /* Since all NED instructions are one word (4 bytes) wide, read in one word increments. */
     uint32_t i = 1;
-    while (i < text_segment[0]) {
+    while (i <= text_segment[0]) {
         if (display_labels) {
             for (uint32_t i=0; i < symbol_count; i++) {
                 if (offset == symbol_table[i].n_value) {
         if (display_labels) {
             for (uint32_t i=0; i < symbol_count; i++) {
                 if (offset == symbol_table[i].n_value) {