Le script d'exemple ainsi que l'ensemble des codes sources utilisés dans cet article sont téléchargeables à l'adresse www.r-3-t.org/ms_rtti.7z.
1. Rappel sur le langage C
Lorsqu'un logiciel est écrit en langage C, il est relativement aisé d’en déduire les structures utilisées. Au paragraphe 6.7.2.1 du standard [1], on peut lire :
« Within a structure object, the non-bit-field members and the units in which bit-fields reside have addresses that increase in the order in which they are declared. A pointer to a structure object, suitably converted, points to its initial member (or if that member is a bit-field, then to the unit in which it resides), and vice versa. There maybe unnamed padding within a structure object, but not at its beginning. »
En d'autres termes, il existe une correspondance directe entre le code source C décrivant une structure et le code assembleur généré. Par exemple, la structure suivante :
typedefstruct {
intmember1;
charmember2;
intmember3;
}StructC;
a pour...
