1.21. Comment obtenir et modifier le header des binaires XCOFF

De UnixWiki
Aller à : navigation, rechercher

Lire le header d'un binaire:

 # dump -ov ${FICHIER}
test:
***Object Module Header*** # Sections Symbol Ptr # Symbols Opt Hdr Len Flags 4 0x00009e66 616 72 0x1002 Flags=( EXEC DYNLOAD DEP_SYSTEM ) Timestamp = "22 aoû 15:39:00 2012" Magic = 0x1df (32-bit XCOFF)

***Optional Header*** Tsize Dsize Bsize Tstart Dstart 0x000081ce 0x000008f2 0x000000c0 0x10000128 0x200002f6

SNloader SNentry SNtext SNtoc SNdata 0x0004 0x0002 0x0001 0x0002 0x0002
TXTalign DATAalign TOC vstamp entry 0x0007 0x0003 0x20000b20 0x0001 0x20000aa0
maxSTACK maxDATA SNbss magic modtype 0x00000000 0x00000000 0x0003 0x010b 1L

Modifier le header d'un binaire

 # ldedit -b rwexec ${FICHIER} (Marks a file's writable and mappable sections and stack as executable.) 
# ldedit -b norwexec ${FICHIER} (Marks a file's writable and mappable sections and stack as non-executable)

Ou pour rendre la stack nonexec:

 # sedmgr -c exempt ${FICHIER}

Pour une librairie utiliser la commande nm