mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2025-07-25 19:54:14 +02:00
First commit
This commit is contained in:
57
_includes/bin_table.html
Normal file
57
_includes/bin_table.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<input id="bin-search" type="text" placeholder="Filter by name, just start typing..."/>
|
||||
|
||||
<div id="bin-table-wrapper">
|
||||
<table id="bin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Binary</th>
|
||||
<th>Functions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for file in site.gtfobins %}
|
||||
<tr>
|
||||
<td><a href="{{ file.url }}" class="bin-name">{% include get_bin_name path=file.path %}</a></td>
|
||||
<td>{% include function_list.html bin=file %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><td id="search-message" colspan="2">No binary matches...</td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var searchBox = document.querySelector('#bin-search');
|
||||
var searchMessage = document.querySelector('#search-message');
|
||||
searchMessage.style.display = 'none';
|
||||
|
||||
// ensure height during filtering
|
||||
var binTableWrapper = document.querySelector('#bin-table-wrapper');
|
||||
binTableWrapper.style.height = binTableWrapper.clientHeight + 'px';
|
||||
|
||||
searchBox.addEventListener('input', function () {
|
||||
var query = searchBox.value.toLowerCase().trim();
|
||||
var noResults = true;
|
||||
|
||||
document.querySelectorAll('#bin-table tbody tr').forEach(function (row) {
|
||||
var binName = row.firstElementChild.firstElementChild.innerText;
|
||||
if (binName.indexOf(query) !== -1) {
|
||||
row.style.display = '';
|
||||
noResults = false;
|
||||
} else {
|
||||
row.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
searchMessage.style.display = noResults ? '' : 'none';
|
||||
});
|
||||
|
||||
addEventListener('keydown', function (event) {
|
||||
if (event.key.toLowerCase().match(/^[a-z]$/)) {
|
||||
searchBox.focus();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
6
_includes/function_list.html
Normal file
6
_includes/function_list.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<ul class="function-list">
|
||||
{% for function in include.bin.functions %}
|
||||
{% assign type = function[0] %}
|
||||
<li><a href="{{ include.bin.url }}#{{ type }}">{{ site.data.functions[type].label }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
7
_includes/functions_description.html
Normal file
7
_includes/functions_description.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<dl>
|
||||
{% for function_pair in site.data.functions %}
|
||||
{% assign function = function_pair[1] %}
|
||||
<dt class="function-name">{{ function.label }}</dt>
|
||||
<dd>{{ function.description | markdownify }}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
1
_includes/get_bin_name
Normal file
1
_includes/get_bin_name
Normal file
@@ -0,0 +1 @@
|
||||
{% assign fn_parts = include.path | split: '/' | last | split: '.' %}{% assign fn_parts_size = fn_parts | size %}{% if fn_parts_size < 3 %}{{- fn_parts[0] -}}{% else %}{{- fn_parts[0] -}}.{{- fn_parts[1] -}}{% endif %}
|
6
_includes/page_title.html
Normal file
6
_includes/page_title.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>
|
||||
{% if page.url != '/' %}
|
||||
<a href="/">..</a> /
|
||||
{% endif %}
|
||||
{{ include.title }}
|
||||
</h1>
|
Reference in New Issue
Block a user