LFANEW(1)
π LFANEW(1) β like, the manual page, bestie π
General Commands Manual β¨ lfanew β¨
πΈ NAME πΈ
lfanew β manipulate fat binary programs wrapped in MZ files π«Ά
β¨ 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>
π¦ DESCRIPTION π¦
Okay so default behaviour, no flags, nothing: lfanew adds a .e_lfanew header field to an old-style MZ executable. Why tho? So the program can be used as an MS-DOS loader stub for a NE/PE executable. It's giving "glow-up for your stub" π
With -S ("stubify"), lfanew creates a "fat" binary by combining an MZ stub with a NE/PE payload. Two things, one file. Iconic. π₯
With -U ("unstubify"), lfanew extracts a NE/PE payload from a "fat" binary, removing any MZ stub. Yeet the stub, keep the payload. πβ¨
π OPTIONS π
-kβ Keeps the output if an error is encountered, instead of deleting it. Like, if things go sideways, your file stays. No take-backs, no auto-cleanup. π-pβ Derives the stub size from.e_cpand.e_cblp, rather than from.e_lfanew. Different source of truth, bestie. β
π 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. That's the vibe check right there β no room, no stub. π
PE executables generally need to be unstubified before a different stub can be attached. So like, un-stub first, then re-stub. No cap. π
π AUTHORS π
lfanew was written by TK Chia. π
This manual page was formatted by Stephen Kitt <skitt@debian.org> for the Debian GNU/Linux system (but may be used by others). π«Ά
okay that's the whole page, mwah π this was the LFANEW(1) manual page, dated 20230825, and yes the footer really does say LFANEW(1) again because it's that girl. periodt. β¨π
π¦ where this page comes from
- debian trixie: lfanew 0~20230825+dfsg-1 Β· MPL-2.0
- ubuntu questing: lfanew 0~20230825+dfsg-1
- ubuntu resolute: lfanew 0~20230825+dfsg-1build1 Β· MPL-2.0
- ubuntu stonking: lfanew 0~20230825+dfsg-1build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms