{"id":19851897,"url":"https://github.com/stackoverflowexcept1on/function-interceptor","last_synced_at":"2025-02-28T21:16:18.026Z","repository":{"id":138029427,"uuid":"602250271","full_name":"StackOverflowExcept1on/function-interceptor","owner":"StackOverflowExcept1on","description":"hooking functions with funchook library","archived":false,"fork":false,"pushed_at":"2023-02-23T19:06:17.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T13:24:01.332Z","etag":null,"topics":["cmake","cpp20","hooking-template","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"C++","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/StackOverflowExcept1on.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-15T20:12:57.000Z","updated_at":"2023-02-20T19:21:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"38d7b173-e76d-4938-bf43-1fc45bb675db","html_url":"https://github.com/StackOverflowExcept1on/function-interceptor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Ffunction-interceptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Ffunction-interceptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Ffunction-interceptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Ffunction-interceptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StackOverflowExcept1on","download_url":"https://codeload.github.com/StackOverflowExcept1on/function-interceptor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241240754,"owners_count":19932613,"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":["cmake","cpp20","hooking-template","reverse-engineering"],"created_at":"2024-11-12T13:33:08.262Z","updated_at":"2025-02-28T21:16:18.003Z","avatar_url":"https://github.com/StackOverflowExcept1on.png","language":"C++","readme":"### function-interceptor\n\n[![Build Status](https://github.com/StackOverflowExcept1on/function-interceptor/actions/workflows/ci.yml/badge.svg)](https://github.com/StackOverflowExcept1on/function-interceptor/actions/workflows/ci.yml)\n\nThis project demonstrates how to hook functions through the [funchook](https://github.com/kubo/funchook) library\n\n### Requirements\n\n- g++ compiler\n- cmake\n- python3\n- frida: https://frida.re\n\n### Preparing\n\n```bash\n# install dependencies\npip install frida\n\n# change the ptrace_scope for frida\nsudo sysctl kernel.yama.ptrace_scope=0\n\n# build c++ project\n./build.sh\n```\n\n### Running\n\n```bash\n# run program (it is assumed that in different terminals)\nLD_LIBRARY_PATH=./build/bin ./build/bin/program\n\n# attach `./build/bin/libhook.so` to `$(pidof program)`\n./scripts/loader.py $(pidof program) ./build/bin/libhook.so\n```\n\n```\nexampleFunction(a=1, b=2, c=3)\nret = 48\n\nhandle = 0x7f79317921e0\nexampleFunction_original = 0x7f793178e120\n\nexampleFunction(a=1, b=2, c=3)\n[+] org ret = 48\n[+] exampleFunction_hook(a=1, b=2, c=3)\nret = 42\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackoverflowexcept1on%2Ffunction-interceptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackoverflowexcept1on%2Ffunction-interceptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackoverflowexcept1on%2Ffunction-interceptor/lists"}