{"id":19851897,"url":"https://github.com/stackoverflowexcept1on/function-interceptor","last_synced_at":"2026-06-08T01:01:50.933Z","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-02-28T23:22:27.532Z","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":"fa4ada42-47fa-427d-85c6-897a4726beab","html_url":"https://github.com/StackOverflowExcept1on/function-interceptor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StackOverflowExcept1on/function-interceptor","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","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Ffunction-interceptor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34043822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cmake","cpp20","hooking-template","reverse-engineering"],"created_at":"2024-11-12T13:33:08.262Z","updated_at":"2026-06-08T01:01:50.928Z","avatar_url":"https://github.com/StackOverflowExcept1on.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"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/StackOverflowExcept1on/funchook) library\n\n### Requirements\n\n- g++ / msvc compiler\n- cmake\n- python3\n- frida: https://frida.re\n\n### Preparing (Linux)\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### Preparing (Windows)\n\n```bat\nREM install dependencies\npip install frida\n\nREM build c++ project\nbuild.bat\n```\n\n### Running (Linux)\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### Running (Windows)\n\n```bat\nREM run program (it is assumed that in different terminals)\n.\\build\\bin\\program.exe\n\nREM find the PID\nfrida-ps\n\nREM attach .\\build\\bin\\hook.dll to PID\npython .\\scripts\\loader.py PID .\\build\\bin\\hook.dll\n```\n\n### Output\n\n```\nexampleFunction(a=1, b=2, c=3)\nret = 48\n\nhandle = 0x7f79317921e0\nexampleFunction_original = 0x7f793178e120\n[+] done\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","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"}