{"id":13626573,"url":"https://github.com/kubkon/zig-dis-x86_64","last_synced_at":"2025-09-12T03:17:56.998Z","repository":{"id":38297831,"uuid":"497851367","full_name":"kubkon/zig-dis-x86_64","owner":"kubkon","description":"x86_64 disassembler library written in Zig","archived":false,"fork":false,"pushed_at":"2025-07-21T14:55:19.000Z","size":336,"stargazers_count":39,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-21T16:43:45.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/kubkon.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,"zenodo":null}},"created_at":"2022-05-30T08:19:24.000Z","updated_at":"2025-07-21T14:55:23.000Z","dependencies_parsed_at":"2023-11-21T23:25:59.042Z","dependency_job_id":"14772a8c-e6b6-47f1-b28c-821945bf6c6c","html_url":"https://github.com/kubkon/zig-dis-x86_64","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kubkon/zig-dis-x86_64","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dis-x86_64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dis-x86_64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dis-x86_64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dis-x86_64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubkon","download_url":"https://codeload.github.com/kubkon/zig-dis-x86_64/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dis-x86_64/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274747691,"owners_count":25341936,"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-09-12T02:00:09.324Z","response_time":60,"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-08-01T21:02:24.098Z","updated_at":"2025-09-12T03:17:56.949Z","avatar_url":"https://github.com/kubkon.png","language":"Zig","funding_links":[],"categories":["Zig","Libraries"],"sub_categories":[],"readme":"# zig-dis-x86_64\nx86_64 disassembler library written in Zig\n\n## What is it?\n\nYou can use this library to disassemble and encode x86_64 machine code.\n\n## Why is it?\n\nI needed a simple disassembler for linker optimisations in `zig ld` for x86_64.\n\n## Basic usage\n\nDisassembling input byte buffer:\n\n```zig\nconst std = @import(\"std\");\nconst Disassembler = @import(\"dis_x86_64\").Disassembler;\n\nvar disassembler = Disassembler.init(\u0026.{\n    0x40, 0xb7, 0x10,  // mov dil, 0x10\n    0x48, 0x8b, 0xd8,  // mov rbx, rax\n});\n\nvar text = std.ArrayList(u8).init(gpa);\ndefer text.deinit();\n\nwhile (try disassembler.next()) |inst| {\n    try text.writer().print(\"{}\\n\", .{inst});\n}\n\ntry std.testing.expectEqualStrings(\n    \\\\mov dil, 0x10\n    \\\\mov rbx, rax\n, text.items);\n```\n\nEncoding instructions back to machine code:\n\n```zig\nconst std = @import(\"std\");\nconst Instruction = @import(\"dis_x86_64\").Instruction;\nconst RegisterOrMemory = @import(\"dis_x86_64\").RegisterOrMemory;\n\nvar code = std.ArrayList(u8).init(gpa);\ndefer code.deinit();\n\nconst inst = Instruction{\n    .tag = .mov,\n    .enc = .mi,\n    .data = Instruction.Data.mi(RegisterOrMemory.reg(.rbx), 0x4),\n};\ntry inst.encode(code.writer());\n\ntry std.testing.expectEqualSlices(u8, \"\\x48\\xc7\\xc3\\x04\\x00\\x00\\x00\", code.items);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubkon%2Fzig-dis-x86_64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubkon%2Fzig-dis-x86_64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubkon%2Fzig-dis-x86_64/lists"}