{"id":25490279,"url":"https://github.com/tashcan/spud","last_synced_at":"2025-04-09T23:10:02.935Z","repository":{"id":191297865,"uuid":"676211064","full_name":"tashcan/spud","owner":"tashcan","description":"just some stuff to do hooking/detour things","archived":false,"fork":false,"pushed_at":"2025-01-16T19:38:09.000Z","size":2101,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T20:23:55.126Z","etag":null,"topics":["cpp","detour","hooking","hooking-library","modding","modding-library"],"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/tashcan.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-08-08T17:17:46.000Z","updated_at":"2025-01-16T19:38:11.000Z","dependencies_parsed_at":"2023-08-29T07:58:58.382Z","dependency_job_id":"303d2338-8315-43cb-8e63-b4b8fb3a97fc","html_url":"https://github.com/tashcan/spud","commit_stats":null,"previous_names":["tashcan/spud"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashcan%2Fspud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashcan%2Fspud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashcan%2Fspud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashcan%2Fspud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tashcan","download_url":"https://codeload.github.com/tashcan/spud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239552921,"owners_count":19658018,"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":["cpp","detour","hooking","hooking-library","modding","modding-library"],"created_at":"2025-02-18T21:27:41.863Z","updated_at":"2025-02-18T21:27:43.195Z","avatar_url":"https://github.com/tashcan.png","language":"C++","readme":"\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/tashcan/spud/main/assets/img/logo-dark.svg\" width=\"400px\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/tashcan/spud/main/assets/img/logo-light.svg\" width=\"400px\"\u003e\n    \u003cimg alt=\"spud logo\" src=\"https://raw.githubusercontent.com/tashcan/spud/main/assets/img/logo-dark.svg\" width=\"400px\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License: MIT\"\u003e\n  \u003ca href=\"https://github.com/tashcan/spud/actions\"\u003e\u003cimg src=\"https://github.com/tashcan/spud/actions/workflows/build-and-test.yaml/badge.svg\" alt=\"GitHub Actions\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003espud\u003c/b\u003e - multi-architecture cross-platform hooking library.\n\u003c/p\u003e\n\n## Features\n\n- **x86-64 and arm64 support**\n- **Windows, Mac and Linux support**\n\n## Building\n\n### With CMake (as a subproject)\n\nClone repository to subfolder and link `spud` to your project:\n```cmake\nadd_subdirectory(path/to/spud)\ntarget_link_libraries(your-project-name PRIVATE spud)\n```\n\n## Examples\n\n-  Simple example\n```c++\nvoid hook(auto original, int n) {\n  if (n == 0) {\n    // Run some custom code here\n    return;\n  }\n  // Forward to the original code\n  return original(n);\n}\n\nvoid test_function(int n) {\n  if (n == 0) {\n    printf(\"N was 0\\n\");\n  }\n  printf(\"%d\\n\", n);\n}\n\nSPUD_STATIC_DETOUR(test_function, hook);\n```\n\n## Build \u0026 Install\n\n`spud` can be easily added to any cmake-based project. Just add a few lines in `CMakeLists.txt`.\n\n```cmake\nFetchContent_Declare(\n      spud\n      GIT_REPOSITORY \"https://github.com/tashcan/spud.git\"\n      GIT_TAG origin/main\n)\nFetchContent_MakeAvailable(spud)\n```\n\n## Documentation\n\nFeel free to browse through [tests](https://github.com/tashcan/spud/tree/main/tests) and [benchmark](https://github.com/tashcan/spud/tree/main/benchmark) if you just want to get a quick glance and some example code.\n\nOtherwise head over to https://spud.tashcan.com/ for a more in-depth documentation\n\n## Missing features\n\n- Easy way to patch VTables\n- Memory Manipulation facilities\n- Import Table Patching\n\n## References\n\n- [catch2](https://github.com/catchorg/Catch2) for unit-testing\n- [asmjit](https://github.com/asmjit/asmjit) for code-gen on x86 and arm\n- [zydis](https://github.com/zyantific/zydis) for disassembling x86 code\n- [x86](http://ref.x86asm.net/coder32.html) and [x86-64](http://ref.x86asm.net/coder64.html) opcode and instruction reference\n\n## License\n\n- MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftashcan%2Fspud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftashcan%2Fspud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftashcan%2Fspud/lists"}