{"id":22393069,"url":"https://github.com/mkcms/emacs-binary-utils","last_synced_at":"2025-04-13T05:46:06.802Z","repository":{"id":226462765,"uuid":"578555878","full_name":"mkcms/emacs-binary-utils","owner":"mkcms","description":"Packages for working with binary files in Emacs","archived":false,"fork":false,"pushed_at":"2025-03-31T11:11:37.000Z","size":340,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T05:46:02.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkcms.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":"2022-12-15T10:37:04.000Z","updated_at":"2025-03-31T11:11:41.000Z","dependencies_parsed_at":"2024-05-20T20:17:47.715Z","dependency_job_id":"ca1d8fb2-4378-4e00-9723-45e98350a63c","html_url":"https://github.com/mkcms/emacs-binary-utils","commit_stats":null,"previous_names":["mkcms/emacs-binary-utils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkcms%2Femacs-binary-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkcms%2Femacs-binary-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkcms%2Femacs-binary-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkcms%2Femacs-binary-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkcms","download_url":"https://codeload.github.com/mkcms/emacs-binary-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670513,"owners_count":21142901,"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":[],"created_at":"2024-12-05T04:22:33.513Z","updated_at":"2025-04-13T05:46:06.794Z","avatar_url":"https://github.com/mkcms.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emacs-binary-utils #\n\nThis repository contains a bunch of Emacs packages for working with binary\nfiles:\n\n- [`binfile.el`](#binfileel---prettify-disassembly)\n- [`bdx.el`](#bdxel---frontend-for-bdx)\n- [`asm-data.el`](#asm-datael---conversion-between-data-representations-in-asm-buffers)\n- [`asm-jump.el`](#asm-jumpel---buttons-for-jumps-in-asm-mode)\n- [`asm2src.el`](#asm2srcel---asm-to-source-file-overlays)\n- [`compiled-file.el`](#compiled-fileel---getset-the-compiled-file-for-current-source-file)\n- [`compdb.el`](#compdbel---work-with-compilation-databases)\n\n## `binfile.el` - Prettify disassembly ##\n\nThis package provides the function `binfile-postprocess-buffer` which\nprettifies objdump disassembly in the current buffer and makes it easier to\nread and follow by stripping addresses, adding labels for jump targets,\nremoving useless comments, and some other things.\n\nBy default it works on objdump output (and is optimized for x86 architecture)\nbut you can set `binfile-region-postprocessing-functions`,\n`binfile-region-postprocessing-functions-alist` and\n`binfile-file-format-function` for your own needs to work with different\ndisassemblers/architectures.\n\n## `bdx.el` - Frontend for bdx ##\n\n[bdx][bdx] is an indexer for ELF files.\n\nThe `bdx.el` package provides an Emacs frontend for the command line tool, and\nallows quickly finding and disassembling symbols even in huge repositories.\n\nThis package interactively displays a list of matched symbols as the user\ntypes.\n\nThe commands defined in it are:\n\n- `bdx-disassemble`\n\n  Read a bdx query from the user with `ivy`, and use `binfile` (or a custom\n  function) to disassemble the selected symbol.\n\n- `bdx-show-graph-xdg-open`\n\n  Read two queries from user, START and GOAL, and use `bdx` to generate an\n  image of a graph that connects symbols matching START and GOAL, then display\n  that image.\n\nIt also provides these API functions:\n\n- `bdx-query`\n\n  Read a bdx query from the user, interactively displaying results, and return\n  symbol data.\n\n- `bdx-generate-graph`\n\n  Generate graph from two queries, and write it (in DOT format) to the current\n  buffer.\n\n- `bdx-generate-graph-image`\n\n  Generate a graph image from two queries, and return it's path.\n\n## `asm-data.el` - Conversion between data representations in ASM buffers ##\n\nThis package lets you change the way data is represented in ASM buffers.  For\nexample, when the buffer contains:\n\n```asm\n.4byte 1819043176\n.byte 111\n.byte 0\n```\n\ncalling `asm-data-convert` and selecting the \".asciz\" directive changes that\nto:\n\n```asm\n.asciz \"hello\"\n```\n\nThis representation can again be changed, e.g. to 2byte (here called with a\nprefix argument for hexadecimal number representation):\n\n```asm\n.2byte 0x6568\n.2byte 0x6c6c\n.2byte 0x006f\n```\n\nIt can convert data to .ascii, .asciz, .byte, .2byte, .4byte, .8byte, .octa\n(16-byte), .single and .zero GAS directives.\n\nIntegers can be converted to unsigned/signed decimal/hex/binary\nrepresentation.\n\nFloating-point directive .single assumes 32-bit floats.\n\nThe variable `asm-data-endianness` controls the type of numbers\u003c-\u003ebytes\nconversion.\n\n## `asm-jump.el` - Buttons for jumps in ASM mode ##\n\nThis package provides the function `asm-jump-process-buffer` which scans the\ncurrent buffer for ASM jump statements and makes buttons for them.\n\nThe action for buttons created by this function will search the current buffer\nfor the referenced label and move the point there.\n\nAnother command, `asm-jump-reverse` finds the first jump statement to the\ncurrent label.\n\n## `asm2src.el` - ASM to source file overlays ##\n\nThis package allows you to jump from ASM buffer to a source file and vice\nversa.\n\n`asm2src-process-buffer` is the main function which scans the current ASM\nbuffer for file mappings, it must be called once before further usage.\n\nWhen using `binfile` and the rest of the packages here, you should add:\n\n    (setq bdx-disassembler-options\n          (concat bdx-disassembler-options \" --line-numbers\"))\n    (add-hook 'binfile-buffer-postprocessing-functions\n              #'asm2src-process-buffer)\n\nTo your init file.  The first sexp makes objdump output source file mappings\nwhen dumping disassembly, and the second makes sure we can parse and use that\nin Emacs.\n\n`asm2src-jump` allows you to jump to the source buffer from the preprocessed\nASM buffer.  It sets a transient keymap, `asm2src-jump-keymap` for the duration\nof the command: `C-c C-c` or `RET` goes to the source file, `p` goes to the\nprevious mapped location, `n` goes to the next.\n\n`asm2src-jump-to-asm` is the inverse, it should be invoked in a source file and\nwill go to the first ASM buffer containing the source line.\n\n`asm2src-add-mapping` can be used to add a custom ASM\u003c-\u003esource directory mapping.\n\n## `compiled-file.el` - Get/set the compiled file for current source file ##\n\nThis helper package defines a variable `compiled-file` which can be\nset to the path to the object file for current source file.\n\nIt can also automatically find an object file if the variable\n`compiled-file-directory` is set to the build directory.\n\nHaving the path to a binary file of the current source is used by some\nother packages to automatically switch from source to disassembly and\nvice-versa.\n\n## `compdb.el` - Work with compilation databases ##\n\nThis package provides utilities for working with compilation\ndatabases.\n\nThe main API functions are:\n\n- `compdb-path`\n\nLocate database for FILENAME by scanning directory tree upwards.\n\n- `compdb`\n\nGet parsed compilation database for a project. The return value is\neither nil if the database does not exist, or a hash table.\n\n- `compdb-compile`\n\nCompile the file the current buffer is visiting.\n\n- `compdb-switch`\n\nSwitch the current compilation database. This works by replacing the\ncurrent compilation database with a symbolic link to the new database.\n\n## License ##\n\n```\nCopyright (C) 2022-2025 Michał Krzywkowski\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n[bdx]: https://github.com/mkcms/bdx\n\n\u003c!-- Local Variables: --\u003e\n\u003c!-- coding: utf-8 --\u003e\n\u003c!-- fill-column: 79 --\u003e\n\u003c!-- End: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkcms%2Femacs-binary-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkcms%2Femacs-binary-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkcms%2Femacs-binary-utils/lists"}