{"id":13755415,"url":"https://github.com/tintinweb/ida-batch_decompile","last_synced_at":"2025-04-09T23:18:00.017Z","repository":{"id":49688132,"uuid":"69614438","full_name":"tintinweb/ida-batch_decompile","owner":"tintinweb","description":"*Decompile All the Things* - IDA Batch Decompile plugin and script for Hex-Ray's IDA Pro that adds the ability to batch decompile multiple files and their imports with additional annotations (xref, stack var size) to the pseudocode .c file","archived":false,"fork":false,"pushed_at":"2020-05-14T12:36:23.000Z","size":44,"stargazers_count":286,"open_issues_count":1,"forks_count":56,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T23:17:56.210Z","etag":null,"topics":["batch-processing","decompile","ida","ida-batch-decompile","ida-plugin","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-decompiler","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tintinweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-29T22:57:36.000Z","updated_at":"2025-04-06T12:20:12.000Z","dependencies_parsed_at":"2022-08-25T06:00:12.795Z","dependency_job_id":null,"html_url":"https://github.com/tintinweb/ida-batch_decompile","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2Fida-batch_decompile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2Fida-batch_decompile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2Fida-batch_decompile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2Fida-batch_decompile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tintinweb","download_url":"https://codeload.github.com/tintinweb/ida-batch_decompile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125593,"owners_count":21051771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-processing","decompile","ida","ida-batch-decompile","ida-plugin","reverse-engineering"],"created_at":"2024-08-03T10:00:53.914Z","updated_at":"2025-04-09T23:17:59.991Z","avatar_url":"https://github.com/tintinweb.png","language":"Python","readme":"# ida-batch_decompile\r\n\r\n*Decompile all the things!*\r\n\r\nIDA Batch Decompile is a plugin for Hex-Ray's IDA Pro that adds the ability to batch decompile multiple files and their imports with additional annotations (xref, stack var size) to the pseudocode .c file\r\n\r\n![idabatchdecompile](https://cloud.githubusercontent.com/assets/2865694/19421079/a88707d6-93f8-11e6-86b2-483b923f5574.gif)\r\n\r\n\r\n:baby_chick: pssst! *- *ida-batch_decompile* is also part of project: [unbox](https://github.com/tintinweb/unbox) - a nobrainer commandline tool to unpack and decompile all sorts of things.*\r\n\r\n# Usage\r\n\r\n## idascript (gui mode)\r\n\r\n1. open target, wait for analysis to finish\r\n2. `IDA Pro -\u003e File/Script file... -\u003e \u003cthis_python_script\u003e`\r\n3. `IDA Pro -\u003e File/Produce file-\u003e IdaDecompileBatch ...`\r\n3. tick `Annotate StackVarSize`, `Annotate Func XRefs`\r\n4. click `OK` to decompile.\r\n\r\nNote: File will be saved in target folder as `\u003ctarget_image_name.c\u003e`\r\n\r\n## idascript (cmdline batch mode)\r\n\r\n    \u003cpath_to_ida\u003e/ida(w|w64)(.exe) -B -M -S\"\u003cpath_to_this_script\u003e \\\"--option1\\\" \\\"--option2\\\"\" \"\u003ctarget\u003e\"\r\n\r\nNote that options need to be quoted with `\\\"`\r\n\r\nAvailable options, see `--help`\r\n\r\n    --output                        ... output file path\r\n    --annotate-stackvar-size        ... annotate function stack variable sizes\r\n    --annotate-xrefs                ... annotate function xrefs\r\n    --imports                       ... process imports\r\n    --recursive                     ... recursive batch decompile\r\n    --experimental-decompile-cgraph ... experimental: manually decompile function call graph\r\n\r\n## Ida Plugin\r\n\r\n1. Follow the IDA Pro documentation on how to add python plugins.\r\n2. `IDA Pro -\u003e File/Produce file -\u003e IdaDecompileBatch ...`\r\n\r\n# run\r\n\r\n### ida console: decompiling dbghelp.dll\r\n\r\n```python\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.PLUGIN_ENTRY  ] [+] initializing IdaDecompileBatchPlugin\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.__init__      ] [+] is_windows: True\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.__init__      ] [+] is_ida64: False\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.wait_for_analysis_to_finish] [+] waiting for analysis to finish...\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.wait_for_analysis_to_finish] [+] analysis finished.\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.load_plugin_decompiler] [+] trying to load decompiler plugins\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.load_plugin_decompiler] [+] decompiler plugins loaded.\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.PLUGIN_ENTRY  ] [+] Mode: commandline w/o args\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.set_ctrl      ] [+] IdaDecompileBatchPlugin.set_ctrl(\u003c__main__.IdaDecompileBatchController object at 0x056FCF90\u003e)\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.init          ] [+] IdaDecompileBatchPlugin.init()\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.init          ] [+] setting up menus\r\n[__main__/36908][INFO      ] [idabatchdecompile.PLUGIN_ENTRY  ] [i] IdaDecompileBatch loaded, see Menu: ('File/Produce file/', 'IdaDecompileBatch ...')\r\n...\r\n The application has been completely decompiled.\r\n[__main__/36908][DEBUG     ] [idabatchdecompile.decompile_all ] [+] finished decompiling 'dbghelp.dll' as 'dbghelp.c'\r\n```\r\n\r\n### annotated pseudocode: dbghelp.c\r\n\r\n```c\r\n//----- (03052800) --------------------------------------------------------\r\n// **** Variables ****\r\n// * stack size: 20\r\n// {\"diff_size\": 4, \"offset_text\": \"[bp+0h]\", \"size\": 4, \"name\": \" s\", \"offset\": 0}\r\n// {\"diff_size\": 4, \"offset_text\": \"[bp+4h]\", \"size\": 4, \"name\": \" r\", \"offset\": 4}\r\n// {\"diff_size\": 4, \"offset_text\": \"[bp+8h]\", \"size\": 4, \"name\": \"arg_0\", \"offset\": 8}\r\n// {\"diff_size\": 4, \"offset_text\": \"[bp+Ch]\", \"size\": 4, \"name\": \"dwBytes\", \"offset\": 12}\r\n// {\"diff_size\": 4, \"offset_text\": \"[bp+10h]\", \"size\": 4, \"name\": \"arg_8\", \"offset\": 16}\r\n// *******************\r\n// ***** XREFS *****\r\n// * # 1\r\n// sub_30733D0+30\r\n// *******************\r\nint __stdcall sub_3052800(int a1, SIZE_T dwBytes, int a3)\r\n{\r\n  int result; // eax@17\r\n  HANDLE v4; // eax@21\r\n...\r\n```\r\n\r\n\r\n//github.com/tintinweb\r\n","funding_links":[],"categories":["\u003ca id=\"d2166f4dac4eab7fadfe0fd06467fbc9\"\u003e\u003c/a\u003e反编译器\u0026\u0026AST"],"sub_categories":["\u003ca id=\"b31acf6c84a9506066d497af4e702bf5\"\u003e\u003c/a\u003e调试数据"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftintinweb%2Fida-batch_decompile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftintinweb%2Fida-batch_decompile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftintinweb%2Fida-batch_decompile/lists"}