{"id":295,"date":"2026-10-25T04:14:04","date_gmt":"2026-10-24T19:14:04","guid":{"rendered":"https:\/\/blog.himajin.ddo.jp\/?p=295"},"modified":"2026-10-25T04:14:04","modified_gmt":"2026-10-24T19:14:04","slug":"ghidra%e5%85%a5%e9%96%80%ef%bc%9a%e8%87%aa%e4%bd%9c%e3%81%aejava%e3%82%af%e3%83%a9%e3%82%b9%e3%82%92%e8%a7%a3%e6%9e%90%e3%81%97%e3%80%81%e6%88%bb%e3%82%8a%e5%80%a442%e3%81%ae%e6%a0%b9%e6%8b%a0","status":"publish","type":"post","link":"https:\/\/blog.himajin.ddo.jp\/?p=295","title":{"rendered":"Ghidra\u5165\u9580\uff1a\u81ea\u4f5c\u306eJava\u30af\u30e9\u30b9\u3092\u89e3\u6790\u3057\u3001\u623b\u308a\u502442\u306e\u6839\u62e0\u3092\u8aad\u3080"},"content":{"rendered":"\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u6e08\u307f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u3066\u3082\u3001\u6587\u5b57\u306e\u4e26\u3073\u3060\u3051\u3067\u306f\u51e6\u7406\u3092\u8ffd\u3044\u306b\u304f\u3044\u3053\u3068\u304c\u3042\u308b\u3067\u3002<a href=\"https:\/\/github.com\/NationalSecurityAgency\/ghidra\">Ghidra<\/a>\u306f\u3001\u9006\u30a2\u30bb\u30f3\u30d6\u30eb\u30fb\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u30fb\u53c2\u7167\u306e\u8abf\u67fb\u306a\u3069\u3092\u307e\u3068\u3081\u3066\u884c\u3046\u3001NSA\u304c\u516c\u958b\u3059\u308b\u89e3\u6790\u30c4\u30fc\u30eb\u3084\u3002\u4eca\u56de\u306f\u81ea\u5206\u3067\u4f5c\u3063\u305f\u5c0f\u3055\u306aJava\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u3001\u300c42\u3092\u8fd4\u3059\u300d\u3068\u3044\u3046\u51e6\u7406\u3092\u89e3\u6790\u7d50\u679c\u304b\u3089\u78ba\u304b\u3081\u308b\u3067\u3002<\/p><h2 id=\"goal-ghidra\">\u4eca\u56de\u306e\u30b4\u30fc\u30eb\u3068\u74b0\u5883<\/h2><p>Windows 11 x64\u3068PowerShell 7\u3067\u3001Ghidra 12.2\u3092\u753b\u9762\u306a\u3057\u306eHeadless\u30e2\u30fc\u30c9\u304b\u3089\u4f7f\u3046\u3067\u3002\u30b4\u30fc\u30eb\u306f\u3001\u81ea\u4f5c\u306e<code>Answer.class<\/code>\u3092\u9759\u7684\u306b\u89e3\u6790\u3057\u3001\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u7d50\u679c\u306e<code>return 0x2a;<\/code>\u3092\u5143\u30bd\u30fc\u30b9\u306e<code>return 42;<\/code>\u3068\u5bfe\u5fdc\u4ed8\u3051\u308b\u3053\u3068\u3084\u3002<strong>\u4eca\u56de\u306fJava\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u304c\u984c\u6750\u3067\u3001Windows\u306e\u30cd\u30a4\u30c6\u30a3\u30d6EXE\u3084\u3001\u5bfe\u8c61\u306e\u5b9f\u884c\u30fb\u30c7\u30d0\u30c3\u30b0\u306f\u6271\u308f\u3078\u3093\u3067\u3002<\/strong><\/p><p><strong>\u5b9f\u884c\u78ba\u8a8d\uff1a<\/strong>2026\u5e7410\u670825\u65e5\u3001Windows 11 x64\u30fbPowerShell 7.6.5\u30fbGhidra 12.2\u30fbTemurin JDK 25.0.4.1+1\u3067\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001Headless\u89e3\u6790\u3001\u4e0b\u8a18\u30b9\u30af\u30ea\u30d7\u30c8\u3001\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u7d50\u679c\u307e\u3067\u78ba\u8a8d\u3057\u305f\u3067\u3002OS\u304b\u3089\u306e\u65b0\u898f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084Ghidra\u306eGUI\u64cd\u4f5c\u3092\u4e00\u901a\u308a\u5b9f\u6e2c\u3057\u305f\u3068\u3044\u3046\u610f\u5473\u3084\u306a\u3044\u3067\u3002<\/p><p>\u5411\u3044\u3066\u308b\u306e\u306f\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u5f8c\u306e\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u65b9\u3092\u899a\u3048\u305f\u3044\u4eba\u3084\u3001\u81ea\u4f5c\u30bd\u30d5\u30c8\u306e\u8abf\u67fb\u624b\u9806\u3092\u5c0f\u3055\u304f\u8a66\u3057\u305f\u3044\u4eba\u3084\u3002AI\u306e\u5951\u7d04\u3084API\u30ad\u30fc\u306f\u8981\u3089\u3078\u3093\u3002\u672c\u4f53\u306e\u516c\u5f0f\u76ee\u5b89\u306fRAM 4GB\u30fbGhidra\u306e\u914d\u7f6e\u7528\u306b1GB\u3067\u3001JDK\u3084ZIP\u3092\u4fdd\u7ba1\u3059\u308b\u7a7a\u304d\u5bb9\u91cf\u306f\u5225\u306b\u5fc5\u8981\u3084\u3067\u3002<\/p><h2>1\uff0ePowerShell\u3068\u4f5c\u696d\u5834\u6240<\/h2><p>\u30b9\u30bf\u30fc\u30c8\u30e1\u30cb\u30e5\u30fc\u3067\u300cPowerShell 7\u300d\u3092\u958b\u3044\u3066\u306a\u3002\u307e\u3060\u306a\u3051\u308c\u3070\u3001\u7aef\u672b\u3067\u6b21\u3092\u5b9f\u884c\u3057\u3066\u304b\u3089PowerShell 7\u3092\u958b\u304d\u76f4\u3059\u3067\u3002<a href=\"https:\/\/learn.microsoft.com\/powershell\/scripting\/install\/installing-powershell-on-windows\">Microsoft\u306e\u5c0e\u5165\u6848\u5185<\/a>\u3082\u78ba\u8a8d\u3057\u3066\u306a\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>winget install --id Microsoft.PowerShell --source winget<\/code><\/pre><p>\u6b21\u3067\u7df4\u7fd2\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f5c\u308b\u3067\u3002<strong>\u4ee5\u964d\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u540c\u3058PowerShell 7\u306e\u753b\u9762\u3067\u9806\u756a\u306b\u5b9f\u884c\u3059\u308b<\/strong>\u3093\u3084\u3002<code>$ghidraWork<\/code>\u306a\u3069\u306e\u5909\u6570\u3082\u305d\u3053\u3067\u5f15\u304d\u7d99\u3050\u3067\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>$ghidraWork = Join-Path $env:USERPROFILE 'github-practice\\ghidra'\nNew-Item -ItemType Directory -Force $ghidraWork | Out-Null\nSet-Location $ghidraWork\n$PSVersionTable.PSVersion\nGet-Location<\/code><\/pre><p>\u4eca\u56de\u306f\u534a\u89d2\u82f1\u6570\u5b57\u3067\u7a7a\u767d\u306e\u306a\u3044\u30d1\u30b9\u3092\u4f7f\u3063\u3066\u78ba\u8a8d\u3057\u305f\u3067\u3002\u672c\u691c\u8a3c\u3067\u306f\u65e5\u672c\u8a9e\u3092\u542b\u3080\u914d\u7f6e\u5148\u304b\u3089\u30d0\u30c3\u30c1\u3092\u8d77\u52d5\u3067\u304d\u3078\u3093\u304b\u3063\u305f\u305f\u3081\u3001\u82f1\u6570\u5b57\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u3078\u7f6e\u3044\u3066\u78ba\u8a8d\u3057\u305f\u3093\u3084\u3002\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u65e5\u672c\u8a9e\u3084\u7a7a\u767d\u304c\u3042\u308b\u5834\u5408\u306f\u3001<code>$ghidraWork<\/code>\u3092\u81ea\u5206\u304c\u66f8\u304d\u8fbc\u3081\u308b\u82f1\u6570\u5b57\u306e\u5834\u6240\u3078\u5909\u66f4\u3057\u3066\u306a\u3002\u540c\u540d\u306e\u7df4\u7fd2\u30c7\u30fc\u30bf\u304c\u3042\u308b\u306a\u3089\u3001\u5225\u540d\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u3067\u59cb\u3081\u308b\u3067\u3002<\/p><h2>2\uff0eGhidra\u3068JDK\u306e\u6e96\u5099<\/h2><p>Ghidra 12.2\u3067\u306f<strong>64-bit\u306eJDK 25<\/strong>\u3092\u4f7f\u3046\u3067\u3002\u53e4\u3044Ghidra\u5411\u3051\u306e\u300cJDK 21\u300d\u306e\u6848\u5185\u3068\u6df7\u305c\u3078\u3093\u3088\u3046\u306b\u3057\u3066\u306a\u3002Ghidra\u306f\u516c\u5f0f\u306e\u914d\u5e03ZIP\u3092\u5c55\u958b\u3057\u3066\u4f7f\u3046\u3002Source code\u306eZIP\u3092\u4ee3\u308f\u308a\u306b\u53d6\u308b\u5fc5\u8981\u306f\u306a\u3044\u3067\u3002\u6b21\u306f\u7248\u3092\u56fa\u5b9a\u3057\u305f\u516c\u5f0f\u914d\u5e03\u30d5\u30a1\u30a4\u30eb\u306e\u53d6\u5f97\u3084\u3002\u901a\u4fe1\u91cf\u306fZIP\u3060\u3051\u3067Ghidra\u304c\u7d04570MB\u3001JDK\u304c\u7d04141MB\u306b\u306a\u308b\u3067\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>Invoke-WebRequest -Uri 'https:\/\/github.com\/NationalSecurityAgency\/ghidra\/releases\/download\/Ghidra_12.2_build\/ghidra_12.2_PUBLIC_20261016.zip' -OutFile ghidra.zip\nInvoke-WebRequest -Uri 'https:\/\/github.com\/adoptium\/temurin25-binaries\/releases\/download\/jdk-25.0.4.1%2B1\/OpenJDK25U-jdk_x64_windows_hotspot_25.0.4.1_1.zip' -OutFile jdk.zip<\/code><\/pre><p>\u53d6\u5f97\u5f8c\u306fSHA-256\u3092\u78ba\u8a8d\u3059\u308b\u3067\u3002\u9055\u3063\u3066\u3044\u305f\u3089\u5c55\u958b\u305b\u305a\u3001\u914d\u5e03\u5143\u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306e\u5b8c\u4e86\u3092\u78ba\u304b\u3081\u3066\u306a\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>if ((Get-FileHash .\\ghidra.zip -Algorithm SHA256).Hash.ToLower() -ne '2c2cd776db3c1f6a097ba418922378ac3649cadd5e844a6f5f088ae628a7be67') {\n  throw 'Ghidra ZIP\u306e\u30cf\u30c3\u30b7\u30e5\u304c\u4e00\u81f4\u3057\u3066\u3078\u3093\u3067\u3002'\n}\nif ((Get-FileHash .\\jdk.zip -Algorithm SHA256).Hash.ToLower() -ne '00c847d804f4a78e9f04f2683faf14fed898535b177b7fc704486cb0284e9283') {\n  throw 'JDK ZIP\u306e\u30cf\u30c3\u30b7\u30e5\u304c\u4e00\u81f4\u3057\u3066\u3078\u3093\u3067\u3002'\n}<\/code><\/pre><p>\u30a8\u30e9\u30fc\u304c\u306a\u3051\u308c\u3070\u3001\u6b21\u3067\u5c55\u958b\u3057\u3066\u4f7f\u3046\u5834\u6240\u3092\u8a2d\u5b9a\u3059\u308b\u3067\u3002\u65e2\u5b58\u306eGhidra\u306e\u4e0a\u3078\u91cd\u306d\u3066\u5c55\u958b\u305b\u305a\u3001\u3053\u306e\u7df4\u7fd2\u5c02\u7528\u306e\u65b0\u3057\u3044\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f7f\u3063\u3066\u306a\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>Expand-Archive -LiteralPath .\\ghidra.zip -DestinationPath .\\tools\nExpand-Archive -LiteralPath .\\jdk.zip -DestinationPath .\\tools\n$env:JAVA_HOME = (Resolve-Path '.\\tools\\jdk-25.0.4.1+1').Path\n$ghidraHome = (Resolve-Path '.\\tools\\ghidra_12.2_PUBLIC').Path\n$env:GHIDRA_HEADLESS_JAVA_OPTIONS = \"-Dapplication.settingsdir=$ghidraWork\\settings -Dapplication.cachedir=$ghidraWork\\cache\"\n&amp; \"$env:JAVA_HOME\\bin\\java.exe\" -version\n&amp; \"$env:JAVA_HOME\\bin\\javac.exe\" -version<\/code><\/pre><p>\u4e21\u65b9\u306b25\u7cfb\u306e\u7248\u304c\u8868\u793a\u3055\u308c\u305f\u3089\u3001\u3053\u306e\u7df4\u7fd2\u306eJDK\u304c\u4f7f\u3048\u3066\u308b\u3067\u3002Ghidra\u306e\u8a2d\u5b9a\u3068\u30ad\u30e3\u30c3\u30b7\u30e5\u3082\u7df4\u7fd2\u7528\u306e\u5834\u6240\u306b\u5206\u3051\u305f\u3002<code>JAVA_HOME<\/code>\u306a\u3069\u306f\u4eca\u306ePowerShell\u5185\u3060\u3051\u306e\u8a2d\u5b9a\u3067\u3001Windows\u306e\u30b7\u30b9\u30c6\u30e0\u8a2d\u5b9a\u3092\u66f8\u304d\u63db\u3048\u308b\u64cd\u4f5c\u3084\u306a\u3044\u3067\u3002Python\u3067\u52d5\u304b\u3059PyGhidra\u3084Debugger\u306e\u6e96\u5099\u306f\u3001\u4eca\u56de\u306eJava\u65b9\u5f0f\u3068\u306f\u5225\u3084\u3002<\/p><h2>3\uff0e\u984c\u6750\u3068\u8aad\u53d6\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4f5c\u6210<\/h2><p><strong>\u3053\u3053\u306f\u6e96\u5099\u3067\u3001\u307e\u3060Ghidra\u306e\u89e3\u6790\u306f\u5b9f\u884c\u305b\u3048\u3078\u3093\u3067\u3002<\/strong>\u6b21\u3067\u300142\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3064\u81ea\u4f5c\u30bd\u30fc\u30b9\u3068\u3001Ghidra\u306b\u7d50\u679c\u3092\u8868\u793a\u3055\u305b\u308b\u81ea\u4f5c\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4fdd\u5b58\u3059\u308b\u3093\u3084\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>@'\npublic class Answer {\n    public static int answer() {\n        return 42;\n    }\n}\n'@ | Set-Content .\\Answer.java -Encoding UTF8<\/code><\/pre><p>\u7d9a\u304f<code>ReadAnswer.java<\/code>\u306f\u89e3\u6790\u5bfe\u8c61\u3084\u306a\u304f\u3001<strong>Ghidra\u306e\u4e2d\u3067\u52d5\u304f\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8<\/strong>\u3084\u3002\u898b\u3064\u304b\u3063\u305f\u95a2\u6570\u540d\u3092\u8868\u793a\u3057\u3001\u6307\u5b9a\u3057\u305f\u95a2\u6570\u306e\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u7d50\u679c\u3092\u51fa\u3059\u3067\u3002\u30d6\u30ed\u30c3\u30af\u5168\u4f53\u3092\u30b3\u30d4\u30fc\u3057\u3066\u5b9f\u884c\u3057\u3066\u306a\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>@'\nimport ghidra.app.script.GhidraScript;\nimport ghidra.app.decompiler.DecompInterface;\nimport ghidra.app.decompiler.DecompileResults;\nimport ghidra.program.model.listing.Function;\nimport ghidra.program.model.listing.FunctionIterator;\n\npublic class ReadAnswer extends GhidraScript {\n    @Override\n    public void run() throws Exception {\n        if (getScriptArgs().length != 1) {\n            throw new Exception(\"Pass one generated function name to this script\");\n        }\n        String wantedName = getScriptArgs()[0];\n        Function selected = null;\n        FunctionIterator functions = currentProgram.getFunctionManager().getFunctions(true);\n        while (functions.hasNext()) {\n            Function function = functions.next();\n            println(\"SAMPLE_FUNCTION \" + function.getName());\n            if (function.getName().equals(wantedName)) {\n                selected = function;\n            }\n        }\n        if (selected == null) {\n            throw new Exception(\"The answer function was not found\");\n        }\n        DecompInterface decompiler = new DecompInterface();\n        try {\n            if (!decompiler.openProgram(currentProgram)) {\n                throw new Exception(decompiler.getLastMessage());\n            }\n            DecompileResults result = decompiler.decompileFunction(selected, 30, monitor);\n            if (!result.decompileCompleted()) {\n                throw new Exception(result.getErrorMessage());\n            }\n            println(\"SAMPLE_DECOMPILE_BEGIN\");\n            println(result.getDecompiledFunction().getC());\n            println(\"SAMPLE_DECOMPILE_END\");\n        } finally {\n            decompiler.dispose();\n        }\n    }\n}\n'@ | Set-Content .\\ReadAnswer.java -Encoding UTF8<\/code><\/pre><p>\u6b21\u306f\u30bd\u30fc\u30b9\u304b\u3089<code>Answer.class<\/code>\u3092\u4f5c\u308b\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u64cd\u4f5c\u3084\u3002<code>--release 17<\/code>\u306f\u984c\u6750\u306e\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u5f62\u5f0f\u3092Java 17\u5411\u3051\u306b\u3059\u308b\u6307\u5b9a\u3067\u3001Ghidra\u81ea\u4f53\u3092\u52d5\u304b\u3059JDK 25\u306e\u6307\u5b9a\u3068\u306f\u5225\u3084\u3067\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>&amp; \"$env:JAVA_HOME\\bin\\javac.exe\" --release 17 -g .\\Answer.java\nif ($LASTEXITCODE -ne 0) { throw '\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u30a8\u30e9\u30fc\u3092\u5148\u306b\u76f4\u3057\u3066\u306a\u3002' }\nGet-Item .\\Answer.class\nNew-Item -ItemType Directory -Force .\\projects | Out-Null<\/code><\/pre><p><strong>\u6e96\u5099\u306e\u6210\u529f\u306e\u76ee\u5b89\uff1a<\/strong><code>Answer.java<\/code>\u3001<code>Answer.class<\/code>\u3001<code>ReadAnswer.java<\/code>\u3068<code>projects<\/code>\u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u3067\u304d\u308b\u3053\u3068\u3084\u3002<code>javac<\/code>\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u3042\u3063\u3066\u3001<code>answer()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u64cd\u4f5c\u3084\u306a\u3044\u3067\u3002<\/p><h2>4\uff0e\u89e3\u6790\u306e\u5b9f\u884c<\/h2><p><strong>\u3053\u3053\u304b\u3089Ghidra\u3067\u89e3\u6790\u3059\u308b\u3067\u3002<\/strong>\u540c\u3058\u7df4\u7fd2\u30d5\u30a9\u30eb\u30c0\u30fc\u3067\u6b21\u3092\u5b9f\u884c\u3057\u3066\u306a\u3002<code>JavaPractice<\/code>\u306f\u7df4\u7fd2\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3084\u3002\u521d\u56de\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u306a\u3069\u3082\u884c\u308f\u308c\u308b\u3002\u7d50\u679c\u3068\u8a3a\u65ad\u306f\u30d5\u30a1\u30a4\u30eb\u3078\u4fdd\u5b58\u3059\u308b\u304b\u3089\u3001\u7aef\u672b\u306b\u4f55\u3082\u51fa\u306a\u3044\u9593\u3082\u3059\u3050\u9589\u3058\u3093\u3088\u3046\u306b\u3057\u3066\u306a\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>$projectDir = (Resolve-Path .\\projects).Path\n$classFile = (Resolve-Path .\\Answer.class).Path\n&amp; \"$ghidraHome\\support\\analyzeHeadless.bat\" \"$projectDir\" JavaPractice -import \"$classFile\" -scriptPath \"$ghidraWork\" -postScript ReadAnswer.java answer_int -log .\\analysis.log 1&gt; .\\analysis-output.log 2&gt; .\\analysis-error.log\n$ghidraExit = $LASTEXITCODE\n\"Ghidra\u306e\u7d42\u4e86\u30b3\u30fc\u30c9: $ghidraExit\"\nGet-Content .\\analysis-output.log -Tail 30<\/code><\/pre><div style=\"overflow-x:auto\"><table style=\"width:100%;border-collapse:collapse\"><thead><tr><th style=\"border:1px solid #bdcbd8;padding:12px\">\u6307\u5b9a<\/th><th style=\"border:1px solid #bdcbd8;padding:12px\">\u610f\u5473<\/th><\/tr><\/thead><tbody><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>\"$projectDir\" JavaPractice<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u30fc\u3068\u3001Ghidra\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3084\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>-import \"$classFile\"<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u89e3\u6790\u5bfe\u8c61\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u6e08\u307f\u306e\u30af\u30e9\u30b9\u3084\u3002\u5143\u30bd\u30fc\u30b9\u3084\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6307\u5b9a\u3059\u308b\u6b04\u3084\u306a\u3044\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>-scriptPath \"$ghidraWork\"<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3001\u4eca\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u30fc\u304b\u3089\u63a2\u3059\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>-postScript ReadAnswer.java answer_int<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u81ea\u52d5\u89e3\u6790\u306e\u5f8c\u3067\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3002<code>answer_int<\/code>\u306f\u305d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3078\u6e21\u3059\u95a2\u6570\u540d\u3067\u3001<code>Answer.class<\/code>\u306e\u8d77\u52d5\u5f15\u6570\u3084\u306a\u3044\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>-log .\\analysis.log<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">Ghidra\u306e\u30ed\u30b0\u3092\u4fdd\u5b58\u3059\u308b\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>1&gt;<\/code>\uff0f<code>2&gt;<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">PowerShell\u304c\u6a19\u6e96\u51fa\u529b\u3068\u6a19\u6e96\u30a8\u30e9\u30fc\u3092\u305d\u308c\u305e\u308c\u4fdd\u5b58\u3059\u308b\u6307\u5b9a\u3084\u3002<\/td><\/tr><\/tbody><\/table><\/div><p>\u3053\u306e\u51e6\u7406\u306f\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u89e3\u6790\u3059\u308b\u3082\u306e\u3067\u3001\u984c\u6750\u306e<code>answer()<\/code>\u3092\u30a2\u30d7\u30ea\u3068\u3057\u3066\u5b9f\u884c\u3059\u308b\u3082\u306e\u3084\u306a\u3044\u3067\u3002<\/p><h2 id=\"ghidra-result\">5\uff0e\u51fa\u529b\u306e\u8aad\u307f\u65b9<\/h2><p>\u30ed\u30b0\u306b\u306f\u3001\u8aad\u307f\u8fbc\u3093\u3060\u95a2\u6570\u540d\u3068\u3001\u5b9f\u969b\u306e\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u7d50\u679c\u304c\u51fa\u308b\u3067\u3002\u5fc5\u8981\u306a\u5468\u8fba\u3060\u3051\u3092\u8868\u793a\u3059\u308b\u306a\u3089\u3001\u6b21\u3092\u5b9f\u884c\u3057\u3066\u306a\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>Select-String -Path .\\analysis-output.log -Pattern 'SAMPLE_FUNCTION'\nSelect-String -Path .\\analysis-output.log -Pattern 'SAMPLE_DECOMPILE_BEGIN' -Context 0,17<\/code><\/pre><p><strong>\u5b9f\u6e2c\u3057\u305f\u95a2\u6570\u540d\uff1a<\/strong>\u30ed\u30b0\u306e\u65e5\u6642\u30fb\u63a5\u982d\u8f9e\u306f\u7701\u7565\u3057\u3066\u308b\u3067\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>SAMPLE_FUNCTION &lt;init&gt;_void\nSAMPLE_FUNCTION answer_int<\/code><\/pre><p><strong>\u5b9f\u6e2c\u3057\u305f\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u7d50\u679c\u306e\u629c\u7c8b\uff1a<\/strong>\u30ed\u30b0\u306e\u63a5\u982d\u8f9e\u3001\u30d5\u30e9\u30b0\u306e\u30b3\u30e1\u30f3\u30c8\u3001\u4f59\u5206\u306a\u7a7a\u884c\u3092\u9664\u3044\u3066\u63b2\u8f09\u3057\u3066\u308b\u3067\u3002\u5143\u30bd\u30fc\u30b9\u3092\u30b3\u30d4\u30fc\u3057\u305f\u3082\u306e\u3084\u306a\u304f\u3001Ghidra\u304c<code>Answer.class<\/code>\u304b\u3089\u5f97\u305f\u8868\u73fe\u3084\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>int answer_int(void)\n{\n  return 0x2a;\n}<\/code><\/pre><div style=\"overflow-x:auto\"><table style=\"width:100%;border-collapse:collapse\"><thead><tr><th style=\"border:1px solid #bdcbd8;padding:12px\">\u8868\u793a<\/th><th style=\"border:1px solid #bdcbd8;padding:12px\">\u8aad\u307f\u65b9<\/th><\/tr><\/thead><tbody><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>&lt;init&gt;_void<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u3053\u306e\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u3092\u8868\u3059\u95a2\u6570\u540d\u3084\u3002\u4eca\u56de\u8aad\u3080<code>answer()<\/code>\u3068\u306f\u5225\u3084\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>answer_int<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u4eca\u56de\u306e\u8aad\u307f\u8fbc\u307f\u3067Ghidra\u304c\u4ed8\u3051\u305f\u95a2\u6570\u540d\u3084\u3002\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u6e21\u3057\u305f\u540d\u524d\u3068\u4e00\u81f4\u3059\u308b\u3067\u3002\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3082\u5fc5\u305a\u540c\u3058\u540d\u524d\u304c\u3042\u308b\u308f\u3051\u3084\u306a\u3044\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>int<\/code>\uff0f<code>void<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u3053\u306e\u7d50\u679c\u3067\u306f\u3001\u6574\u6570\u3092\u8fd4\u3057\u3001\u5f15\u6570\u306a\u3057\u306e\u95a2\u6570\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u3066\u308b\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>return 0x2a;<\/code><\/td><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>0x<\/code>\u306f16\u9032\u6570\u3002<code>2a<\/code>\u306f10\u9032\u6570\u306e42\u3084\u3002\u5143\u30bd\u30fc\u30b9\u306e<code>return 42;<\/code>\u3068\u5bfe\u5fdc\u3059\u308b\u3067\u3002<\/td><\/tr><\/tbody><\/table><\/div><p>Ghidra\u306e\u8868\u793a\u306fC\u98a8\u306e\u8868\u73fe\u3084\u3002\u5143\u306eJava\u30bd\u30fc\u30b9\u306e\u66f8\u304d\u65b9\u3084\u5909\u6570\u540d\u3092\u3001\u305d\u306e\u307e\u307e\u5b8c\u5168\u5fa9\u5143\u3057\u305f\u3053\u3068\u306b\u306f\u306a\u3089\u3078\u3093\u3067\u3002\u4eca\u56de\u306f\u30bd\u30fc\u30b9\u3092\u81ea\u5206\u3067\u6301\u3063\u3066\u3044\u308b\u304b\u3089\u3001\u89e3\u6790\u7d50\u679c\u3068\u306e\u5bfe\u5fdc\u3092\u78ba\u304b\u3081\u308b\u7df4\u7fd2\u306b\u3067\u304d\u308b\u3093\u3084\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>[Convert]::ToInt32('2a', 16)<\/code><\/pre><p>\u3053\u306ePowerShell\u306e\u51fa\u529b\u306f<code>42<\/code>\u3084\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u3082\u6570\u5024\u8868\u73fe\u306e\u5909\u63db\u3067\u3042\u3063\u3066\u3001\u89e3\u6790\u5bfe\u8c61\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3084\u306a\u3044\u3067\u3002<\/p><p><strong>\u6210\u529f\u306e\u76ee\u5b89\uff1a<\/strong>\u7d42\u4e86\u30b3\u30fc\u30c9\u3060\u3051\u3067\u5224\u65ad\u305b\u305a\u3001\u6b21\u3067\u5b8c\u4e86\u30de\u30fc\u30ab\u30fc\u304c<code>True<\/code>\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30e9\u30fc\u304c<code>False<\/code>\u306b\u306a\u308b\u304b\u78ba\u8a8d\u3057\u3066\u306a\u3002\u305d\u306e\u3046\u3048\u3067<code>return 0x2a;<\/code>\u3068\u5143\u30bd\u30fc\u30b9\u3092\u7167\u5408\u3067\u304d\u305f\u3089\u4eca\u56de\u306e\u30b4\u30fc\u30eb\u3084\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>Select-String -Path .\\analysis-output.log -SimpleMatch 'SAMPLE_DECOMPILE_END' -Quiet\nSelect-String -Path .\\analysis-output.log -SimpleMatch 'ERROR REPORT SCRIPT ERROR' -Quiet<\/code><\/pre><p>\u691c\u8a3c\u4e2d\u306b\u306f\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u95a2\u6570\u540d\u3092\u9593\u9055\u3048\u3066\u3001Ghidra\u306e\u7d42\u4e86\u30b3\u30fc\u30c9\u304c0\u3067\u3082\u30b9\u30af\u30ea\u30d7\u30c8\u3060\u3051\u5931\u6557\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u3063\u305f\u3067\u3002\u3060\u304b\u3089\u3001<strong>\u7d42\u4e86\u30b3\u30fc\u30c90\u3060\u3051\u3067\u6210\u679c\u304c\u51fa\u305f\u3068\u6271\u308f\u305a\u3001\u7d50\u679c\u3068\u5b8c\u4e86\u30de\u30fc\u30ab\u30fc\u307e\u3067\u898b\u308b<\/strong>\u3093\u3084\u3002<\/p><h2>\u30b3\u30f3\u30d1\u30a4\u30eb\u3068\u89e3\u6790\u306e\u6d41\u308c<\/h2><figure style=\"margin:24px 0\"><div style=\"overflow-x:auto;border:1px solid #b8cbd8;border-radius:12px\"><svg viewBox=\"0 0 940 570\" role=\"img\" aria-label=\"Answer.java\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066Answer.class\u3092\u4f5c\u308a\u3001Ghidra\u3068\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u89e3\u6790\u3057\u3066\u30ed\u30b0\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u4fdd\u5b58\u3059\u308b\u6d41\u308c\" style=\"width:100%;min-width:760px;height:auto;display:block;font-family:system-ui,sans-serif;fill:#173b52\"><defs><marker id=\"ghidra-arrow\" markerWidth=\"9\" markerHeight=\"9\" refX=\"8\" refY=\"4\" orient=\"auto\"><path d=\"M0 0L8 4L0 8Z\" fill=\"#277b83\"\/><\/marker><\/defs><rect x=\"12\" y=\"15\" width=\"916\" height=\"540\" rx=\"18\" fill=\"#edf5fc\" stroke=\"#7198b6\" stroke-width=\"2\"\/><text x=\"34\" y=\"52\" font-size=\"23\">\u81ea\u5206\u306ePC\uff1a\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u9759\u7684\u306b\u8abf\u3079\u308b<\/text><g fill=\"#fff\" stroke=\"#749bab\" stroke-width=\"2\"><rect x=\"35\" y=\"95\" width=\"240\" height=\"115\" rx=\"12\"\/><rect x=\"350\" y=\"95\" width=\"220\" height=\"115\" rx=\"12\"\/><rect x=\"655\" y=\"95\" width=\"240\" height=\"115\" rx=\"12\"\/><rect x=\"35\" y=\"355\" width=\"240\" height=\"130\" rx=\"12\"\/><rect x=\"350\" y=\"355\" width=\"220\" height=\"130\" rx=\"12\"\/><rect x=\"655\" y=\"355\" width=\"240\" height=\"130\" rx=\"12\" fill=\"#fff6e8\"\/><\/g><g font-size=\"22\" font-weight=\"700\"><text x=\"52\" y=\"130\">Answer.java<\/text><text x=\"370\" y=\"130\">javac<\/text><text x=\"672\" y=\"130\">Answer.class<\/text><text x=\"52\" y=\"393\">ReadAnswer.java<\/text><text x=\"370\" y=\"393\">Ghidra<\/text><text x=\"672\" y=\"393\">\u30ed\u30b0\u3078\u51fa\u529b<\/text><\/g><g font-size=\"19\"><text x=\"52\" y=\"164\">\u81ea\u4f5c\u306e\u5143\u30bd\u30fc\u30b9<\/text><text x=\"52\" y=\"191\">return 42;<\/text><text x=\"370\" y=\"166\">\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b<\/text><text x=\"672\" y=\"166\">\u89e3\u6790\u3059\u308b\u5bfe\u8c61<\/text><text x=\"672\" y=\"193\">Java\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9<\/text><text x=\"52\" y=\"428\">\u89e3\u6790\u3092\u624b\u4f1d\u3046\u30b9\u30af\u30ea\u30d7\u30c8<\/text><text x=\"52\" y=\"457\">\u89e3\u6790\u5bfe\u8c61\u3068\u306f\u5225\u306e\u5f79\u5272<\/text><text x=\"370\" y=\"428\">\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3080<\/text><text x=\"370\" y=\"457\">\u95a2\u6570\u3092\u9006\u30b3\u30f3\u30d1\u30a4\u30eb<\/text><text x=\"672\" y=\"428\">int answer_int(void)<\/text><text x=\"672\" y=\"457\">return 0x2a;<\/text><text x=\"350\" y=\"528\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3082 projects \u5185\u3078\u4fdd\u5b58<\/text><\/g><g fill=\"none\" stroke=\"#277b83\" stroke-width=\"3\" marker-end=\"url(#ghidra-arrow)\"><path d=\"M275 150H340\"\/><path d=\"M570 150H645\"\/><path d=\"M775 210V285H460V345\"\/><path d=\"M275 420H340\"\/><path d=\"M570 420H645\"\/><\/g><g font-size=\"18\"><text x=\"290\" y=\"130\">\u5165\u529b<\/text><text x=\"585\" y=\"130\">\u751f\u6210<\/text><text x=\"610\" y=\"269\">.class\u3092\u53d6\u308a\u8fbc\u3080<\/text><text x=\"285\" y=\"338\">Ghidra\u5185\u3067\u5b9f\u884c<\/text><text x=\"587\" y=\"401\">\u8868\u793a<\/text><\/g><\/svg><\/div><figcaption>\u3053\u306e\u8a18\u4e8b\u306e\u72ec\u81ea\u56f3\u89e3\u3084\u3067\u3002\u4e0a\u6bb5\u306f\u984c\u6750\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u4e0b\u6bb5\u306fGhidra\u3067\u306e\u89e3\u6790\u3084\u3002Answer.class\u306f\u89e3\u6790\u5bfe\u8c61\u3001ReadAnswer.java\u306f\u7d50\u679c\u3092\u53d6\u308a\u51fa\u3059\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3001\u5f79\u5272\u304c\u9055\u3046\u3093\u3084\u3002\u4eca\u56de\u306e\u51e6\u7406\u306fPC\u5185\u3067\u884c\u3044\u3001ZIP\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u901a\u4fe1\u3084\u5916\u90e8AI\u3068\u306f\u5225\u306e\u8a71\u3084\u3067\u3002<\/figcaption><\/figure>\n<div style=\"overflow-x:auto\"><table style=\"width:100%;border-collapse:collapse\"><thead><tr><th style=\"border:1px solid #bdcbd8;padding:12px\">\u305d\u306e\u307e\u307e\u898b\u308b\u5834\u5408<\/th><th style=\"border:1px solid #bdcbd8;padding:12px\">\u4eca\u56de\u306e\u8aad\u307f\u65b9<\/th><\/tr><\/thead><tbody><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u305d\u306e\u307e\u307e\u3067\u306f\u30bd\u30fc\u30b9\u306e\u3088\u3046\u306b\u8aad\u3081\u3078\u3093\u3002<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">Ghidra\u306e\u51fa\u529b\u304b\u3089\u623b\u308a\u5024\u3092\u898b\u3066\u3001\u81ea\u5206\u306e\u5143\u30bd\u30fc\u30b9\u3068\u7167\u5408\u3059\u308b\u3067\u3002<\/td><\/tr><\/tbody><\/table><\/div><h2>\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8abf\u3079\u308b\u3068\u304d<\/h2><p>\u5225\u306eJava\u30af\u30e9\u30b9\u306a\u3089<code>-import<\/code>\u306e\u5bfe\u8c61\u3092\u5909\u3048\u308b\u3060\u3051\u3067\u306a\u304f\u3001<code>SAMPLE_FUNCTION<\/code>\u306b\u8868\u793a\u3055\u308c\u305f\u95a2\u6570\u540d\u306b\u5408\u308f\u305b\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5f15\u6570\u3082\u5909\u3048\u308b\u3067\u3002\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3084\u30b3\u30f3\u30d1\u30a4\u30eb\u6761\u4ef6\u3067\u540d\u524d\u30fb\u7d50\u679c\u304c\u5909\u308f\u308b\u3053\u3068\u304c\u3042\u308b\u3093\u3084\u3002<\/p><p>EXE\u30fbELF\u30fbraw\u30d0\u30a4\u30ca\u30ea\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u3084CPU\u3001\u8aad\u307f\u8fbc\u307f\u30a2\u30c9\u30ec\u30b9\u3001\u95a2\u6570\u306e\u5165\u53e3\u306a\u3069\u5225\u306e\u6761\u4ef6\u304c\u95a2\u308f\u308b\u3067\u3002\u4eca\u56de\u306e<code>answer_int<\/code>\u3092\u305d\u306e\u307e\u307e\u4f7f\u308f\u3078\u3093\u3088\u3046\u306b\u3057\u3066\u306a\u3002<a href=\"https:\/\/github.com\/NationalSecurityAgency\/ghidra\/blob\/Ghidra_12.2_build\/GhidraDocs\/GettingStarted.md#headless-batch-mode\">\u516c\u5f0f\u306eHeadless\u6848\u5185<\/a>\u304b\u3001\u5c55\u958b\u5148\u306e<code>support\\analyzeHeadlessREADME.html<\/code>\u3067\u5404\u6307\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3093\u3084\u3002<\/p><p>REA\u306a\u3069\u306e\u5916\u90e8\u30c4\u30fc\u30eb\u304b\u3089Ghidra\u3092\u547c\u3076\u5834\u5408\u306f\u3001\u305d\u306e\u9023\u643a\u30c4\u30fc\u30eb\u5074\u306e\u5bfe\u5fdc\u7248\u3082\u78ba\u8a8d\u3057\u3066\u306a\u3002<strong>Ghidra\u5358\u4f53\u3067\u4f7f\u3048\u308b\u6700\u65b0\u7248\u3068\u3001\u9023\u643a\u5074\u304c\u5bfe\u5fdc\u3059\u308b\u7248\u306f\u5225\u306e\u8a71<\/strong>\u3084\u3067\u3002<\/p><h2>\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/h2><div style=\"overflow-x:auto\"><table style=\"width:100%;border-collapse:collapse\"><thead><tr><th style=\"border:1px solid #bdcbd8;padding:12px\">\u56f0\u3063\u305f\u3053\u3068<\/th><th style=\"border:1px solid #bdcbd8;padding:12px\">\u78ba\u8a8d\u3059\u308b\u3053\u3068<\/th><\/tr><\/thead><tbody><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">Java\u304c\u306a\u3044\u30fb\u5bfe\u5fdcJDK\u304c\u898b\u3064\u304b\u3089\u306a\u3044<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u540c\u3058PowerShell\u3067<code>$env:JAVA_HOME<\/code>\u3092\u8868\u793a\u3057\u3001<code>&amp; \"$env:JAVA_HOME\\bin\\java.exe\" -version<\/code>\u304c25\u7cfb\u304b\u78ba\u8a8d\u3057\u3066\u306a\u3002JRE\u3060\u3051\u3067\u306f\u306a\u304fJDK\u3092\u4f7f\u3046\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">The system cannot find the path specified<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">Ghidra\u3068JDK\u306e\u5c55\u958b\u5148\u3068\u3001\u4eca\u3044\u308b\u5834\u6240\u3092\u78ba\u8a8d\u3059\u308b\u3067\u3002\u672c\u691c\u8a3c\u3067\u306f\u65e5\u672c\u8a9e\u30d1\u30b9\u304b\u3089\u306e\u8d77\u52d5\u306b\u5931\u6557\u3057\u3001\u82f1\u6570\u5b57\u306e\u914d\u7f6e\u5148\u3067\u5148\u3078\u9032\u3081\u305f\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">Felix framework\u306edata dir\u30a8\u30e9\u30fc<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u65e2\u5b58\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3057\u3066\u6e08\u307e\u305b\u305a\u3001\u300c2\uff0eGhidra\u3068JDK\u306e\u6e96\u5099\u300d\u306e<code>application.settingsdir<\/code>\u3068<code>application.cachedir<\/code>\u3092\u7df4\u7fd2\u7528\u30d5\u30a9\u30eb\u30c0\u30fc\u306b\u8a2d\u5b9a\u3057\u305f\u304b\u78ba\u8a8d\u3057\u3066\u306a\u3002\u672c\u691c\u8a3c\u3067\u306f\u8a2d\u5b9a\u5148\u3092\u5206\u3051\u3066\u5b9f\u884c\u3067\u304d\u305f\u3067\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">\u95a2\u6570\u304c\u898b\u3064\u304b\u3089\u306a\u3044<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\"><code>SAMPLE_FUNCTION<\/code>\u306e\u884c\u3092\u898b\u3066\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3078\u6e21\u3057\u305f\u540d\u524d\u304c\u4e00\u81f4\u3059\u308b\u304b\u78ba\u8a8d\u3057\u3066\u306a\u3002<code>answer<\/code>\u3067\u306f\u306a\u304f\u3001\u3053\u306e\u4f8b\u306e\u5b9f\u6e2c\u3067\u306f<code>answer_int<\/code>\u3084\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306b\u540c\u540d\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u518d\u958b\u306a\u3089\u4e0b\u306e<code>-process<\/code>\u3092\u4f7f\u3046\u3067\u3002\u6700\u521d\u304b\u3089\u6bd4\u8f03\u3057\u305f\u3044\u306a\u3089\u5225\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306b\u3057\u3066\u306a\u3002<\/td><\/tr><tr><td style=\"border:1px solid #bdcbd8;padding:12px\">\u7d42\u4e86\u30b3\u30fc\u30c90\u306a\u306e\u306b\u7d50\u679c\u304c\u306a\u3044<\/td><td style=\"border:1px solid #bdcbd8;padding:12px\">\u30ed\u30b0\u306e<code>ERROR REPORT SCRIPT ERROR<\/code>\u3068\u3001<code>SAMPLE_DECOMPILE_END<\/code>\u3092\u78ba\u8a8d\u3057\u3066\u306a\u3002<code>analysis-error.log<\/code>\u306b\u3082\u8a3a\u65ad\u304c\u6b8b\u308b\u3067\u3002<\/td><\/tr><\/tbody><\/table><\/div><h2>\u7d42\u4e86\u3068\u518d\u958b<\/h2><p>Headless\u51e6\u7406\u304c\u7d42\u308f\u308c\u3070\u3001\u305d\u306e\u30d7\u30ed\u30bb\u30b9\u306f\u7d42\u4e86\u3059\u308b\u3067\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f<code>projects<\/code>\u5185\u306e<code>JavaPractice.gpr<\/code>\u3068<code>JavaPractice.rep<\/code>\u306b\u6b8b\u308b\u3002\u30ed\u30b0\u3084\u5143\u30bd\u30fc\u30b9\u3068\u306f\u5225\u306e\u4fdd\u5b58\u7269\u3084\u3067\u3002PowerShell\u3092\u9589\u3058\u305f\u5f8c\u306b\u518d\u958b\u3059\u308b\u306a\u3089\u3001\u7df4\u7fd2\u30d5\u30a9\u30eb\u30c0\u30fc\u3078\u79fb\u52d5\u3057\u3001<code>$ghidraWork<\/code>\u3001<code>$env:JAVA_HOME<\/code>\u3001<code>$ghidraHome<\/code>\u3001<code>$env:GHIDRA_HEADLESS_JAVA_OPTIONS<\/code>\u306e\u8a2d\u5b9a\u3092\u3084\u308a\u76f4\u3057\u3066\u306a\u3002<\/p><p>\u3059\u3067\u306b\u53d6\u308a\u8fbc\u3093\u3060\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3068\u304d\u306f\u3001<code>-import<\/code>\u306e\u4ee3\u308f\u308a\u306b<code>-process<\/code>\u3067\u4fdd\u5b58\u6e08\u307f\u306e\u540d\u524d\u3092\u6307\u5b9a\u3059\u308b\u3067\u3002\u6b21\u306e\u518d\u958b\u7528\u306e\u66f8\u5f0f\u306f\u516c\u5f0f\u4ed5\u69d8\u304b\u3089\u306e\u6848\u5185\u3067\u3001\u4eca\u56de\u306e\u5b9f\u6e2c\u51fa\u529b\u306f\u4e0a\u306e\u521d\u56de\u53d6\u308a\u8fbc\u307f\u3067\u53d6\u5f97\u3057\u305f\u3082\u306e\u3084\u3002<\/p><pre style=\"padding:18px;overflow-x:auto;background:#edf3f8;color:#173b52;white-space:pre\"><code>$projectDir = (Resolve-Path .\\projects).Path\n&amp; \"$ghidraHome\\support\\analyzeHeadless.bat\" \"$projectDir\" JavaPractice -process Answer.class -scriptPath \"$ghidraWork\" -postScript ReadAnswer.java answer_int<\/code><\/pre><p>Ghidra\u306e\u753b\u9762\u3067\u3082\u898b\u305f\u304f\u306a\u3063\u305f\u3089\u3001\u5c55\u958b\u5148\u306e<code>ghidraRun.bat<\/code>\u3092\u8d77\u52d5\u3057\u3066<code>File \u2192 Open Project<\/code>\u304b\u3089<code>JavaPractice.gpr<\/code>\u3092\u958b\u304f\u65b9\u6cd5\u304c\u3042\u308b\u3067\u3002\u3053\u306eGUI\u64cd\u4f5c\u306f\u4eca\u56de\u672a\u5b9f\u6a5f\u78ba\u8a8d\u3084\u3002\u7247\u4ed8\u3051\u308b\u3068\u304d\u306fGhidra\u3092\u9589\u3058\u3001\u5fc5\u8981\u306a\u30ed\u30b0\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4e21\u65b9\u3092\u9000\u907f\u3057\u3066\u304b\u3089\u3001\u7df4\u7fd2\u7528\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u3067\u30b4\u30df\u7bb1\u3078\u79fb\u3057\u3066\u306a\u3002<\/p><h2>\u516c\u5f0f\u8cc7\u6599\u3068\u5229\u7528\u6761\u4ef6<\/h2><p>Ghidra\u672c\u4f53\u306fApache License 2.0\u3084\u3002\u540c\u68b1\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u500b\u5225\u306e\u6761\u4ef6\u304c\u3042\u308b\u304b\u3089\u3001\u914d\u5e03\u7269\u306e<code>licenses<\/code>\u306a\u3069\u3082\u78ba\u8a8d\u3057\u3066\u306a\u3002\u4eca\u56de\u4f7f\u3063\u305fTemurin JDK\u306fOpenJDK\u306eGPLv2\uff0bClasspath Exception\u306a\u3069\u306e\u6761\u4ef6\u3092\u6301\u3061\u3001Ghidra\u672c\u4f53\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u3068\u306f\u5225\u3084\u3002\u89e3\u6790\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u6a29\u5229\u3082\u5225\u306a\u306e\u3067\u3001\u307e\u305a\u306f\u3053\u306e\u8a18\u4e8b\u306e\u81ea\u4f5c\u984c\u6750\u3067\u8a66\u3057\u3066\u306a\u3002<\/p><ul><li><a href=\"https:\/\/github.com\/NationalSecurityAgency\/ghidra\">\u516c\u5f0fGitHub\u30fbREADME<\/a><\/li><li><a href=\"https:\/\/github.com\/NationalSecurityAgency\/ghidra\/releases\/tag\/Ghidra_12.2_build\">Ghidra 12.2\u306e\u516c\u5f0f\u30ea\u30ea\u30fc\u30b9\u30fbSHA-256<\/a><\/li><li><a href=\"https:\/\/github.com\/NationalSecurityAgency\/ghidra\/blob\/Ghidra_12.2_build\/GhidraDocs\/GettingStarted.md\">12.2\u306e\u8981\u4ef6\u30fb\u5c0e\u5165\u30ac\u30a4\u30c9<\/a><\/li><li><a href=\"https:\/\/github.com\/NationalSecurityAgency\/ghidra\/blob\/Ghidra_12.2_build\/LICENSE\">Ghidra LICENSE<\/a><\/li><li><a href=\"https:\/\/adoptium.net\/temurin\/releases\/?version=25\">Temurin JDK 25\u306e\u914d\u5e03\u5143<\/a><\/li><li><a href=\"https:\/\/github.com\/adoptium\/temurin25-binaries\/releases\/tag\/jdk-25.0.4.1%2B1\">\u4eca\u56de\u306eJDK\u914d\u5e03\u30d5\u30a1\u30a4\u30eb\u30fb\u30c1\u30a7\u30c3\u30af\u30b5\u30e0<\/a><\/li><li>Temurin\u306e\u5229\u7528\u6761\u4ef6\uff1a\u914d\u5e03ZIP\u5185\u306e<code>legal<\/code>\u30d5\u30a9\u30eb\u30c0\u30fc\uff08\u30e2\u30b8\u30e5\u30fc\u30eb\u5225\uff09<\/li><\/ul><p><small>\u8a18\u4e8b\u306e\u78ba\u8a8d\u65e5\uff1a2026\u5e7410\u670825\u65e5\u3002\u984c\u6750\u30fb\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u30fb\u624b\u9806\u56f3\u306f\u72ec\u81ea\u5236\u4f5c\u3002\u51fa\u529b\u306f\u4e0a\u8a18\u74b0\u5883\u3067\u306e\u5b9f\u6e2c\u304b\u3089\u5fc5\u8981\u306a\u90e8\u5206\u3092\u629c\u7c8b\u3057\u305f\u3067\u3002\u8a18\u4e8b\u306e\u9078\u5b9a\u306b\u306fHysen Labs\u306e<a href=\"https:\/\/hysenlabs.com\/data\/star-growth\">\u904e\u53bb30\u65e5\u9593\u306e\u30b9\u30bf\u30fc\u7d14\u5897\u30e9\u30f3\u30ad\u30f3\u30b0<\/a>\uff082026\u5e749\u670824\u65e5\u301c10\u670824\u65e5\u3001\u8ffd\u8de1\u5bfe\u8c6112,567\u4ef6\u306e\u7bc4\u56f2\u300120\u4f4d\uff09\u3092\u53c2\u7167\u3057\u305f\u3002GitHub\u5168\u4f53\u306e\u9806\u4f4d\u3068\u306f\u65ad\u5b9a\u305b\u3048\u3078\u3093\u3067\u3002\u30c7\u30fc\u30bf\u306e\u51fa\u5178\uff1aHysen Labs\u3001CC BY 4.0\u3002\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9CSV\u306f\u524d\u306e\u671f\u9593\u3084\u3063\u305f\u305f\u3081\u3001\u3053\u306e\u9078\u5b9a\u306b\u306f\u65b0\u3057\u3044\u671f\u9593\u3092\u660e\u793a\u3057\u305fHTML\u3092\u4f7f\u3063\u305f\u3067\u3002<\/small><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u6e08\u307f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u3066\u3082\u3001\u6587\u5b57\u306e\u4e26\u3073\u3060\u3051\u3067\u306f\u51e6\u7406\u3092\u8ffd\u3044\u306b\u304f\u3044\u3053\u3068\u304c\u3042\u308b\u3067\u3002Ghidra\u306f\u3001\u9006\u30a2\u30bb\u30f3\u30d6\u30eb\u30fb\u9006\u30b3\u30f3\u30d1\u30a4\u30eb\u30fb\u53c2\u7167\u306e\u8abf\u67fb\u306a\u3069\u3092\u307e\u3068\u3081\u3066\u884c\u3046\u3001NSA\u304c\u516c\u958b\u3059\u308b\u89e3\u6790\u30c4\u30fc&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/blog.himajin.ddo.jp\/?p=295\"><span class=\"more-text\">\u7d9a\u304d\u3092\u8aad\u3080<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,13],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-github-trending","category-github-security"],"_links":{"self":[{"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295"}],"version-history":[{"count":2,"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":297,"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions\/297"}],"wp:attachment":[{"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.himajin.ddo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}