{"id":15724469,"url":"https://github.com/jshrake/hearthstone-capture","last_synced_at":"2025-08-15T19:06:12.611Z","repository":{"id":57601568,"uuid":"48923899","full_name":"jshrake/hearthstone-capture","owner":"jshrake","description":"Stream Hearthstone PegasusPackets to stdout","archived":false,"fork":false,"pushed_at":"2016-01-02T21:20:08.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T01:14:39.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jshrake.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":"2016-01-02T21:07:31.000Z","updated_at":"2017-01-24T11:13:29.000Z","dependencies_parsed_at":"2022-09-26T20:00:40.363Z","dependency_job_id":null,"html_url":"https://github.com/jshrake/hearthstone-capture","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jshrake/hearthstone-capture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthstone-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthstone-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthstone-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthstone-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshrake","download_url":"https://codeload.github.com/jshrake/hearthstone-capture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthstone-capture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270617819,"owners_count":24617121,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"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":[],"created_at":"2024-10-03T22:16:46.534Z","updated_at":"2025-08-15T19:06:12.568Z","avatar_url":"https://github.com/jshrake.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hearthstone-capture\n\nStream Hearthstone PegasusPackets to stdout\n\n## Install\n\nRequires [golang](https://golang.org/)\n```bash\ngit clone https://github.com/jshrake/hearthstone-db\ncd hearthstone-db\nmake install\n```\n\n## Usage\n\nRequires privledge escalation for packet capturing:\n\n`[sudo] hearthstone-capture [-snaplen=1600 -filter=\"tcp port 3724 or tcp port 1119\"]`\n\n- `snaplen`: [Snapshot Length](https://wiki.wireshark.org/SnapLen). Defaults to `1600`\n- `filter`: [Berkley Packet Filter](http://biot.com/capstats/bpf.html). Defaults to `tcp port 3724 or tcp port 1119`\n\n## PegasusPacket format\n\n```c\nstruct PegasusPacket {\n\tuint32_t type;\n\tuint32_t size;\n\tuint8_t *message;\n};\n```\n\n- The first 4 bytes are the message type\n- The next 4 bytes are the message size\n- The remaining size bytes are the [protocol buffer encoded message](https://developers.google.com/protocol-buffers/)\n\nThe decompiled protocol buffer message definitions can be found at [HearthSim/hs-proto](https://github.com/HearthSim/hs-proto). Of particular interest are the messages defined in [PegasusGame](https://github.com/HearthSim/hs-proto/blob/e7a26141e2e8d27404e6da9c224934bd3c407b43/pegasus/game.proto).\n\nThe PegausPacket type corresponds to the message `PacketID`. For instance, a PegasusPacket type of 19 corresponds to a [PowerHistory message](https://github.com/HearthSim/hs-proto/blob/e7a26141e2e8d27404e6da9c224934bd3c407b43/pegasus/game.proto#L264-L266).\n\nHere's a handcrafted map from type to message name to get you started:\n\n```json\n{\n\t\"1\": \"GetGameState\",\n\t\"2\": \"ChooseOption\",\n\t\"3\": \"ChooseEntities\",\n\t\"11\": \"Concede\",\n\t\"13\": \"EntitiesChosen\",\n\t\"14\": \"AllOptions\",\n\t\"15\": \"UserUI\",\n\t\"16\": \"GameSetup\",\n\t\"17\": \"EntityChoices\",\n\t\"19\": \"PowerHistory\",\n\t\"24\": \"SpectatorNotify\",\n\t\"115\": \"Ping\",\n\t\"116\": \"Pong\",\n\t\"168\": \"Handshake\"\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshrake%2Fhearthstone-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshrake%2Fhearthstone-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshrake%2Fhearthstone-capture/lists"}