{"id":43496613,"url":"https://github.com/quarkslab/idascript","last_synced_at":"2026-02-03T10:38:37.480Z","repository":{"id":65607137,"uuid":"595611809","full_name":"quarkslab/idascript","owner":"quarkslab","description":"Utilities scripts and Python module to facilitate executing idapython scripts in IDA.","archived":false,"fork":false,"pushed_at":"2025-12-05T17:42:25.000Z","size":100,"stargazers_count":30,"open_issues_count":1,"forks_count":4,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-12-09T05:24:23.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://diffing.quarkslab.com/tools/idascript.html#idascript","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quarkslab.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-31T12:56:45.000Z","updated_at":"2025-12-05T12:55:32.000Z","dependencies_parsed_at":"2025-01-17T10:28:34.324Z","dependency_job_id":"518e067a-8754-41dd-a49f-87fcde8b9da4","html_url":"https://github.com/quarkslab/idascript","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/quarkslab/idascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fidascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fidascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fidascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fidascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quarkslab","download_url":"https://codeload.github.com/quarkslab/idascript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fidascript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29041866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-03T10:38:34.138Z","updated_at":"2026-02-03T10:38:37.474Z","avatar_url":"https://github.com/quarkslab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Idascript\n\nIdascript is a python library allowing to launch idapython script on binary files in a transparent manner.\n\n## Installation\n\nInstalling the library can be done with:\n\n    pip install idascript\n\nAfter installation `idascript` should be ready for import and the script `idascripter`\nshould be in the path to use the library as a program.\n\n### IDA path\n\nidascript looks for the `idat64`\nin the $PATH environment variable but if it is not present the IDA installation path\nshould be given via the `IDA_PATH` environment variable.\n\n**Command line**\n\n```bash\nexport IDA_PATH=[your ida path]\nidascripter ...\n```\nor\n\n```bash\nIDA_PATH=[your ida path] idascripter ...\n```\n\n**Dependencies**: The ``idascripter`` script requires libmagic to identify\nexecutable binaries. It should be available on the system. It can be installed\nwith:\n\n    sudo apt install libmagic1\n\n\n**Python library**\n\nIf `IDA_PATH` provided to the interpreter, it can be set manually with `os.environ[\"IDA_PATH\"] = [your path]`.\n\n\u003e The easiest way is to export the environment variable in you bashrc\n\n## idascripter\n\nAfter installation the script `idascripter` is available in the path. It helps\nexecuting idapython scripts on one or multiple binary files in an easy manner.\n\n**Single file**\n\n```bash\nidascripter my_binary_file [-s my_script.py] [-t timeout] [my script params | IDA options]\n```\n\n\u003e idascripter returns the exit code of the IDA process, which can be itself the exit code of your\nscript given by `ida_pro.qexit(num)`.\n\nAs a recall an idapython script should be architectured like this:\n\n```python\nimport ida_auto\nimport ida_pro\n\nida_auto.auto_wait() # wait for the pre-analysis of IDA to be terminated\n\n# Your script content\n\nida_pro.qexit(0) #exit IDA with the given return code (otherwise remains opened)\n```\n\n\u003e Disclaimer: You should make sure that the import of your script are satisfied (in python2) before\nluanching it against binaries\n\n**Multiple files**\n\nIf idascripter is given a directory instead of a file, it will recursively iterate all the directory and\nsubdirectories for executable files. The file type detection is based on `magic` library and analyse files\nwhich ave the following mime type: `application/x-dosexec` (PE, MS-DOS), `application/x-sharedlib` (ELF),\n`application/x-mach-binary` (Mach-O), `application/x-executable` (ELF).\n\nWhen running idascripter shows a progessbar and keeps track of files having a return code other than 0 to\n(help post-analysis debug).\n\n![MultiIDA](docs/multi_ida_screenshot.png)\n\nNote: An optional parameters (-l/--log) can be precised to have a log file with all the results.\n\n## Library usage\n\nThe python library intents to be as simple as possible. \n\n**Single file analysis**\n\nA single file analysis can performed as follow:\n\n```python\nos.environ[\"IDA_PATH\"] = \"/path/to/ida\" # If not given to the interpreter directly\nfrom idascript import IDA\nida = IDA(\"/path/binary\", \"/path/script\", [])\nida.start()\nretcode = ida.wait()\n```\n\n\u003e Note start is not blocking so you can come to pick up the result whenever you want.\n\n**Multiple file analysis**\n\nThis works almost similarly to single file analysis except that a file\niterator should be given. A simple usage is:\n\n```python\nfrom idascript import MultiIDA, iter_binary_files\ngenerator = iter_binary_files('/path/to/bins')\nfor (retcode, file) in MultiIDA.map(generator, \"/path/script\", []):\n    # Do what you want with analysed files yielded\n```\n\n\u003e The generator should is not necessarily a generator, thus it can be a list of files to analyse\n\n\n**Custom file generator**\n\nWe might be led to write our own file iterator depending on our needs. Let's consider we want\nto analyse only files that have never been analysed namely the ones not having a `.i64` associated.\nThus, we can derive our own generator from `iter_binary_files` like this:\n\n```python\nimport os.path\nfrom pathlib import Path\nfrom idascript import MultiIDA, iter_binary_files\n\ndef my_custom_generator(path):\n    for file in iter_binary_files(path):\n        i64_file = os.path.splitext(file)[0]+\".i64\"\n        if not Path(i64_file).exists():\n            yield file\n\ngenerator = my_custom_generator('/path/to/bins')\nfor (retcode, file) in MultiIDA.map(generator, \"/path/script\", []):\n    # Do something with files\n```\n\n## API\n\n```{eval-rst}\n.. automodule:: idascript.ida\n    :members:\n    :show-inheritance:\n    :undoc-members:\n    :exclude-members: IDAMode\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarkslab%2Fidascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquarkslab%2Fidascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarkslab%2Fidascript/lists"}