MTOC(1)

πŸ“¦ version 1010.6, in nixpkgs unstable

MTOC(1) πŸ’…βœ¨

okay bestie, welcome to the mtoc(1) page from the General Commands Manual πŸ’–. This is your no-cap guide to turning a Mach-O file into a PECOFF file, and yes, we're keeping every flag and every weird little detail. 🫢

πŸ’– NAME πŸ’–

mtoc β€” convert a Mach-O file to a PECOFF file. slay.

✨ SYNOPSIS ✨

mtoc [ -subsystem type ] [ -section_alignment value ] [ -align value ] [
       -version major.minor ] [ -d filename ] input output

you hand it an input and an output, and the flags in between are the optional extras. πŸ’…

🌸 DESCRIPTION 🌸

mtoc converts the input EFI file built as a Mach-O file into an output PEFOFF file. (yes, PEFOFF β€” that's the exact spelling on this page, iykyk πŸ™ˆ).

the flags, in order, looking iconic:

  • -subsystem type β€” picks the EFI subsystem type. type can be application, boot, or runtime. the default is application. πŸ‘‘
  • -section_alignment value β€” sets the PECOFF section alignment. value is a hexadecimal number that must be an integral power of 2. the default is the Mac OS X target pagesize (1000 hex). this value should match the value used for -segalign when linking the Mach-O file. ✨
  • -align value β€” sets the PECOFF file and section alignment. value is a hexadecimal number that must be an integral power of 2. the default is 400 hex. this value should match the value used for -segalign when linking the Mach-O file. πŸŽ€
  • -version major.minor β€” sets the PECOFF major and minor versions for the MajorImageVersion and MinorImageVersion fields. πŸ’œ
  • -d filename" β€” sets the filename to be used to create a debug directory entry with. (and yes, that trailing " is literally in the option name on the page β€” keeping it exactly, bestie πŸ’€).
lowkey important: -section_alignment and -align both want hexadecimal values that are integral powers of 2, and both should match the -segalign value you used when linking the Mach-O file. no cap. πŸ”₯

xoxo, this page is brought to you by Apple, Inc., dated July 21, 2017, and it's still the MTOC(1) manual page πŸ’–πŸ«Ά

πŸ“¦ where this page comes from