~joshrig/dumppef

MacOS classic PEF file dumper.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~joshrig/dumppef
read/write
git@git.sr.ht:~joshrig/dumppef

You can also use your local clone with git send-email.

#dumppef

Dumps the contents of a MacOS PEF object file. Its aim(*) is to dump symbol information in a format somewhat like GNU nm(1).

It does no input file validation and barely any error checking, as such it will probably start your keyboard on fire, at best, or overcook your pancakes, at worst.

(*) it absolutely does nothing of the sort, at the moment.

#building

bash$ make

#running

bash$ ./dumppef PEF_FILE

#sample output

$ ./dumppef libs/MenusLib
Container Header
 tag1:             Joy!
 tag2:             peff
 architecture:     pwpc
 formatVersion:    1
 dateTimeStamp:    Fri Jan  4 13:06:34 2002
 oldDefVersion:    0
 oldImpVersion:    0
 currentVersion:   0
 sectionCount:     1
 instSectionCount: 0
 reservedA:        0

  Section Header[0]
   nameOffset:               -1
   defaultAddress:           0x00000000
   totalSize:                0
   unpackedSize:             0
   containerOffset:          80     (0x50) [absolute]
   sectionKind:              Loader
   shareKind:                Process share
   alignment:                0
   reservedA:                0

  Loader Info Header
   mainSection:              -1
   mainOffset:               0
   initSection:              -1
   initOffset:               0
   termSection:              -1
   termOffset:               0
   importedLibraryCount:     0
   totalImportedSymbolCount: 0
   relocSectionCount:        0
   relocInstrOffset:         0
   loaderStringsOffset:      56     (0x38) [relative]
   exportHashOffset:         392    (0x188) [relative]
   exportHashTablePower:     1      (0x1)
   exportSymbolCount:        19     (0x13)


  Hash table
   hash index[000] -> chainCount: 7    firstIndex: 0
   hash index[001] -> chainCount: 12   firstIndex: 7

  Export key table
   key index[0000] -> symbolLength: 21   encodedSymbolName: 0xbf83
   key index[0001] -> symbolLength: 16   encodedSymbolName: 0xd594
   key index[0002] -> symbolLength: 18   encodedSymbolName: 0x9b30
   key index[0003] -> symbolLength: 25   encodedSymbolName: 0xa25c
   key index[0004] -> symbolLength: 18   encodedSymbolName: 0xac80
   key index[0005] -> symbolLength: 22   encodedSymbolName: 0xafa8
   key index[0006] -> symbolLength: 14   encodedSymbolName: 0x4b0f
   key index[0007] -> symbolLength: 23   encodedSymbolName: 0xce7d
   key index[0008] -> symbolLength: 11   encodedSymbolName: 0xd391
   key index[0009] -> symbolLength: 18   encodedSymbolName: 0x9ccd
   key index[0010] -> symbolLength: 11   encodedSymbolName: 0x9475
   key index[0011] -> symbolLength: 11   encodedSymbolName: 0xbf91
   key index[0012] -> symbolLength: 11   encodedSymbolName: 0xc475
   key index[0013] -> symbolLength: 15   encodedSymbolName: 0x18b2
   key index[0014] -> symbolLength: 17   encodedSymbolName: 0xace2
   key index[0015] -> symbolLength: 25   encodedSymbolName: 0x525d
   key index[0016] -> symbolLength: 19   encodedSymbolName: 0x8875
   key index[0017] -> symbolLength: 19   encodedSymbolName: 0x51d9
   key index[0018] -> symbolLength: 19   encodedSymbolName: 0x4fe9

  Export symbol table
   sym index[0000] -> symbolClass: Vect symbol     stringTableOffset: 11
   sym index[0001] -> symbolClass: Vect symbol     stringTableOffset: 32
   sym index[0002] -> symbolClass: Vect symbol     stringTableOffset: 143
   sym index[0003] -> symbolClass: Vect symbol     stringTableOffset: 48
   sym index[0004] -> symbolClass: Vect symbol     stringTableOffset: 236
   sym index[0005] -> symbolClass: Vect symbol     stringTableOffset: 311
   sym index[0006] -> symbolClass: Vect symbol     stringTableOffset: 190
   sym index[0007] -> symbolClass: Vect symbol     stringTableOffset: 73
   sym index[0008] -> symbolClass: Vect symbol     stringTableOffset: 0
   sym index[0009] -> symbolClass: Vect symbol     stringTableOffset: 161
   sym index[0010] -> symbolClass: Vect symbol     stringTableOffset: 96
   sym index[0011] -> symbolClass: Vect symbol     stringTableOffset: 179
   sym index[0012] -> symbolClass: Vect symbol     stringTableOffset: 107
   sym index[0013] -> symbolClass: Vect symbol     stringTableOffset: 204
   sym index[0014] -> symbolClass: Vect symbol     stringTableOffset: 219
   sym index[0015] -> symbolClass: Vect symbol     stringTableOffset: 118
   sym index[0016] -> symbolClass: Vect symbol     stringTableOffset: 254
   sym index[0017] -> symbolClass: Vect symbol     stringTableOffset: 273
   sym index[0018] -> symbolClass: Vect symbol     stringTableOffset: 292

  Exported symbol names
   IsMenuItemIconEnabled
   IsMenuBarVisible
   AppendMenuItemText
   GetMenuExcludesMarkColumn
   EnableMenuItemIcon
   RemoveMenuItemProperty
   EnableMenuItem
   GetMenuItemPropertySize
   ShowMenuBar
   InsertMenuItemText
   GetMenuFont
   HideMenuBar
   SetMenuFont
   DisableMenuItem
   IsMenuItemEnabled
   SetMenuExcludesMarkColumn
   DisableMenuItemIcon
   GetMenuItemProperty
   SetMenuItemProperty

#references

https://developer.apple.com/library/archive/documentation/mac/pdf/MacOS_RT_Architectures.pdf