<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Ingénierie inverse PPTX on File Format Blog</title>
    <link>https://blog.fileformat.com/fr/tag/ing%C3%A9nierie-inverse-pptx/</link>
    <description>Recent content in Ingénierie inverse PPTX on File Format Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>fr</language>
    <lastBuildDate>Wed, 16 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.fileformat.com/fr/tag/ing%C3%A9nierie-inverse-pptx/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Ingénierie inverse PPTX : Comprendre les fichiers PowerPoint en interne</title>
      <link>https://blog.fileformat.com/fr/presentation/pptx-reverse-engineering-understanding-powerpoint-files-internally/</link>
      <pubDate>Wed, 16 Sep 2026 00:00:00 +0000</pubDate>
      
      <guid>https://blog.fileformat.com/fr/presentation/pptx-reverse-engineering-understanding-powerpoint-files-internally/</guid>
      <description>Découvrez ce qui se cache réellement à l&amp;#39;intérieur d&amp;#39;un fichier `.pptx`. Apprenez comment l&amp;#39;empaquetage OpenXML, les graphes de relations, les formes et le balisage de dessin fonctionnent en coulisses.</description>
      <content:encoded><![CDATA[<p><strong>Dernière mise à jour</strong> : 16 sept., 2026</p>
<figure class="align-center ">
    <img loading="lazy" src="images/pptx-reverse-engineering-understanding-powerpoint-files-internally.png#center"
         alt="PPTX Reverse Engineering: Understanding PowerPoint Files Internally"/> 
</figure>

<hr>
<h2 id="ingénierie-inverse-pptx4-des-fichiers--guide-du-développeur">Ingénierie inverse <a href="https://docs.fileformat.com/presentation/pptx/">PPTX</a> des fichiers : Guide du développeur</h2>
<p>Les présentations modernes alimentent tout, des pitchs investisseurs aux métriques trimestrielles internes. Mais si vous avez déjà dû extraire du texte de façon programmatique, remplacer des modèles à l&rsquo;exécution, créer des générateurs de diapositives automatisés ou assainir des présentations confidentielles, vous avez probablement rapidement réalisé que les bibliothèques de présentation de haut niveau peuvent ressembler à une boîte noire imprévisible.</p>
<p>Lorsque des bibliothèques comme <a href="https://products.fileformat.com/presentation/python/python-pptx/"><code>python-pptx</code></a>, <a href="https://products.fileformat.com/presentation/java/apache-poi-xslf/">Apache POI</a> ou <a href="https://products.fileformat.com/presentation/net/openxmlsdk/">OpenXML SDK</a> atteignent leurs limites — ou introduisent des bugs de mise en page non documentés — la seule issue est de passer au travers. Vous devez comprendre ce qu’est réellement une présentation PowerPoint au niveau des octets et du schéma.</p>
<p>Dans cette plongée approfondie, nous lèverons le voile sur le format <code>.pptx</code>, déballerons sa structure interne, tracerons son graphe de relations, disséquerons ses hiérarchies de dessin, et examinerons des stratégies pratiques pour l’ingénierie inverse, l’inspection et la manipulation de présentations avec du code brut.</p>
<h2 id="1-questce-quun-fichier-pptx-réellement">1. Qu’est‑ce qu’un fichier <code>.pptx</code> réellement ?</h2>
<p>En son cœur, un fichier <code>.pptx</code> n&rsquo;est pas un binaire propriétaire monolithique comme l&rsquo;ancien format <code>.ppt</code> des années 1990. Depuis que Microsoft a introduit Office Open XML (ECMA-376 et ISO/IEC 29500), les documents Office modernes sont <strong>des archives Open Packaging Conventions (OPC)</strong>.</p>
<p>En termes simples : <strong>un fichier <code>.pptx</code> est simplement une archive zip contenant des documents XML et des ressources multimédias organisés dans un arbre de répertoires déterministe.</strong></p>
<p>Vous pouvez le prouver en quelques secondes en utilisant les outils standard du terminal :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># Rename the extension and unpack it</span>
</span></span><span style="display:flex;"><span>cp presentation.pptx presentation.zip
</span></span><span style="display:flex;"><span>unzip presentation.zip -d presentation_unpacked/
</span></span><span style="display:flex;"><span>cd presentation_unpacked/
</span></span><span style="display:flex;"><span>tree -L <span style="color:#ae81ff">2</span>
</span></span></code></pre></div><p>L&rsquo;arbre de répertoires résultant apparaît remarquablement cohérent :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>.
</span></span><span style="display:flex;"><span>├── [Content_Types].xml
</span></span><span style="display:flex;"><span>├── _rels/
</span></span><span style="display:flex;"><span>│   └── .rels
</span></span><span style="display:flex;"><span>├── docProps/
</span></span><span style="display:flex;"><span>│   ├── app.xml
</span></span><span style="display:flex;"><span>│   └── core.xml
</span></span><span style="display:flex;"><span>└── ppt/
</span></span><span style="display:flex;"><span>    ├── presentation.xml
</span></span><span style="display:flex;"><span>    ├── _rels/
</span></span><span style="display:flex;"><span>    ├── slides/
</span></span><span style="display:flex;"><span>    ├── slideLayouts/
</span></span><span style="display:flex;"><span>    ├── slideMasters/
</span></span><span style="display:flex;"><span>    ├── theme/
</span></span><span style="display:flex;"><span>    └── media/
</span></span></code></pre></div><p>Chaque ressource visuelle, transition, héritage du masque de diapositive, coordonnées de zone de texte et graphique vectoriel est codifié dans cette hiérarchie de fichiers.</p>
<h2 id="2-anatomie-du-paquet-soussystèmes-clés">2. Anatomie du paquet : sous‑systèmes clés</h2>
<p>Pour rétroconcevoir efficacement les présentations, vous devez comprendre les responsabilités de chaque composant de niveau supérieur.</p>
<h3 id="content_typesxml"><code>[Content_Types].xml</code></h3>
<p>Ceci est le manifeste d&rsquo;entrée pour le lecteur OPC. Il associe les extensions de fichiers et les noms de parties internes explicites aux types MIME/contenu standardisés. Si vous créez une nouvelle diapositive ou ajoutez une image et omettez de la déclarer dans <code>[Content_Types].xml</code>, PowerPoint déclarera le diaporama corrompu et demandera une récupération.</p>
<p>Exemple d&rsquo;extrait :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#f92672">&lt;Types</span> <span style="color:#a6e22e">xmlns=</span><span style="color:#e6db74">&#34;http://schemas.openxmlformats.org/package/2006/content-types&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;Default</span> <span style="color:#a6e22e">Extension=</span><span style="color:#e6db74">&#34;xml&#34;</span> <span style="color:#a6e22e">ContentType=</span><span style="color:#e6db74">&#34;application/xml&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;Default</span> <span style="color:#a6e22e">Extension=</span><span style="color:#e6db74">&#34;rels&#34;</span> <span style="color:#a6e22e">ContentType=</span><span style="color:#e6db74">&#34;application/vnd.openxmlformats-package.relationships+xml&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;Default</span> <span style="color:#a6e22e">Extension=</span><span style="color:#e6db74">&#34;png&#34;</span> <span style="color:#a6e22e">ContentType=</span><span style="color:#e6db74">&#34;image/png&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;Override</span> <span style="color:#a6e22e">PartName=</span><span style="color:#e6db74">&#34;/ppt/presentation.xml&#34;</span> 
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">ContentType=</span><span style="color:#e6db74">&#34;application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/Types&gt;</span>
</span></span></code></pre></div><h3 id="le-graphe-de-relations-_rels">Le graphe de relations <code>_rels/</code></h3>
<p>L&rsquo;un des concepts les plus cruciaux d&rsquo;OpenXML est <strong>l&rsquo;indirection via les relations</strong>. Les parties pointent rarement directement vers des chemins de fichiers bruts. Au lieu de cela, un fichier (par ex., <code>slide1.xml</code>) possède un fichier de relation associé situé dans un dossier frère <code>_rels</code> (par ex., <code>_rels/slide1.xml.rels</code>).</p>
<p>Les relations définissent :</p>
<ul>
<li>Hyperliens (<code>r:id=\&quot;rId2\&quot;</code>, TargetMode=&quot;External&quot;)</li>
<li>Images et pistes audio stockées dans <code>ppt/media/</code></li>
<li>Pointeurs d&rsquo;héritage de mise en page (<code>slideLayout1.xml</code>)</li>
<li>Diapositives de notes, commentaires et polices intégrées</li>
</ul>
<h3 id="docprops-métadonnées"><code>docProps/</code> (Métadonnées)</h3>
<ul>
<li><strong><code>core.xml</code></strong> : métadonnées Dublin Core — auteur, titre, date de création, horodatage de modification.</li>
<li><strong><code>app.xml</code></strong> : statistiques spécifiques à l&rsquo;application — version de PowerPoint, nombre total de diapositives, nombre de diapositives masquées, nombre de mots, noms de modèles de présentation.</li>
</ul>
<h3 id="ppt-le-moteur-de-présentation"><code>ppt/</code> (Le moteur de présentation)</h3>
<p>C’est ici que la présentation réelle se trouve :</p>
<ul>
<li><strong><code>presentation.xml</code></strong> : L’épine dorsale principale. Elle enregistre les ID des diapositives, les dimensions de la taille des diapositives, les références du maître des notes et les paramètres de police par défaut.</li>
<li><strong><code>slides/</code></strong> : Les diapositives individuelles (<code>slide1.xml</code>, <code>slide2.xml</code>, etc.).</li>
<li><strong><code>slideLayouts/</code></strong> : Préréglages structurels maîtres (Diapositive Titre, Deux Colonnes, En-tête de Section).</li>
<li><strong><code>slideMasters/</code></strong> : Styles globaux, palettes par défaut, remplissages d’arrière-plan et héritage des espaces réservés.</li>
<li><strong><code>theme/</code></strong> : Palettes de couleurs (accent 1 à 6, variantes sombre/clair) et schémas de polices (polices principales/secondaires).</li>
<li><strong><code>media/</code></strong> : Images brutes (PNG, JPEG, SVG), audio et fichiers vidéo.</li>
</ul>
<h2 id="3-dissection-dune-diapositive-les-dialectes-presentationml-p-et-drawingml-a">3. Dissection d’une diapositive : les dialectes PresentationML (<code>p:</code>) et DrawingML (<code>a:</code>)</h2>
<p>Lorsque vous ouvrez <code>ppt/slides/slide1.xml</code>, vous rencontrez deux espaces de noms XML principaux :</p>
<ol>
<li><strong>PresentationML (<code>p:</code>)</strong> : Gère les éléments de présentation structurels (diapositives, arbres de formes, groupes de canevas).</li>
<li><strong>DrawingML (<code>a:</code>)</strong> : Gère la typographie, la géométrie, les coordonnées 2D, les remplissages en dégradé et le rendu vectoriel.</li>
</ol>
<p>Voici un exemple simplifié de ce à quoi ressemble une forme de texte standard :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#f92672">&lt;p:sp&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">&lt;!-- 1. Non-visual shape properties (Identifiers, names) --&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;p:nvSpPr&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;p:cNvPr</span> <span style="color:#a6e22e">id=</span><span style="color:#e6db74">&#34;4&#34;</span> <span style="color:#a6e22e">name=</span><span style="color:#e6db74">&#34;Title Box 1&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;p:cNvSpPr&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;a:spLocks</span> <span style="color:#a6e22e">noGrp=</span><span style="color:#e6db74">&#34;1&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/p:cNvSpPr&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;p:nvPr&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;p:ph</span> <span style="color:#a6e22e">type=</span><span style="color:#e6db74">&#34;title&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/p:nvPr&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;/p:nvSpPr&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">&lt;!-- 2. Visual shape properties (Position, size, geometry) --&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;p:spPr&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:xfrm&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;a:off</span> <span style="color:#a6e22e">x=</span><span style="color:#e6db74">&#34;1524000&#34;</span> <span style="color:#a6e22e">y=</span><span style="color:#e6db74">&#34;1143000&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;a:ext</span> <span style="color:#a6e22e">cx=</span><span style="color:#e6db74">&#34;9144000&#34;</span> <span style="color:#a6e22e">cy=</span><span style="color:#e6db74">&#34;1828800&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/a:xfrm&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:prstGeom</span> <span style="color:#a6e22e">prst=</span><span style="color:#e6db74">&#34;rect&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;a:avLst/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/a:prstGeom&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:solidFill&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;a:schemeClr</span> <span style="color:#a6e22e">val=</span><span style="color:#e6db74">&#34;accent1&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/a:solidFill&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;/p:spPr&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">&lt;!-- 3. Text Body (Paragraphs, runs, styling) --&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;p:txBody&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:bodyPr</span> <span style="color:#a6e22e">rtlCol=</span><span style="color:#e6db74">&#34;0&#34;</span> <span style="color:#a6e22e">anchor=</span><span style="color:#e6db74">&#34;ctr&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:lstStyle/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:p&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;a:r&gt;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;a:rPr</span> <span style="color:#a6e22e">lang=</span><span style="color:#e6db74">&#34;en-US&#34;</span> <span style="color:#a6e22e">sz=</span><span style="color:#e6db74">&#34;3200&#34;</span> <span style="color:#a6e22e">b=</span><span style="color:#e6db74">&#34;1&#34;</span><span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;a:t&gt;</span>Mission Critical Architecture<span style="color:#f92672">&lt;/a:t&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&lt;/a:r&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/a:p&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;/p:txBody&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/p:sp&gt;</span>
</span></span></code></pre></div><h3 id="unités-de-mesure-cruciales-emu-et-centièmes-de-point">Unités de mesure cruciales : EMU et centièmes de point</h3>
<p>Remarquez les nombres de coordonnées dans <code>&lt;a:xfrm&gt;</code> :</p>
<ul>
<li><code>x=&quot;1524000&quot;</code></li>
<li><code>cx=&quot;9144000&quot;</code></li>
</ul>
<p>Ce sont des <strong>unités métriques anglaises (EMUs)</strong>.</p>
<ul>
<li>$1 \text{ pouce} = 914,400 \text{ EMUs}$</li>
<li>$1 \text{ cm} = 360,000 \text{ EMUs}$</li>
<li>$1 \text{ pt} = 12,700 \text{ EMUs}$</li>
</ul>
<p>Les EMUs permettent aux entiers de représenter des fractions exactes à la fois de pouces et de millimètres sans erreurs d’arrondi en virgule flottante sur différentes architectures matérielles.</p>
<p>Remarquez également la taille de la police :</p>
<ul>
<li><code>sz=\&quot;3200\&quot;</code> signifie <strong>32,00 pt</strong>. Les tailles de police dans DrawingML sont mesurées en centièmes de point.</li>
</ul>
<h2 id="4-la-chaîne-dhéritage-pourquoi-les-formes-héritent-de-styles-invisibles">4. La chaîne d’héritage : pourquoi les formes héritent de styles invisibles</h2>
<p>L’un des pièges les plus courants lors de la rétro‑ingénierie des fichiers PPTX est de supposer que le style visuel d’une forme est entièrement déclaré dans son propre <code>slideX.xml</code>.</p>
<p>En réalité, OpenXML repose sur un <strong>modèle d’héritage en cascade à 4 niveaux</strong> :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>[Theme: ppt/theme/theme1.xml]
</span></span><span style="display:flex;"><span>              │
</span></span><span style="display:flex;"><span>              ▼
</span></span><span style="display:flex;"><span>[Slide Master: ppt/slideMasters/slideMaster1.xml]
</span></span><span style="display:flex;"><span>              │
</span></span><span style="display:flex;"><span>              ▼
</span></span><span style="display:flex;"><span>[Slide Layout: ppt/slideLayouts/slideLayout1.xml]
</span></span><span style="display:flex;"><span>              │
</span></span><span style="display:flex;"><span>              ▼
</span></span><span style="display:flex;"><span>[Slide: ppt/slides/slide1.xml]
</span></span></code></pre></div><p>Si une zone de texte dans <code>slide1.xml</code> contient :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#f92672">&lt;a:p&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;a:r&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;a:t&gt;</span>Revenue Projections<span style="color:#f92672">&lt;/a:t&gt;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&lt;/a:r&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/a:p&gt;</span>
</span></span></code></pre></div><p>Il n&rsquo;y a aucune famille de polices, aucune couleur explicite, et aucune taille déclarée sur le run (<code>&lt;a:r&gt;</code>). Pour déterminer comment PowerPoint rend ce texte, votre analyseur doit :</p>
<ol>
<li>Identifier le type d&rsquo;espace réservé (<code>&lt;p:ph type=&quot;title&quot;/&gt;</code>).</li>
<li>Lire la disposition référencée dans <code>slide1.xml.rels</code>.</li>
<li>Vérifier si <code>slideLayout1.xml</code> fournit des surcharges de style pour cet espace réservé.</li>
<li>Revenir à <code>slideMaster1.xml</code> pour les styles par défaut du corps de texte du titre.</li>
<li>Tracer les jetons de couleur comme <code>accent1</code> ou <code>tx1</code> dans <code>theme1.xml</code> pour trouver le code couleur hexadécimal.</li>
</ol>
<p>Si vous ignorez ce graphe d&rsquo;héritage, votre analyseur lira mal les styles, les polices manquantes, les tailles de police et les ancres de mise en page.</p>
<h2 id="5-flux-de-travail-pratique-dingénierie-inverse">5. Flux de travail pratique d&rsquo;ingénierie inverse</h2>
<p>Lorsque vous devez enquêter sur le fonctionnement interne d&rsquo;une fonctionnalité particulière de PowerPoint (par exemple, les transitions morph, les tableaux complexes, les tracés vectoriels), suivez cette approche empirique :</p>
<h3 id="étape-1-créer-une-paire-de-différences-minimale">Étape 1 : Créer une &ldquo;paire de différences&rdquo; minimale</h3>
<ol>
<li>Ouvrez PowerPoint et créez une diapositive vierge.</li>
<li>Enregistrez-le sous le nom <code>before.pptx</code>.</li>
<li>Appliquez le changement unique exact que vous souhaitez rétroconcevoir (par ex., ajoutez une ombre portée à un cercle, modifiez le style d&rsquo;une puce, insérez une vidéo intégrée).</li>
<li>Enregistrez-le sous le nom <code>after.pptx</code>.</li>
</ol>
<h3 id="étape-2-décompresser-les-deux-archives">Étape 2 : Décompresser les deux archives</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>unzip before.pptx -d before/
</span></span><span style="display:flex;"><span>unzip after.pptx -d after/
</span></span></code></pre></div><h3 id="étape-3-formater-le-xml">Étape 3 : Formater le XML</h3>
<p>Le XML brut à l&rsquo;intérieur des archives Office est généralement dépourvu d&rsquo;indentation et de caractères de nouvelle ligne. Avant de faire un diff, formatez les fichiers :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>find before/ after/ -name <span style="color:#e6db74">&#34;*.xml&#34;</span> -exec xmllint --format <span style="color:#f92672">{}</span> --output <span style="color:#f92672">{}</span> <span style="color:#ae81ff">\;</span>
</span></span></code></pre></div><h3 id="étape-4-exécuter-un-diff-unifié">Étape 4 : Exécuter un diff unifié</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>diff -uNr before/ after/ &gt; changes.patch
</span></span></code></pre></div><p>L&rsquo;examen de <code>changes.patch</code> révèle le nom exact de la balise, l&rsquo;attribut d&rsquo;espace de noms et la hiérarchie du conteneur introduits par PowerPoint. C&rsquo;est le moyen le plus rapide de découvrir des propriétés de schéma non documentées ou obscures sans fouiller des milliers de pages de documentation ECMA-376.</p>
<h2 id="6-construire-un-micro-moteur-personnalisé-décompresser-modifier-recompresser">6. Construire un micro-moteur personnalisé : décompresser, modifier, recompresser</h2>
<p>Parfois, vous ne voulez pas d&rsquo;une dépendance d&rsquo;entreprise lourde comme Apache POI ou le SDK Microsoft OpenXML — surtout dans des environnements serverless légers (AWS Lambda, Cloudflare Workers, nœuds edge).</p>
<p>Voici un modèle Python autonome démontrant comment décompresser en toute sécurité un PPTX en mémoire, injecter des données personnalisées à l&rsquo;aide des outils de la bibliothèque standard, puis le reconditionner :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> zipfile
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> io
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> xml.etree.ElementTree <span style="color:#66d9ef">as</span> ET
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">modify_slide_title</span>(input_pptx_bytes: bytes, new_title: str) <span style="color:#f92672">-&gt;</span> bytes:
</span></span><span style="display:flex;"><span>    input_zip <span style="color:#f92672">=</span> zipfile<span style="color:#f92672">.</span>ZipFile(io<span style="color:#f92672">.</span>BytesIO(input_pptx_bytes))
</span></span><span style="display:flex;"><span>    output_buffer <span style="color:#f92672">=</span> io<span style="color:#f92672">.</span>BytesIO()
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">with</span> zipfile<span style="color:#f92672">.</span>ZipFile(output_buffer, <span style="color:#e6db74">&#34;w&#34;</span>, zipfile<span style="color:#f92672">.</span>ZIP_DEFLATED) <span style="color:#66d9ef">as</span> output_zip:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">for</span> item <span style="color:#f92672">in</span> input_zip<span style="color:#f92672">.</span>infolist():
</span></span><span style="display:flex;"><span>            content <span style="color:#f92672">=</span> input_zip<span style="color:#f92672">.</span>read(item<span style="color:#f92672">.</span>filename)
</span></span><span style="display:flex;"><span>            
</span></span><span style="display:flex;"><span>            <span style="color:#75715e"># Target slide 1</span>
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">if</span> item<span style="color:#f92672">.</span>filename <span style="color:#f92672">==</span> <span style="color:#e6db74">&#34;ppt/slides/slide1.xml&#34;</span>:
</span></span><span style="display:flex;"><span>                namespaces <span style="color:#f92672">=</span> {
</span></span><span style="display:flex;"><span>                    <span style="color:#e6db74">&#39;p&#39;</span>: <span style="color:#e6db74">&#39;http://schemas.openxmlformats.org/presentationml/2006/main&#39;</span>,
</span></span><span style="display:flex;"><span>                    <span style="color:#e6db74">&#39;a&#39;</span>: <span style="color:#e6db74">&#39;http://schemas.openxmlformats.org/drawingml/2006/main&#39;</span>
</span></span><span style="display:flex;"><span>                }
</span></span><span style="display:flex;"><span>                
</span></span><span style="display:flex;"><span>                <span style="color:#75715e"># Register namespaces to preserve prefixes</span>
</span></span><span style="display:flex;"><span>                <span style="color:#66d9ef">for</span> prefix, uri <span style="color:#f92672">in</span> namespaces<span style="color:#f92672">.</span>items():
</span></span><span style="display:flex;"><span>                    ET<span style="color:#f92672">.</span>register_namespace(prefix, uri)
</span></span><span style="display:flex;"><span>                    
</span></span><span style="display:flex;"><span>                root <span style="color:#f92672">=</span> ET<span style="color:#f92672">.</span>fromstring(content)
</span></span><span style="display:flex;"><span>                
</span></span><span style="display:flex;"><span>                <span style="color:#75715e"># Find title placeholder text run</span>
</span></span><span style="display:flex;"><span>                <span style="color:#66d9ef">for</span> title_run <span style="color:#f92672">in</span> root<span style="color:#f92672">.</span>findall(<span style="color:#e6db74">&#34;.//p:sp[p:nvSpPr/p:nvPr/p:ph[@type=&#39;title&#39;]]//a:t&#34;</span>, namespaces):
</span></span><span style="display:flex;"><span>                    title_run<span style="color:#f92672">.</span>text <span style="color:#f92672">=</span> new_title
</span></span><span style="display:flex;"><span>                    <span style="color:#66d9ef">break</span>
</span></span><span style="display:flex;"><span>                
</span></span><span style="display:flex;"><span>                content <span style="color:#f92672">=</span> ET<span style="color:#f92672">.</span>tostring(root, encoding<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;utf-8&#34;</span>, xml_declaration<span style="color:#f92672">=</span><span style="color:#66d9ef">True</span>)
</span></span><span style="display:flex;"><span>            
</span></span><span style="display:flex;"><span>            output_zip<span style="color:#f92672">.</span>writestr(item, content)
</span></span><span style="display:flex;"><span>            
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> output_buffer<span style="color:#f92672">.</span>getvalue()
</span></span></code></pre></div><h3 id="points-clés-à-retenir-lors-de-la-modification-des-fichiers-au-niveau-du-octet-brut">Points clés à retenir lors de la modification des fichiers au niveau du octet brut :</h3>
<ol>
<li><strong>Préservation des espaces de noms</strong> : les analyseurs XML réécrivent souvent les préfixes (<code>xmlns:p</code> peut devenir <code>xmlns:ns0</code>). Bien que XML valide, la validation stricte du schéma interne de PowerPoint rejette parfois les alias de préfixe non standard. Enregistrez explicitement les espaces de noms.</li>
<li><strong>Méthodes de compression ZIP</strong> : assurez-vous d&rsquo;écrire les fichiers en utilisant la compression deflate standard (<code>zipfile.ZIP_DEFLATED</code>).</li>
<li><strong>Vidage du flux</strong> : vérifiez toujours que votre tampon zip se ferme et se vide complètement avant d&rsquo;envoyer les octets en aval.</li>
<li><strong>Préserver les relations</strong> : si vous supprimez une diapositive, vous devez également supprimer son entrée dans <code>ppt/presentation.xml</code>, supprimer sa relation dans <code>ppt/_rels/presentation.xml.rels</code>, et nettoyer son type de contenu dans <code>[Content_Types].xml</code>.</li>
</ol>
<h2 id="7-considérations-de-performance-et-de-sécurité">7. Considérations de performance et de sécurité</h2>
<p>Le rétro‑ingénierie des fichiers PPTX ne consiste pas seulement à modifier les diapositives ; il s&rsquo;agit également d&rsquo;auditer ce qui entre dans vos systèmes.</p>
<h3 id="sécurité--billion-laughs--xxe">Sécurité : Billion Laughs &amp; XXE</h3>
<p>Comme les fichiers PPTX analysent du XML, toute chaîne de traitement côté serveur qui ingère des présentations soumises par les utilisateurs est vulnérable à :</p>
<ul>
<li><strong>Injection d&rsquo;entité externe XML (XXE)</strong> : XML malveillant tentant d&rsquo;accéder à <code>/etc/passwd</code> ou d&rsquo;interroger les points de terminaison de métadonnées cloud internes (<code>http://169.254.169.254/</code>).</li>
<li><strong>Attaques d&rsquo;expansion d&rsquo;entités (Billion Laughs)</strong> : boucles d&rsquo;entités exponentielles épuisant la RAM du système.</li>
</ul>
<p><strong>Atténuation</strong>: Désactivez toujours <code>resolve_entities</code>, <code>load_dtd</code> et la résolution réseau externe dans votre analyseur XML (par exemple, en utilisant <code>defusedxml</code> en Python).</p>
<h3 id="sécurité--macro-payloads-et-flux-cachés">Sécurité : Macro Payloads et flux cachés</h3>
<p>Inspectez les fichiers à la recherche de contenu <code>.pptm</code> se masquant sous des extensions <code>.pptx</code>. Faites attention à <code>ppt/vbaProject.bin</code>, qui contient du code Visual Basic compilé. Dans les fichiers <code>.pptx</code> standard, le code VBA est interdit ; la découverte de références de charges utiles binaires dans les relations doit immédiatement déclencher des drapeaux de mise en quarantaine.</p>
<h2 id="conclusion">Conclusion</h2>
<p>L&rsquo;ingénierie inverse des fichiers <code>.pptx</code> démystifie les logiciels de présentation. Une fois que vous reconnaissez que les fichiers PowerPoint ne sont que des packages zip structurés contenant des coordonnées, des références de schéma et des arbres de relations XML, vous n&rsquo;êtes plus limité par les abstractions tierces existantes.</p>
<p>Que vous optimisiez le débit de génération des diapositives, écriviez des désinfectants automatisés personnalisés ou dépanniez des problèmes d&rsquo;affichage, examiner directement l&rsquo;architecture OpenXML sous-jacente vous donne un contrôle total sur le pipeline de présentation.</p>
<h2 id="foire-aux-questions-faq">Foire aux questions (FAQ)</h2>
<p>**Q: Pouvez-vous convertir un .pptx en dossier standard et modifier les fichiers directement dans un IDE ?</p>
<p><strong>R1:</strong> Oui, vous pouvez extraire l&rsquo;archive, modifier le XML dans un éditeur comme VS Code, puis re-compresser le contenu du répertoire pour le rouvrir dans PowerPoint.</p>
<p>**Q: Pourquoi PowerPoint indique-t-il que mon fichier PPTX modifié manuellement nécessite une réparation ?</p>
<p><strong>A2:</strong> Cela se produit généralement si vous avez introduit du XML malformé, omis un nouvel actif de <code>[Content_Types].xml</code>, ou laissé une référence en suspens dans un fichier <code>.rels</code> associé.</p>
<p>**Q: Quelle unité de mesure PowerPoint utilise-t-il pour les positions et les marges des formes ?</p>
<p><strong>A3:</strong> PowerPoint utilise les English Metric Units (EMUs), où 1 pouce équivaut à 914 400 EMUs et 1 point à 12 700 EMUs.</p>
<p>**Q: Comment puis-je <a href="https://products.fileformat.com/presentation/python/python-pptx/">extraire de manière programmatique</a> toutes les images d’une présentation sans bibliothèques externes ?</p>
<p><strong>A4:</strong> Il suffit d’ouvrir le fichier <code>.pptx</code> avec n’importe quel utilitaire zip standard et d’extraire tous les fichiers binaires situés dans le répertoire <code>ppt/media/</code>.</p>
<p>**Q: Est-il sûr d’analyser les fichiers PPTX téléchargés par les utilisateurs avec des analyseurs XML standard ?</p>
<p><strong>A5:</strong> Non, vous devez renforcer votre analyseur ou utiliser des enveloppes sécurisées comme <code>defusedxml</code> pour bloquer les attaques XML External Entity (XXE) et les bombes zip.</p>
<h2 id="voir-aussi">Voir aussi</h2>
<ul>
<li><a href="https://blog.fileformat.com/presentation/powerpoint-file-formats/">Formats de fichiers de présentation sur FileFormat.com ?</a></li>
<li><a href="https://blog.fileformat.com/presentation/apache-poi-api-to-access-powerpoint-file-formats/">API Java pour accéder aux formats de fichiers PowerPoint</a></li>
<li><a href="https://blog.fileformat.com/presentation/odp-vs-pptx-opendocument-vs-microsoft-powerpoint-format-comparison/">ODP vs PPTX : Comparaison du format de présentation OpenDocument vs Microsoft PowerPoint</a></li>
<li><a href="https://blog.fileformat.com/presentation/difference-between-ppt-and-pptx/">Différence entre PPT et PPTX</a></li>
<li><a href="https://blog.fileformat.com/presentation/create-presentation-in-java-with-apache-poi-api/">Créer une présentation PowerPoint en Java avec l&rsquo;API Apache POI</a></li>
</ul>
<!-- raw HTML omitted -->
]]></content:encoded>
    </item>
    
  </channel>
</rss>
