{"id":27896359,"url":"https://github.com/onlyuser/gen-callgraph","last_synced_at":"2025-07-02T06:05:40.196Z","repository":{"id":27193677,"uuid":"30663980","full_name":"onlyuser/gen-callgraph","owner":"onlyuser","description":"gen-callgraph is a script to generate call graph from elf binary","archived":false,"fork":false,"pushed_at":"2018-12-31T03:01:59.000Z","size":22,"stargazers_count":48,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-05T17:16:22.283Z","etag":null,"topics":["callgraph","dot","graphviz-dot","objdump","readelf"],"latest_commit_sha":null,"homepage":"http://onlyuser.github.io/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onlyuser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T18:56:38.000Z","updated_at":"2025-03-31T05:24:14.000Z","dependencies_parsed_at":"2022-07-25T17:00:31.698Z","dependency_job_id":null,"html_url":"https://github.com/onlyuser/gen-callgraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/onlyuser/gen-callgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlyuser%2Fgen-callgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlyuser%2Fgen-callgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlyuser%2Fgen-callgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlyuser%2Fgen-callgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onlyuser","download_url":"https://codeload.github.com/onlyuser/gen-callgraph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlyuser%2Fgen-callgraph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263083593,"owners_count":23411163,"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":["callgraph","dot","graphviz-dot","objdump","readelf"],"created_at":"2025-05-05T16:59:20.128Z","updated_at":"2025-07-02T06:05:40.165Z","avatar_url":"https://github.com/onlyuser.png","language":"Shell","readme":"gen-callgraph\n=============\n\nCopyright (C) 2011-2017 \u003cmailto:onlyuser@gmail.com\u003e\n\nAbout\n-----\n\ngen-callgraph is a script to generate call graph from elf binary.\n\nSee sister project for generating c-tags from elf binary: [gen-ctags](https://github.com/onlyuser/gen-ctags)\n\nA Motivating Example\n--------------------\n\ninput: elf binary from below source:\n\u003cpre\u003e\nclass QWE\n{\npublic:\n    QWE() {}\n    ~QWE() {}\n    void f() {}\n};\n\nvoid A();\nvoid C() {A();}\nvoid B() {C(); QWE qwe; qwe.f();}\nvoid A() {B(); C();}\n\nint main(int argc, char** argv)\n{\n    A();\n    return 0;\n}\n\u003c/pre\u003e\n\noutput: graphviz dot for below graph:\n\n![picture alt](https://sites.google.com/site/onlyuser/files/gen-callgraph.png \"gen-callgraph\")\n\nRequirements\n------------\n\n    bash readelf objdump c++filt graphviz\n\nLimitations\n-----------\n\n\u003cul\u003e\n    \u003cli\u003eOnly supports statically linked functions within one x86_64 binary.\u003c/li\u003e\n    \u003cli\u003eOnly supports function calls invoked by assembly commands callq/jmpq/jmp and conditional jump variants on literal (non-register) destinations.\u003c/li\u003e\n    \u003cli\u003eNaive algorithm. Only tested on small binaries.\u003c/li\u003e\n\u003c/ul\u003e\n\nInstallation (Debian)\n---------------------\n\n1. git clone https://github.com/onlyuser/gen-callgraph.git\n\nUsage\n-----\n\n\u003cpre\u003e\ngen-callgraph \u0026lt;BINARY\u0026gt; [DEBUG={0*/1}] | dot -Tpng -ocallgraph.png\n\u003c/pre\u003e\n\nRecommended gcc Options\n-----------------------\n\n\u003cul\u003e\n    \u003cli\u003e-g\u003c/li\u003e\n    \u003cli\u003e-O0\u003c/li\u003e\n    \u003cli\u003e-fno-function-cse\u003c/li\u003e\n    \u003cli\u003e-fomit-frame-pointer\u003c/li\u003e\n\u003c/ul\u003e\n\nReferences\n----------\n\n\u003cdl\u003e\n    \u003cdt\u003e\"Disassemble raw x64 machine code\"\u003c/dt\u003e\n    \u003cdd\u003ehttp://stackoverflow.com/questions/19071461/disassemble-raw-x64-machine-code\u003c/dd\u003e\n    \u003cdt\u003e\"Graphviz - Graph Visualization Software\"\u003c/dt\u003e\n    \u003cdd\u003ehttp://www.graphviz.org/\u003c/dd\u003e\n    \u003cdt\u003e\"Trying to understand gcc option -fomit-frame-pointer\"\u003c/dt\u003e\n    \u003cdd\u003ehttp://stackoverflow.com/questions/14666665/trying-to-understand-gcc-option-fomit-frame-pointer\u003c/dd\u003e\n    \u003cdt\u003e\"3.10 Options That Control Optimization\"\u003c/dt\u003e\n    \u003cdd\u003ehttps://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Optimize-Options.html\u003c/dd\u003e\n\u003c/dl\u003e\n\nKeywords\n--------\n\n    call graph, asm, disassembly, elf, graphviz, name mangling\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlyuser%2Fgen-callgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonlyuser%2Fgen-callgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlyuser%2Fgen-callgraph/lists"}