Skip to content

hgxszhj/https-github.com-zhaoxuya520-reverse-skill / skills/ida-reverse

ida-reverse

Verified

IDA Pro 逆向分析辅助技能。当用户提到逆向、反编译、分析二进制/PE/ELF/APK/DLL/SO、破解、找密码、漏洞分析、病毒分析、firmware 固件分析,或需要分析 exe/dll/so/elf/macho/sys 等文件时,务必使用此技能。 Ensure to use this skill when the user wants to analyze any binary file, regardless of whether they explicitly mention "IDA" or "reverse engineering". This includes requests like "看看这个exe", "分析这个dll", "帮我破解", "找一下密码", "这个软件怎么注册", etc. Use the bundled scripts (scripts/start.ps1, scripts/open.ps1) for deterministic server management and file opening — do NOT write ad-hoc PowerShell commands for these operations.

FileKindSize
LOCAL-SETUP.mdmarkdown3.3 KB
SKILL.mdskill md19.6 KB
references/ida-mcp-cheatsheet.mdmarkdown11.0 KB
scripts/IdaOpenHelpers.ps1script3.7 KB
scripts/install-autostart.ps1script2.4 KB
scripts/open.ps1script12.9 KB
scripts/recover.ps1script458 B
scripts/run-supervisor.pyscript4.2 KB
scripts/start-gui.ps1script3.8 KB
scripts/start.ps1script18.4 KB
scripts/watchdog.ps1script4.6 KB

scripts/IdaOpenHelpers.ps1

View on GitHub
# Shared IDA open lock policy. Never delete .i64/.idb.
function Get-IdaOpenLockPlan {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$BinaryPath
    )
    $dir = [System.IO.Path]::GetDirectoryName($BinaryPath)
    $base = [System.IO.Path]::GetFileNameWithoutExtension($BinaryPath)
    $lockExts = @('.id0', '.id1', '.id2', '.nam', '.til')
    $dbExts = @('.i64', '.idb')
    $hasLocked = $false
    foreach ($ext in $lockExts) {
        $f = Join-Path $dir ($base + $ext)
        if (Test-Path -LiteralPath $f) { $hasLocked = $true }
    }
    $hasDatabase = $false
    foreach ($ext in $dbExts) {
        $f = Join-Path $dir ($base + $ext)
        if (Test-Path -LiteralPath $f) { $hasDatabase = $true }
    }
    return [pscustomobject]@{
        HasLocked            = $hasLocked
        HasDatabase          = $hasDatabase
        WouldDeleteDatabase  = $false
        PreferTempCopy       = $hasLocked
    }
}

function Get-IdaMcpKeepaliveDir {
    $dir = Join-Path $env:LOCALAPPDATA 'reverse-skill\ida-mcp'
    if (-not (Test-Path -LiteralPath $dir)) {
        New-Item -ItemType Directory -Path $dir -Force | Out-Null
    }
    return $dir
}

function Get-IdaMcpLastHealthyPath {
    param([int]$Port = 13337)
    return Join-Path (Get-IdaMcpKeepaliveDir) ("last-healthy-{0}.txt" -f $Port)
}

function Get-IdaMcpOpeningLockPath {
    param([int]$Port = 13337)
    return Join-Path (Get-IdaMcpKeepaliveDir) ("opening-{0}.lock" -f $Port)
}

function Write-IdaMcpLastHealthy {
    param([int]$Port = 13337)
    Set-Content -LiteralPath (Get-IdaMcpLastHealthyPath -Port $Port) -Value 'ok' -Encoding ASCII
}

function Read-IdaMcpLastHealthy {
    param([int]$Port = 13337)
    $path = Get-IdaMcpLastHealthyPath -Port $Port
    if (-not (Test-Path -LiteralPath $path)) { return $null }
    return (Get-Item -LiteralPath $path).LastWriteTime
}

function Set-IdaMcpOpeningLock {
    param(
        [int]$Port = 13337,
        [int]$TtlSeconds = 600
    )
    $ttl = [Math]::Max(1, $TtlSeconds)
    $until = (Get-Date).AddSeconds($ttl).ToString('o')
    Set-Content -LiteralPath (Get-IdaMcpOpeningLockPath -Port $Port) -Value $until -Encoding ASCII
}

function Clear-IdaMcpOpeningLock {
    param([int]$Port = 13337)
    $path = Get-IdaMcpOpeningLockPath -Port $Port
    if (Test-Path -LiteralPath $path) {
        Remove-Item -LiteralPath $path -Force -ErrorAction SilentlyContinue
    }
}

function Test-IdaMcpOpeningInFlight {
    param(
        [int]$Port = 13337,
        [datetime]$Now = (Get-Date)
    )
    $path = Get-IdaMcpOpeningLockPath -Port $Port
    if (-not (Test-Path -LiteralPath $path)) { return $false }
    $raw = (Get-Content -LiteralPath $path -Raw -ErrorAction SilentlyContinue)
    if ([string]::IsNullOrWhiteSpace($raw)) {
        Remove-Item -LiteralPath $path -Force -ErrorAction SilentlyContinue
        return $false
    }
    try {
        $until = [datetime]::Parse($raw.Trim(), $null, [System.Globalization.DateTimeStyles]::RoundtripKind)
    } catch {
        Remove-Item -LiteralPath $path -Force -ErrorAction SilentlyContinue
        return $false
    }
    if ($Now -gt $until) {
        Remove-Item -LiteralPath $path -Force -ErrorAction SilentlyContinue
        return $false
    }
    return $true
}

function Test-IdaMcpKeepaliveDeadlockFromFacts {
    param(
        [bool]$GuiOwnsPort = $false,
        [bool]$OpeningInFlight = $false,
        $LastHealthy = $null,
        [datetime]$Now = (Get-Date),
        [int]$MaxUnhealthySeconds = 180
    )
    if ($GuiOwnsPort) { return $false }
    if ($OpeningInFlight) { return $false }
    if ($null -eq $LastHealthy) { return $false }
    return ($Now - [datetime]$LastHealthy).TotalSeconds -ge $MaxUnhealthySeconds
}
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: 467kUpdated Claude CodeCodexVerifiedInstall
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: 467kUpdated Claude CodeCodexVerifiedInstall
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: 319kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 319kUpdated Claude CodeCodexVerifiedInstall