{"id":27005731,"url":"https://github.com/hanilr/variation-bin","last_synced_at":"2025-10-18T02:47:33.777Z","repository":{"id":280963210,"uuid":"940491351","full_name":"hanilr/variation-bin","owner":"hanilr","description":"Single-header binary analysis library. Written in ansi-c","archived":false,"fork":false,"pushed_at":"2025-03-06T08:06:59.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T09:27:28.759Z","etag":null,"topics":["ansi-c","binary","binary-analysis","c","single-header","single-header-lib","single-header-library"],"latest_commit_sha":null,"homepage":"","language":"C","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/hanilr.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":"2025-02-28T09:16:16.000Z","updated_at":"2025-03-06T08:07:03.000Z","dependencies_parsed_at":"2025-03-06T09:27:30.800Z","dependency_job_id":"a45a5207-d918-46b3-ac48-bb9501e742fd","html_url":"https://github.com/hanilr/variation-bin","commit_stats":null,"previous_names":["hanilr/variation-bin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-bin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-bin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-bin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-bin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanilr","download_url":"https://codeload.github.com/hanilr/variation-bin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135128,"owners_count":20889421,"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":["ansi-c","binary","binary-analysis","c","single-header","single-header-lib","single-header-library"],"created_at":"2025-04-04T07:17:33.922Z","updated_at":"2025-10-18T02:47:33.641Z","avatar_url":"https://github.com/hanilr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003ccenter\u003e \u003cimg src=\"img/vn_blue.png\"\u003e Variation: Binary \u003cimg src=\"img/vn_blue.png\"\u003e \u003c/center\u003e\n\nVariation Binary is single-header binary analysis library. Written in Ansi-c which means `c89` standard version. \n\n\u003e Libraries are written in the ANSI-C standard because the user must be able to use them both in the C89 standard and in higher standards.\n\n\u003cimg src=\"img/vn_info.png\"\u003e Dependencies \u003cimg src=\"img/vn_info.png\"\u003e\n\n* `gcc` _\u003e Gnu Compiler Collection_\n\n* `make` _\u003e Gnu Make_\n\n\u003e In Windows, you should have mingw and gnu make programs. In Linux, you can install easly in teminal via package managers.\n\n### \u003cimg src=\"img/vn_warn.png\"\u003e Important Note \u003cimg src=\"img/vn_warn.png\"\u003e\n\nYou need to define `#define VN_BIN_IMPLEMENTATION` before `#include \"vn_bin.h\"`\n\n```c\n#define VN_BIN_IMPLEMENTATION\n#include \"vn_bin.h\"\n```\n\nIf you installed the library then you should do like this.\n\n```c\n#include \u003cvn/vn_bin.h\u003e\n```\n\n\u003e You can see examples in `demo/` folder.\n\n### \u003cimg src=\"img/vn_example.png\"\u003e Example \u003cimg src=\"img/vn_example.png\"\u003e\n\n```c\n#include \u003cstdio.h\u003e\n\n#define VN_BIN_IMPLEMENTATION\n#include \"vn_bin.h\"\n\nint main(void) {\n    enum Bin_S S_4 = 4;\n    enum Bin_S S_8 = 8;\n    enum Bin_S S_16 = 16;\n    enum Bin_S S_32 = 32;\n    enum Bin_S S_64 = 64;\n    enum Bin_S S_128 = 128;\n\n    struct Bin_T Bin[6];\n    int num[6] = {3, 7, 15, 31, 63, 127};\n\n    Bin[0] = vn_int_to_bin(S_4, num[0]);\n    Bin[1] = vn_int_to_bin(S_8, num[1]);\n    Bin[2] = vn_int_to_bin(S_16, num[2]);\n    Bin[3] = vn_int_to_bin(S_32, num[3]);\n    Bin[4] = vn_int_to_bin(S_64, num[4]);\n    Bin[5] = vn_int_to_bin(S_128, num[5]);\n\n    bin_print(S_4, Bin[0]);\n    bin_print(S_8, Bin[1]);\n    bin_print(S_16, Bin[2]);\n    bin_print(S_32, Bin[3]);\n    bin_print(S_64, Bin[4]);\n    bin_print(S_128, Bin[5]);\n\n    return 0;\n}\n```\n\n### \u003cimg src=\"img/vn_green.png\"\u003e Shared-Library and Default-Library \u003cimg src=\"img/vn_green.png\"\u003e\n\n\u003e Show make list with `make` or `make run` commands.\n\n```bash\nmake run\n```\n\n\u003cimg src=\"img/vn_red.png\"\u003e Compile as Shared-Library \u003cimg src=\"img/vn_red.png\"\u003e\n\n```bash\nmake compile\n```\n\n\u003e This command only compile as `.so` and its for Linux only.\n\n\u003e You can clean compile files with this command.\n\u003e ```bash \n\u003e make clean\n\u003e ```\n\n\u003cimg src=\"img/vn_blue.png\"\u003e Using as Default Library  \u003cimg src=\"img/vn_blue.png\"\u003e\n\n```bash\nmake install\n```\n\n\u003e You can find in /usr/include/vn/\n\n\u003e You can uninstall with this command.\n\u003e ```bash\n\u003e make uninstall\n\u003e ```\n\n\u003cimg src=\"img/vn_wiki.png\"\u003e You can take a look to wiki page if you want learn more \u003cimg src=\"img/vn_warn.png\"\u003e\n\n#### Check Other Variation Libraries\n\n* [Variation: User Interface](https://github.com/hanilr/variation-ui) - A terminal user interface in Ansi-C with widgets.\n\n* [Variation Lite: User Interface](https://github.com/hanilr/variation-lite-ui) - A terminal user interface in Ansi-C with optimize code and no widgets.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanilr%2Fvariation-bin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanilr%2Fvariation-bin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanilr%2Fvariation-bin/lists"}