lfanew - manipulate fat binary programs wrapped in MZ files
Contents
Description
By default, lfanew adds a .e_lfanew header field to an old-style MZ executable, so that the program can
be used as an MS-DOS loader stub for a NE/PE executable.
With -S ("stubify"), lfanew creates a "fat" binary by combining an MZ stub with a NE/PE payload.
With -U ("unstubify"), lfanew extracts a NE/PE payload from a "fat" binary, removing any MZ stub.
Name
lfanew - manipulate fat binary programs wrapped in MZ files
Notes
lfanew can add a stub to a Portable Executable payload if there is enough RVA space before the PE
sections to accommodate the stub and PE headers. PE executables generally need to be unstubified before
a different stub can be attached.
Options
-k Keeps the output if an error is encountered, instead of deleting it.
-p Derives the stub size from .e_cp and .e_cblp, rather than from .e_lfanew.
Synopsis
lfanew [-k] -o <out-stub-file> <in-stub-file>
lfanew-S [-k] [-p] -o <out-fat-file> <in-payload-file> <in-stub-file>
lfanew-U [-k] -o <out-payload-file> <in-fat-file>
