{"id":13842165,"url":"https://github.com/drosseau/degob","last_synced_at":"2025-07-11T14:31:01.604Z","repository":{"id":57486577,"uuid":"99655755","full_name":"drosseau/degob","owner":"drosseau","description":"Go library/tool for viewing and reversing Go gob data [Moved to GitLab]","archived":false,"fork":false,"pushed_at":"2020-12-16T15:55:15.000Z","size":62,"stargazers_count":40,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T12:45:03.324Z","etag":null,"topics":["binary-data","binary-decoding","go","gob","golang"],"latest_commit_sha":null,"homepage":"https://gitlab.com/drosseau/degob","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drosseau.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}},"created_at":"2017-08-08T05:59:22.000Z","updated_at":"2023-12-08T18:33:26.000Z","dependencies_parsed_at":"2022-09-01T21:02:30.823Z","dependency_job_id":null,"html_url":"https://github.com/drosseau/degob","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drosseau/degob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drosseau%2Fdegob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drosseau%2Fdegob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drosseau%2Fdegob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drosseau%2Fdegob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drosseau","download_url":"https://codeload.github.com/drosseau/degob/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drosseau%2Fdegob/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264833273,"owners_count":23670617,"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":["binary-data","binary-decoding","go","gob","golang"],"created_at":"2024-08-04T17:01:28.553Z","updated_at":"2025-07-11T14:31:01.300Z","avatar_url":"https://github.com/drosseau.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# degob\n\ndegob is a reversing tool for `gob`s. If you have the binary form of a gob, but you don't have to `struct` to decode it into, this library still allows you to get a more readable representation of the data.\n\n## cmds/degob\n\nThe easiest way to use all of this is to just build the binary in `cmds/degob` and send gobs to it either through `stdin` or from files and then get the output to `stdout` or to a file. See its [README](cmds/degob/README.md) for more info.\n\nSetting environmental variable `DEGOB_NORAND=1` will stop the anonymous structs from having that hex suffix. The number stays because that is the type ID defined in the gob. `DEGOB_SEED` sets a specific seed value.\n\n## Usage\n\nCreate a new `Decoder` over your reader using `NewDecoder` and then decode that into a slice of `Gob`s with `Decode` or stream `Gob`s with `DecodeStream`. `DecodeStream` seems fairly stable, but it was difficult to test how it handles all error cases, so be wary of errors. Once you have `Gob`s you can either play with the types directly or just print them out to a writer using the `WriteTypes` and `WriteValues` methods.\n\nThe output from the Write methods on Gob should be close to valid Go source.\n\nThe provided `degob` command provides a straightforward [sample usage](cmds/degob/main.go).\n\n### Limitations\n\nThere are a few limitations that I can't really get around.\n\n- gobs don't include information about the bit size of the type so all types are their largest possible (`int64`, `uint64`, `complex128`, `float64`) so as to be able to accept anything. This means that the representations you get aren't exactly the representations that the source was using with respect to bitsizes.\n- `byte`s are received as `uint64`, but `[]byte` is correct. There is no type id for a single `byte` in the gob format.\n- There is no way to differentiate between a type and a pointer to that type.\n- There is an included `JSON` output format, but, since a gob can be any valid Go type, there are plenty of valid gobs that cannot be accurately represented as JSON. Simple types will not print valid JSON. Bad map types will return an error JSON that contains the `SingleLine` format of the map under `val`.\n- `GobEncoder`, `TextEncoder`, and `BinaryMarshaler` are all displayed as `[]byte` since the format is opaque without the actual type definition.\n\n## TODO\n\n- Printing stylized output\n- Some more testing (I'm around ~80%)\n- Include more \"bad gob\" tests, but to be honest this tool shouldn't be seeing very many bad gobs. It isn't really meant to be doing much validating, so this is pretty low priority, and part of the reason I'm OK with some of the panics and lack of testing around bad gobs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrosseau%2Fdegob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrosseau%2Fdegob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrosseau%2Fdegob/lists"}