Add IDA-style asm display mode

This commit is contained in:
√(noham)²
2026-03-03 20:43:02 +01:00
parent 85e8e09249
commit 5e3598d8c4
3 changed files with 92 additions and 11 deletions

View File

@@ -5,10 +5,11 @@ A Hugo shortcode for displaying assembly code blocks with syntax highlighting, h
## Features
- **Syntax highlighting** for x86 (NASM) and ARM assembly
- **Three display modes:**
- **Four display modes:**
- `raw` - Assembly with syntax highlighting only
- `hex` - Hex bytes + assembly instruction
- `full` - Address + hex bytes + assembly instruction
- `ida` - IDA-style section:address + assembly instruction
- **Capitalization option** for hex bytes and addresses
- **Dark/light mode** compatible
@@ -70,11 +71,21 @@ syscall
{{</* /asm */>}}
```
### IDA Mode (IDA-style section:address + instruction)
```go-html-template
{{</* asm mode="ida" arch="x86" */>}}
__text:000000010045C182 | mov rdi, [rbp+var_88]
__text:000000010045C189 | call _RuntimeUnlockString
__text:000000010045C18E | mov [rbp+var_88], 0
{{</* /asm */>}}
```
### Parameters
| Parameter | Default | Description |
|--------------|---------|--------------------------------------------------|
| `mode` | `raw` | Display mode: `raw`, `hex`, or `full` |
| `mode` | `raw` | Display mode: `raw`, `hex`, `full`, or `ida` |
| `arch` | `x86` | Architecture: `x86` or `arm` |
| `capitalize` | `false` | Uppercase hex bytes and addresses when `true` |