hgxszhj/https-github.com-zhaoxuya520-reverse-skill / skills/radare2
radare2
VerifiedUse this skill whenever the user wants to analyze binaries with radare2/r2 from the command line, including reverse engineering, disassembly, function analysis, strings/import inspection, patching, binary diffing, hex inspection, or r2 scripting. Also use it when the user mentions PE/ELF/Mach-O/DEX/WASM files together with CLI analysis, `rabin2`, `rasm2`, `radiff2`, `r2pipe`, or asks for radare2 command help on Windows/Linux/macOS.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 14.1 KB |
| references/cheatsheet.md | markdown | 1.6 KB |
| scripts/recon.ps1 | script | 2.6 KB |
| scripts/recon.sh | script | 2.9 KB |
scripts/recon.ps1
View on GitHubparam(
[Parameter(Mandatory = $true)]
[string]$TargetPath,
[int]$StringsLimit = 40,
[int]$ImportsLimit = 80,
[switch]$RunAnalysis
)
# 强制当前脚本使用 UTF-8 输出,尽量减少中文标题乱码。
[Console]::InputEncoding = [System.Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot '..\..\scripts\lib\ToolDiscovery.ps1')
$bootstrapScript = Join-Path $PSScriptRoot '..\..\scripts\bootstrap-reverse.ps1'
function Get-RequiredToolSpec {
param(
[Parameter(Mandatory = $true)]
[string]$Name
)
$spec = Resolve-ReverseToolSpec -Name $Name
if (-not $spec.Available) {
# Attempt auto-bootstrap
if (Test-Path -LiteralPath $bootstrapScript) {
Write-Output "INFO: $Name not found, attempting auto-bootstrap..."
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $bootstrapScript -Capability @($Name) -SkipRefresh
$spec = Resolve-ReverseToolSpec -Name $Name
}
if (-not $spec.Available) {
throw "缺少命令:$Name — 自动安装失败,请手动安装。参考: https://github.com/radareorg/radare2"
}
}
return $spec
}
function Write-Section {
param(
[Parameter(Mandatory = $true)]
[string]$Title
)
# 用固定分段标题,方便人看,也方便后续 grep。
""
"=== $Title ==="
}
$rabin2 = Get-RequiredToolSpec -Name 'rabin2'
$r2 = $null
if ($RunAnalysis) {
$r2 = Get-RequiredToolSpec -Name 'r2'
}
# 将输入路径规范化成绝对路径,避免 r2/rabin2 在相对路径下歧义解析。
$resolvedPath = Resolve-Path -LiteralPath $TargetPath
$target = $resolvedPath.Path
"目标文件: $target"
Write-Section -Title '基本信息'
& $rabin2.Command @($rabin2.PrefixArgs + @('-I', '--', $target))
Write-Section -Title '节区'
& $rabin2.Command @($rabin2.PrefixArgs + @('-S', '--', $target))
Write-Section -Title '导入'
& $rabin2.Command @($rabin2.PrefixArgs + @('-i', '--', $target)) | Select-Object -First $ImportsLimit
Write-Section -Title '导出'
& $rabin2.Command @($rabin2.PrefixArgs + @('-E', '--', $target))
Write-Section -Title '字符串'
& $rabin2.Command @($rabin2.PrefixArgs + @('-zz', '--', $target)) | Select-Object -First $StringsLimit
if ($RunAnalysis) {
Write-Section -Title '函数与入口分析'
& $r2.Command @($r2.PrefixArgs + @('-A', '-q', '-c', 's entry0;afl;iz;ii;q', '--', $target))
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |