{"id":18392165,"url":"https://github.com/lethalbit/sycophant","last_synced_at":"2025-04-07T03:33:54.510Z","repository":{"id":172195685,"uuid":"648547156","full_name":"lethalbit/sycophant","owner":"lethalbit","description":"sycophant is an LD_PRELOAD shim for linux with a scripting API to allow for flexible shimming","archived":false,"fork":false,"pushed_at":"2023-06-14T21:37:24.000Z","size":107,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T12:11:56.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lethalbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-06-02T08:16:22.000Z","updated_at":"2023-06-15T14:47:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"094bc040-6564-4907-98ae-804db72e199c","html_url":"https://github.com/lethalbit/sycophant","commit_stats":null,"previous_names":["lethalbit/sycophant"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fsycophant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fsycophant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fsycophant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fsycophant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lethalbit","download_url":"https://codeload.github.com/lethalbit/sycophant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589558,"owners_count":20963019,"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":[],"created_at":"2024-11-06T01:54:33.044Z","updated_at":"2025-04-07T03:33:54.505Z","avatar_url":"https://github.com/lethalbit.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sycophant\n\n\u003e **Warning** Sycophant is still in the alpha stages, and\n\u003e should not be relied upon in any capacity.\n\u003e Not all planned functionality is present yet, and using\n\u003e Sycophant in general may cause stability issues in the target\n\u003e process.\n\nSycophant is a `LD_PRELOAD` library that loads a python interpreter into the target process and exposes mechanisms to install hooks into arbitrary functions and inspect the running process, all from within the ease of use of python.`\n\n\n## Using Sycophant\n\nOnce Sycophant is built, you should have a `sycophant.so` library, by default it will try to import a `sycophant_hooks` module located in either `~/.config/sycophant` or in the current working directory.\n\nIf `~/.config/sycophant` exists, it will automatically be inserted into the front of the `sys.path` allow for various modules/hooks to be stored there and loaded with `SYCOPHANT_MODULE` while not needing them to be in the cwd.\n\n### Sycophant Options\n\nYou can control Sycophants behavior by setting specific environment variables, all of which are prefixed with `SYCOPHANT_` and scrubbed from the environment block before the host process is invoked.\n\n\nThe following table lists the current supported options:\n\n|    Setting Name    |                     Description                     | Value  |\n|--------------------|-----------------------------------------------------|--------|\n| `SYCOPHANT_MODULE` | Specify the hook module you want Sycophant to load. | string |\n\n\n### Sycophant API\n\nThe python module imported by Sycophant to install hooks has a fairly simple API exposed via the `sycophant` module in the file itself.\n\nIt exposes a fairly simple API to allow you to insert hooks at specific addresses, search for symbols in the host process, and a few other utilities.\n\n\n## Configuring and Building\n\nThe following steps describe how to build Sycophant, it should be consistent for Linux, macOS, and Windows, but macOS and Windows remain untested.\n\n**NOTE:** The minimum C++ standard to build Sycophant is C++17.\n\n### Prerequisites\n\nTo build Sycophant, ensure you have the following build time dependencies:\n * git\n * meson\n * ninja\n * g++ \u003e= 11 or clang++ \u003e= 11\n\n### Configuring\n\nYou can build Sycophant with the default options, all of which can be found in [`meson_options.txt`](meson_options.txt). You can change these by specifying `-D\u003cOPTION_NAME\u003e=\u003cVALUE\u003e` at initial meson invocation time, or with `meson configure` in the build directory post initial configure.\n\nTo change the install prefix, which is `/usr/local` by default ensure to pass `--prefix \u003cPREFIX\u003e` when running meson for the first time.\n\nIn either case, simply running `meson build` from the root of the repository will be sufficient and place all of the build files in the `build` subdirectory.\n\n### Building\n\nOnce you have configured Sycophant appropriately, to simply build and install simply run the following:\n\n```\n$ ninja -C build\n$ ninja -C build test # Optional: Run Tests\n$ ninja -C build install\n```\n\nThis will build and install Sycophant into the default prefix which is `/usr/local`, to change that see the configuration steps above.\n\n### Notes to Package Maintainers\n\nIf you are building Sycophant for inclusion in a distributions package system then ensure to set `DESTDIR` prior to running meson install.\n\nThere is also a `bugreport_url` configuration option that is set to this repositories issues tracker by default, it is recommended to change it to your distributions bug tracking page.\n\n\n## License\n\nSycophant is licensed under the [BSD 3-Clause](https://spdx.org/licenses/BSD-3-Clause.htm) license. The full text of the license can be found in the [`LICENSE`](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flethalbit%2Fsycophant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flethalbit%2Fsycophant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flethalbit%2Fsycophant/lists"}