The following patch against nasm-0.98.38 adds a new
flag "-n" to ndisasm, which specifies that the output
emitted will be in NASM-syntax form. Naturally, the
emitted code will in most cases need to be fixed by
hand in order to be compiled into the /same/ binary as
the one disassembled, or in some case, to compile at
all. (issues are with addressing, which can be manually
fixed). This feature was added in order to simplify
reverse-engineering code. Additionally, if a value
other than 16 or 32 is passed to -b, not only is a
warning message printed (as is the current behavior),
but the program exits. The man page for ndisasm has
been modified to reflect the addition of the -n flag.
Apply with patch -i.
Nasm output flag feature.
Logged In: YES
user_id=804543
Fwiw, see SF RFEs #822614 and #913690.