<section id="static_analysis">
    {% if report.analysis.static %}
        <div class="row">
            {% if report.analysis.static.pe_timestamp %}
                <div class="col-md-3">
                    <h4> PE Compile Time</h4>
                    <pre>{{report.analysis.static.pe_timestamp}}</pre>
                </div>
            {% endif %}

            {% if report.analysis.static.pdb_path %}
                <div class="col-md-6">
                    <h4>PDB Path</h4>
                    <pre>{{report.analysis.static.pdb_path}}</pre>
                </div>
            {% endif %}

            {% if report.analysis.static.pe_imphash %}
                <div class="col-md-3">
                    <h4>PE Imphash</h4>
                    <pre>{{report.analysis.static.pe_imphash}}</pre>
                </div>
            {% endif %}
        </div>

        <br>

        {% if report.analysis.static.signature %}
        <div>
            <h4>Signing Certificate</h4>
            <div id="pe_signature">
                {% for cert in report.analysis.static.signature %}
                <table class="table table-striped table-bordered">
                    <colgroup>
                        <col width="150" />
                        <col width="*" />
                    </colgroup>
                    <tr>
                        <th>MD5</th>
                        <td>{{cert.md5}}</td>
                    </tr>
                    <tr>
                        <th>SHA1</th>
                        <td>{{cert.sha1}}</td>
                    </tr>
                    <tr>
                        <th>Serial Number</th>
                        <td>{{cert.serial_number}}</td>
                    </tr>
                    <tr>
                        <th>Common Name</th>
                        <td>{{cert.common_name}}</td>
                    </tr>
                    <tr>
                        <th>Country</th>
                        <td>{{cert.country}}</td>
                    </tr>
                    <tr>
                        <th>Locality</th>
                        <td>{{cert.locality}}</td>
                    </tr>
                </table>
                {% endfor %}
            </div>
        </div>
        <br>
        {% endif %}

        {% if report.analysis.static.pe_versioninfo %}
        <div class="panel panel-default">
            <div class="panel-heading" style="height: 40px;">
                <h4 class="panel-title">
                    Version Infos
                </h4>
            </div>

            <style>
                #pe_versioninfo tr>th:first-child{
                    max-width:100px;
                }
            </style>
            <table id="pe_versioninfo" class="table table-striped">
                {% for info in report.analysis.static.pe_versioninfo %}
                <tr>
                    <th class="text-right">{{info.name}}</th>
                    <td><span class="mono">{{info.value}}</span></td>
                </tr>
                {% endfor %}
            </table>
        </div>
        {% endif %}

        {% if report.analysis.static.peid_signatures %}
        <div>
            <h4>PEiD Signatures</h4>
            <div id="peid_signatures">
                <table class="table table-striped table-bordered">
                {% for sig in report.analysis.static.peid_signatures %}
                    <tr><td>{{sig}}</td></tr>
                {% endfor %}
                </table>
            </div>
        </div>
        <br>
        {% endif %}

        {% if report.analysis.static.pe_sections %}
        <div>
            <h4>Sections</h4>
            <div id="pe_sections">
                <table class="table table-striped table-bordered">
                    <tr>
                        <th>Name</th>
                        <th>Virtual Address</th>
                        <th>Virtual Size</th>
                        <th>Size of Raw Data</th>
                        <th>Entropy</th>
                    </tr>

                    {% for section in report.analysis.static.pe_sections %}
                        <tr>
                            <td>{{section.name}}</td>
                            <td class="hex_address">{{section.virtual_address}}</td>
                            <td class="hex_address">{{section.virtual_size}}</td>
                            <td class="hex_address">{{section.size_of_data}}</td>
                            <td>{{section.entropy}}</td>
                        </tr>
                    {% endfor %}
                </table>
            </div>
        </div>
        <br>
        {% endif %}

        {% if report.analysis.static.pe_resources %}
        <div>
            <h4>Resources</h4>
            <div id="pe_resources">
                <table class="table table-striped table-bordered">
                    <tr>
                        <th>Name</th>
                        <th>Offset</th>
                        <th>Size</th>
                        <th>Language</th>
                        <th>Sub-language</th>
                        <th>File type</th>
                    </tr>
                    {% for section in report.analysis.static.pe_resources %}
                        <tr>
                            <td>{{section.name}}</td>
                            <td class="hex_address">{{section.offset}}</td>
                            <td class="hex_address">{{section.size}}</td>
                            <td>{{section.language}}</td>
                            <td>{{section.sublanguage}}</td>
                            <td>{{section.filetype}}</td>
                        </tr>
                    {% endfor %}
                </table>
            </div>
        </div>
        <br>
        {% endif %}

        {% if report.analysis.static.pe_imports %}
        <div class="row">
            <h4>Imports</h4>
            <div id="pe_imports">
                {% for library in report.analysis.static.pe_imports %}
                    <div class="col-md-3">
                        <div class="well">
                            <div style="padding-bottom:6px;">
                                <strong>Library {{library.dll}}</strong>:
                            </div>
                            {% for function in library.imports %}
                                <div>&bull; <span class="mono">{{function.address}} <a href="http://social.msdn.microsoft.com/Search/en-US/windows/desktop?query={{function.name}}">{{function.name}}</a></span></div>
                            {% endfor %}
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
        <hr />
        {% endif %}

        {% if report.analysis.static.pe_exports %}
            <div>
                <h4>Exports</h4>
                <div id="pe_exports">
                    <table class="table table-striped table-bordered">
                        <tr>
                            <th>Ordinal</th>
                            <th>Address</th>
                            <th>Name</th>
                        </tr>
                        {% for export in report.analysis.static.pe_exports %}
                            <tr>
                                <td>{{export.ordinal}}</td>
                                <td>{{export.address}}</td>
                                <td>{{export.name}}</td>
                            </tr>
                        {% endfor %}
                    </table>
                </div>
            </div>
        {% endif %}
    {% else %}
        Nothing to display.
    {% endif %}
</section>
