Add region selection and command generation features

This commit is contained in:
√(noham)²
2026-01-25 12:05:11 +01:00
parent ad9a07dafb
commit 3f54439ad8
4 changed files with 188 additions and 6 deletions

View File

@@ -64,7 +64,7 @@
class="w-full h-48 p-4 font-mono text-xs bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-all resize-y text-slate-800 dark:text-slate-200"
placeholder="[0x0000000100000000-0x0000000100004000) r-x __TEXT..."></textarea>
<div class="mt-4 flex gap-3">
<div class="mt-4 flex gap-3 flex-wrap">
<button onclick="parseMemory()"
class="flex items-center gap-2 bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-2.5 rounded-lg font-medium transition shadow-sm active:transform active:scale-95">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"
@@ -76,6 +76,16 @@
</svg>
Parse Memory
</button>
<button onclick="generateCommands()" id="generate-btn"
class="flex items-center gap-2 bg-emerald-600 hover:bg-emerald-700 text-white px-6 py-2.5 rounded-lg font-medium transition shadow-sm active:transform active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed"
disabled>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
Generate Commands
</button>
<button onclick="clearAll()"
class="flex items-center gap-2 bg-white dark:bg-slate-700 border border-slate-300 dark:border-slate-600 hover:bg-slate-50 dark:hover:bg-slate-600 text-slate-700 dark:text-slate-200 px-6 py-2.5 rounded-lg font-medium transition shadow-sm">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"
@@ -134,11 +144,41 @@
</label>
</div>
<!-- Command Output Section -->
<div id="command-output"
class="hidden p-6 bg-slate-50 dark:bg-slate-800/50 border-b border-slate-100 dark:border-slate-700">
<div class="flex items-center justify-between mb-3">
<h3 class="text-sm font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-indigo-500" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
Generated Commands (<span id="selected-count">0</span> selected)
</h3>
<button onclick="copyCommands(event)"
class="flex items-center gap-2 bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg font-medium transition shadow-sm text-sm">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
</svg>
Copy All
</button>
</div>
<pre id="commands-text"
class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-600 rounded-lg p-4 text-xs font-mono text-slate-800 dark:text-slate-200 overflow-x-auto custom-scrollbar max-h-64"></pre>
</div>
<!-- Table -->
<div class="overflow-x-auto custom-scrollbar">
<table class="min-w-full divide-y divide-slate-200 dark:divide-slate-700">
<thead class="bg-slate-50 dark:bg-slate-800 sticky top-0 z-10">
<tr>
<th scope="col" class="px-6 py-3 text-left">
<input type="checkbox" id="select-all" onchange="toggleSelectAll()"
class="rounded text-indigo-600 focus:ring-indigo-500 cursor-pointer">
</th>
<th scope="col"
class="px-6 py-3 text-left text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-wider cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700 group"
onclick="sortBy('start')">
@@ -181,7 +221,7 @@
class="bg-white dark:bg-slate-800 divide-y divide-slate-200 dark:divide-slate-700">
<!-- Content injected by JS -->
<tr class="text-center text-slate-400">
<td colspan="6" class="py-12">Waiting for input...</td>
<td colspan="7" class="py-12">Waiting for input...</td>
</tr>
</tbody>
</table>