Ghidra is a software reverse engineering (SRE) framework
Added buildDecompilerHelpPdf task
caheckman6eb71cd62068
diff --git a/Ghidra/Features/Decompiler/build.gradle b/Ghidra/Features/Decompiler/build.gradleindex d3725115d5..e364c706a7 100644--- a/Ghidra/Features/Decompiler/build.gradle+++ b/Ghidra/Features/Decompiler/build.gradle@@ -87,8 +87,8 @@ task buildDecompilerHelpHtml(type: Exec) {which xsltprocwhich sed- echo '** Removing older html files installed under '$installPoint' **'- rm -f $installPoint/topics/DecompilePlugin/*.html+ echo '** Removing older html files installed under '$installHelpPoint' **'+ rm -f $installHelpPoint/topics/DecompilePlugin/*.htmlecho '** Building html files **'xsltproc --output $buildDir/decomp_noscaling.xml --stringparam profile.condition "noscaling" /usr/share/sgml/docbook/xsl-stylesheets/profiling/profile.xsl decompileplugin.xml 2>&1@@ -125,6 +125,61 @@ task buildDecompilerHelpHtml(type: Exec) {}}+task buildDecompilerHelpPdf(type: Exec) {+ // Check the OS before enabling task.+ if (!(org.gradle.internal.os.OperatingSystem.current().isLinux()+ || org.gradle.internal.os.OperatingSystem.current().isMacOsX())) {+ it.enabled = false+ }++ workingDir 'src/main/doc'++ // 'which' returns the number of failed arguments+ // Using 'which' first will allow the entire command to fail if the required+ // executables are not installed.+ //+ // The bash commands end with "2>&1" to redirect stderr to stdout and have all+ // messages print in sequence+ //+ // 'commandLine' takes one command, so wrap multiple commands in bash.+ commandLine 'bash', '-e', '-c', """+ echo '** Checking if required executables are installed. **'+ which fop 2>&1+ which xsltproc 2>&1+ rm -f decompileplugin.fo decompileplugin.pdf 2>&1+ rm -rf ./images 2>&1+ mkdir -p ./images 2>&1+ cp $installHelpPoint/topics/DecompilePlugin/images/*.png ./images 2>&1+ cp $installHelpPoint/topics/DecompilePlugin/images/*.gif ./images 2>&1+ cp $installHelpPoint/shared/*.png ./images 2>&1++ echo '** Building decompileplugin.fo **'+ xsltproc --output ./decompileplugin.fo decompileplugin_pdf.xsl decompileplugin.xml 2>&1++ echo '** Building decompileplugin.pdf **'+ fop decompileplugin.fo decompileplugin.pdf 2>&1++ echo '** Done. **'+ """++ // Allows doLast block regardless of exit value. Task does not fail if bash command fails.+ ignoreExitValue true++ // Store the output instead of printing to the console.+ standardOutput = new ByteArrayOutputStream()+ ext.output = { standardOutput.toString() }+ ext.errorOutput = { standardOutput.toString() }++ // Print the output of the commands and check the return value.+ doLast {+ println output()+ if (execResult.exitValue) {+ println "$it.name: An error occurred with this task. Here is the output:\n" + output()+ println "Skipping task $it.name\n"+ }+ }+}+/*** Build the pdfs docs for the decompiler and place them in the '$buildDir' directory.* A build (ex: 'gradle buildGhidra') will place the pdfs in the distribution zip file.diff --git a/Ghidra/Features/Decompiler/certification.manifest b/Ghidra/Features/Decompiler/certification.manifestindex bfb6006c00..115209e2e9 100644--- a/Ghidra/Features/Decompiler/certification.manifest+++ b/Ghidra/Features/Decompiler/certification.manifest@@ -11,12 +11,12 @@ src/decompile/build.gradle||GHIDRA||||END|src/decompile/cpp/.gitignore||GHIDRA||||END|src/decompile/cpp/Doxyfile||GHIDRA|||Most of this file is autogenerated by doxygen which falls under the GPL - output from GPL products are NOT GPL! - mjbell4|END|src/decompile/cpp/Makefile||GHIDRA||||END|-src/main/doc/Makefile||GHIDRA|exclude|||END|src/main/doc/cspec.xml||GHIDRA|exclude|||END|src/main/doc/cspec_html.xsl||GHIDRA|exclude|||END|src/main/doc/decompileplugin.xml||GHIDRA|exclude|||END|src/main/doc/decompileplugin_common.xsl||GHIDRA|exclude|||END|src/main/doc/decompileplugin_html.xsl||GHIDRA|exclude|||END|+src/main/doc/decompileplugin_pdf.xsl||GHIDRA|exclude|||END|src/main/doc/main.xml||GHIDRA|exclude|reviewed||END|src/main/doc/main_html.xsl||GHIDRA|exclude|reviewed||END|src/main/doc/pcoderef.xml||GHIDRA|exclude|||END|@@ -38,19 +38,15 @@ src/main/help/help/shared/redo.png||GHIDRA||||END|src/main/help/help/shared/tip.png||Oxygen Icons - LGPL 3.0||||END|src/main/help/help/shared/undo.png||GHIDRA||||END|src/main/help/help/shared/warning.png||Oxygen Icons - LGPL 3.0||||END|-src/main/help/help/topics/DecompilePlugin/Decompiler.html||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/DecompilerConcepts.html||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/DecompilerIntro.html||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/DecompilerOptions.html||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/DecompilerWindow.html||GHIDRA||||END|-src/main/help/help/topics/DecompilePlugin/images/BackwardSlice.png||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/images/DecompWindow.png||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/images/Defuse.png||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/images/EditFunctionSignature.png||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/images/ForwardSlice.png||GHIDRA||||END|-src/main/help/help/topics/DecompilePlugin/images/StructApplied.png||GHIDRA||reviewed||END|-src/main/help/help/topics/DecompilePlugin/images/Structnotapplied.png||GHIDRA||||END|src/main/help/help/topics/DecompilePlugin/images/camera-photo.png||Tango Icons - Public Domain|||Tango|END|src/main/help/help/topics/DecompilePlugin/images/decompileFunction.gif||GHIDRA||reviewed||END|src/main/help/help/topics/DecompilePlugin/images/page_edit.png||FAMFAMFAM Icons - CC 2.5||||END|diff --git a/Ghidra/Features/Decompiler/src/main/doc/Frontpage.css b/Ghidra/Features/Decompiler/src/main/doc/Frontpage.cssdeleted file mode 100644index b8471669f4..0000000000--- a/Ghidra/Features/Decompiler/src/main/doc/Frontpage.css+++ /dev/null@@ -1,64 +0,0 @@-/* ###- * IP: GHIDRA- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */-/*- WARNING!- This file is copied to all help directories. If you change this file, you must copy it- to each src/main/help/help/shared directory.--- Java Help Note: JavaHelp does not accept sizes (like in 'margin-top') in anything but- px (pixel) or with no type marking.--*/--body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 10px; } /* some padding to improve readability */-li { font-family:times new roman; font-size:14pt; }-h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }-h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }-h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }--/*- P tag code. Most of the help files nest P tags inside of blockquote tags (the was the- way it had been done in the beginning). The net effect is that the text is indented. In- modern HTML we would use CSS to do this. We need to support the Ghidra P tags, nested in- blockquote tags, as well as naked P tags. The following two lines accomplish this. Note- that the 'blockquote p' definition will inherit from the first 'p' definition.-*/-p { margin-left: 40px; font-family:times new roman; font-size:14pt; }-blockquote p { margin-left: 10px; }--p.providedbyplugin { color:#7f7f7f; margin-left: 10px; font-size:14pt; margin-top:100px }-p.ProvidedByPlugin { color:#7f7f7f; margin-left: 10px; font-size:14pt; margin-top:100px }-p.relatedtopic { color:#800080; margin-left: 10px; font-size:14pt; }-p.RelatedTopic { color:#800080; margin-left: 10px; font-size:14pt; }--/*- We wish for a tables to have space between it and the preceding element, so that text- is not too close to the top of the table. Also, nest the table a bit so that it is clear- the table relates to the preceding text.-*/-table { margin-left: 20px; margin-top: 10px; width: 80%;}-td { font-family:times new roman; font-size:14pt; vertical-align: top; }-th { font-family:times new roman; font-size:14pt; font-weight:bold; background-color: #EDF3FE; }--/*- Code-like formatting for things such as file system paths and proper names of classes,- methods, etc. To apply this to a file path, use this syntax:- <CODE CLASS="path">...</CODE>-*/-code { color: black; font-weight: bold; font-family: courier new, monospace; font-size: 14pt; white-space: nowrap; }-code.path { color: #4682B4; font-weight: bold; font-family: courier new, monospace; font-size: 14pt; white-space: nowrap; }diff --git a/Ghidra/Features/Decompiler/src/main/doc/Makefile b/Ghidra/Features/Decompiler/src/main/doc/Makefiledeleted file mode 100644index 9912fd43a6..0000000000--- a/Ghidra/Features/Decompiler/src/main/doc/Makefile+++ /dev/null@@ -1,20 +0,0 @@--BUILDDIR=html--Decompiler.html: decompileplugin.xml- rm -rf ${BUILDDIR}- mkdir ${BUILDDIR}- mkdir ${BUILDDIR}/images- cp ../../../src/main/help/help/shared/Frontpage.css ${BUILDDIR}- cp ../../../src/main/help/help/shared/languages.css ${BUILDDIR}- cp ../../../src/main/help/help/topics/DecompilePlugin/images/DecompWindow.png ${BUILDDIR}/images- cp ../../../src/main/help/help/topics/DecompilePlugin/images/EditFunctionSignature.png ${BUILDDIR}/images- cp ../../../src/main/help/help/topics/DecompilePlugin/images/ForwardSlice.png ${BUILDDIR}/images- cp ../../../src/main/help/help/topics/DecompilePlugin/images/decompileFunction.gif ${BUILDDIR}/images- cp ../../../src/main/help/help/topics/DecompilePlugin/images/page_edit.png ${BUILDDIR}/images- cp ../../../../Base/src/main/help/help/topics/Snapshots/images/camera-photo.png ${BUILDDIR}/images- cp ../../../../Base/src/main/help/help/topics/ClipboardPlugin/images/page_white_copy.png ${BUILDDIR}/images- cp ../../../../../Framework/Generic/src/main/resources/images/reload3.png ${BUILDDIR}/images- cp ../../../src/main/help/help/shared/note.png ${BUILDDIR}/images- xsltproc --stringparam base.dir ${BUILDDIR} --stringparam root.filename Decompiler decompileplugin_html.xsl decompileplugin.xml- sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' ${BUILDDIR}/*.htmldiff --git a/Ghidra/Features/Decompiler/src/main/doc/decompileplugin.xml b/Ghidra/Features/Decompiler/src/main/doc/decompileplugin.xmlindex dd328c7f7a..d0c32b5122 100644--- a/Ghidra/Features/Decompiler/src/main/doc/decompileplugin.xml+++ b/Ghidra/Features/Decompiler/src/main/doc/decompileplugin.xml@@ -76,7 +76,7 @@Some of the primary capabilities of the decompiler include:<informalexample>- <itemizedlist mark='bullet' spacing='compact'>+ <itemizedlist mark='bullet'><listitem><emphasis role="bold">Recovers Expressions</emphasis>: Thedecompiler does full data-flow analysis which allows it to@@ -154,7 +154,7 @@For a specific byte, the unique index that labels it is called the byte's <emphasis role="bold">address</emphasis>.Each address space has a:<informalexample>- <itemizedlist mark='bullet' spacing='compact'>+ <itemizedlist mark='bullet'><listitem><emphasis role="bold">name</emphasis> - a formal name for the space</listitem>@@ -260,7 +260,7 @@varnodes inherit one the building block data-types from the p-code operations thatact on them:<informalexample>- <itemizedlist mark='bullet' spacing='compact'>+ <itemizedlist mark='bullet'><listitem><emphasis role="bold">Integer</emphasis></listitem>@@ -2799,7 +2799,7 @@high-level programming language. The output is tokenized following conventions of the language. Possibletoken types include:<informalexample>- <itemizedlist mark='bullet' spacing='compact'>+ <itemizedlist mark='bullet'><listitem><emphasis role="bold">Data-type Name</emphasis></listitem><listitem><emphasis role="bold">Variable Name</emphasis></listitem><listitem><emphasis role="bold">Variable Sub-field Name</emphasis></listitem>diff --git a/Ghidra/Features/Decompiler/src/main/doc/decompileplugin_pdf.xsl b/Ghidra/Features/Decompiler/src/main/doc/decompileplugin_pdf.xslnew file mode 100644index 0000000000..950cee1977--- /dev/null+++ b/Ghidra/Features/Decompiler/src/main/doc/decompileplugin_pdf.xsl@@ -0,0 +1,21 @@+<?xml version='1.0'?>+<xsl:stylesheet+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">++<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl"/>++<xsl:include href="decompileplugin_common.xsl" />++<xsl:param name="fop1.extensions" select="1"/> <!-- Use fop extensions when converting to pdf -->++<xsl:param name="alignment" select="'left'"/> <!-- Justify normal text (only) on the left -->++<xsl:param name="draft.mode" select="'no'"/> <!-- Turn off the draft background watermark -->++<xsl:param name="admon.graphics" select="1"/> <!-- Turn on graphic icon for important/note tags -->++<xsl:param name="admon.textlabel" select="0"/> <!-- Don't display title for important/note tags -->++<xsl:param name="admon.graphics.path" select="'./images/'"/>++</xsl:stylesheet>diff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerConcepts.html b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerConcepts.htmlindex e3ca5715c0..ebfdf92d5f 100644--- a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerConcepts.html+++ b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerConcepts.html@@ -37,7 +37,7 @@Each address space has a:</p><div class="informalexample">- <div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: bullet; ">+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: bullet; "><li class="listitem" style="list-style-type: disc"><span class="bold"><strong>name</strong></span> - a formal name for the space</li>@@ -140,7 +140,7 @@act on them:</p><div class="informalexample">- <div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: bullet; ">+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: bullet; "><li class="listitem" style="list-style-type: disc"><span class="bold"><strong>Integer</strong></span></li>diff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerIntro.html b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerIntro.htmlindex 0e81f563c4..f7e3eadb4f 100644--- a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerIntro.html+++ b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerIntro.html@@ -93,7 +93,7 @@</p><div class="informalexample">- <div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: bullet; ">+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: bullet; "><li class="listitem" style="list-style-type: disc"><span class="bold"><strong>Recovers Expressions</strong></span>: Thedecompiler does full data-flow analysis which allows it todiff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerWindow.html b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerWindow.htmlindex e9e316855a..cc64a836b5 100644--- a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerWindow.html+++ b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerWindow.html@@ -52,7 +52,7 @@token types include:</p><div class="informalexample">- <div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: bullet; ">+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: bullet; "><li class="listitem" style="list-style-type: disc"><span class="bold"><strong>Data-type Name</strong></span></li><li class="listitem" style="list-style-type: disc"><span class="bold"><strong>Variable Name</strong></span></li><li class="listitem" style="list-style-type: disc"><span class="bold"><strong>Variable Sub-field Name</strong></span></li>diff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/BackwardSlice.png b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/BackwardSlice.pngdeleted file mode 100644index 5a9317fbff..0000000000Binary files a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/BackwardSlice.png and /dev/null differdiff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/StructApplied.png b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/StructApplied.pngdeleted file mode 100644index 905d94f98e..0000000000Binary files a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/StructApplied.png and /dev/null differdiff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/Structnotapplied.png b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/Structnotapplied.pngdeleted file mode 100644index 3fe6bd7273..0000000000Binary files a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/images/Structnotapplied.png and /dev/null differ