{"id":16788474,"url":"https://github.com/zeebo/goof","last_synced_at":"2025-08-08T14:22:21.220Z","repository":{"id":41519372,"uuid":"88675479","full_name":"zeebo/goof","owner":"zeebo","description":"Goof (Go Object Finder) is a package that does the unthinkable to your binary","archived":false,"fork":false,"pushed_at":"2024-05-28T18:01:48.000Z","size":26,"stargazers_count":153,"open_issues_count":3,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-14T08:17:57.520Z","etag":null,"topics":["dwarf","go","golang","unsafe"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeebo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-04-18T22:20:06.000Z","updated_at":"2024-09-05T21:21:23.000Z","dependencies_parsed_at":"2024-05-28T20:40:50.015Z","dependency_job_id":"de390e32-efbf-4d9e-9a35-028f75339863","html_url":"https://github.com/zeebo/goof","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/zeebo%2Fgoof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeebo%2Fgoof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeebo%2Fgoof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeebo%2Fgoof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeebo","download_url":"https://codeload.github.com/zeebo/goof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240766621,"owners_count":19854119,"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":["dwarf","go","golang","unsafe"],"created_at":"2024-10-13T08:17:59.514Z","updated_at":"2025-02-26T00:09:54.773Z","avatar_url":"https://github.com/zeebo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goof\n\nGoof lets you call functions in your binary with just the string of their\nname. How?\n\n```go\nvar troop goof.Troop\nout, err := troop.Call(\"fmt.Fprintf\", os.Stdout, \"hello %s\", []interface{}{\"world\"})\nif err != nil { // some error calling the function\n\treturn err\n}\nn, err := out[0].(int), out[1].(error)\nif err != nil {\n\treturn err\n}\nfmt.Printf(\"wrote %d bytes\\n\", n)\n```\n\nCaveat: you have to have called `fmt.Fprintf` elsewhere in your binary.\n\nGoof lets you get access to globals in your binary with just the string of\ntheir name. How?\n\n```go\nvar troop goof.Troop\nrv, err := troop.Global(\"net/http.DefaultServeMux\")\nif err != nil { // couldn't find it\n\treturn err\n}\n// rv contains an addressable reflect.Value of the default ServeMux!\n```\n\nCaveat: the global must be used elsewhere in the binary somehow.\n\nGoof lets you get access to all of the `reflect.Type`s in your binary. How?\n\n```go\nvar troop goof.Troop\ntypes, err := troop.Types()\nif err != nil { // something went wrong getting them\n\treturn err\n}\nfor _, typ := range types {\n\tfmt.Println(typ)\n}\n```\n\nCaveat: the types must be possible outputs to `reflect.TypeOf(val)` in your binary.\n\n## Usage\n\nYou should probably just make a single `Troop` in your binary and use that\neverywhere since it does a lot of caching and work on first use.\n\n## How?\n\nIt loads up the dwarf information of any binary it's loaded in and then does\na bunch of unsafe tom foolery to perform these dirty deeds. How unsafe is it?\n\n- Reusing needles unsafe.\n- Jumping into a shark tank with a steak swimming suit unsafe.\n- Carnival ride unsafe.\n- Driving on the wrong side of the highway blindfolded unsafe.\n\n## Should I use this?\n\nDo you really have to ask? OF COURSE! If you do, please let me know what terrible\nidea this enabled. I'm very interested.\n\n## Testimonials\n\n\u003e \"I can't wait to get some goof in my [manhole](https://github.com/jtolds/go-manhole)!\" - [@jtolds](https://github.com/jtolds)\n\n\u003e \"README is hilarious :joy:\"\n\n\u003e \"Now I just need to come up with something horrendously risky to use this for...\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeebo%2Fgoof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeebo%2Fgoof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeebo%2Fgoof/lists"}