文件名称:68k反汇编源代码
文件大小:42KB
文件格式:7Z
更新时间:2015-06-07 12:52:01
68000 disasm 68k dis
68000 反汇编C原码 /* * main() */ int main(int argc, char **argv) { char dis_op[64], dis_inst[32], dis_arg[24]; UINT32 start_addr = 0, org = 0, do_org = 0, len = 0, fsize, i, j, k, file_i = 0; FILE *fp; UINT8 *buffer; char *c; /* * Process the command line */ if (argc <= 1) ShowHelp(); for (i = 1; i < argc; i++) { if (argv[i][0] != '-') { if (file_i) fprintf(stderr, "68kd: Garbage on the command line (ignored): %s\n", argv[i]); else file_i = i; } else if (!strcmp(argv[i], "-?") || !strcmp(argv[i], "-h")) ShowHelp(); else if (!strcmp(argv[i], "-s")) { i++; if (i >= argc) fprintf(stderr, "68kd: Warning: No argument to: %s (ignored)\n", "-s"); else start_addr = strtoul(argv[i], &c, 16); } else if (!strcmp(argv[i], "-l")) { i++; if (i >= argc) fprintf(stderr, "68kd: Warning: No argument to: %s (ignored)\n", "-l"); else { len = strtoul(argv[i], &c, 16); if (!len) exit(0); // nothing to do! } } else if (!strcmp(argv[i], "-o")) { i++; if (i >= argc) fprintf(stderr, "68kd: Warning: No argument to: %s (ignored)\n", "-o"); else { org = strtoul(argv[i], &c, 16); do_org = 1; } } else fprintf(stderr, "68kd: Warning: Unrecognized option: %s (ignored)\n", argv[i]); } if (!file_i) { fprintf(stderr, "68kd: No file specified\n"); exit(1); } /* * Load file */ if ((fp = fopen(argv[file_i], "rb")) == NULL) { fprintf(stderr, "68kd: Unable to open %s for writing\n", argv[file_i]); exit(1); } fseek(fp, 0, SEEK_END); fsize = ftell(fp); rewind(fp); if ((buffer = (UINT8 *) malloc(fsize)) == NULL) { fprintf(stderr, "68kd: Not enough memory to load input file: %s, %lu bytes\n", argv[file_i], (unsigned long) fsize); exit(1); } fread(buffer, sizeof(UINT8), fsize, fp); fclose(fp); ByteSwapMemory(buffer, fsize);
【文件预览】:
68KD.C
DIS_68K.C
DIS_68K.H
68KD.EXE