Date: Thu, 8 Dec 94 19:36 MST From: mat AT ardi DOT com (Mat Hostetter) To: ANTHONY APPLEYARD Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu Subject: Re: A disassembler in djgpp? References: >>>>> "ANTHONY" == ANTHONY APPLEYARD writes: ANTHONY> In djgpp I found a file called ANTHONY> C:\DJGPP\SRC\GAS-2.3\OPCODES\DISASSEM.C . Is it part of a ANTHONY> machine code - to - assembler language disassambler or ANTHONY> decompiler built into the Gnu Assembler? If so, how do I ANTHONY> call and use it? I believe this code is used by gdb. If you want to disassemble executables you built with djgpp, you can run gdb in batch mode and have it run a "disassemble" command on the executable. I've written a program that uses gdb as the engine to disassemble some 68k-based apps; it's not very hard. If you want to disassemble arbitrary 32-bit binary images, you can write a little program to generate a ".s" file containing a "_main" symbol, a few random assembler directives, and a bunch of .long directives specifying the bytes for the code of interest. Assemble it, link it, and run gdb on it as described above. It's easy enough to automate the process. -Mat