{"id":15398617,"url":"https://github.com/cr0a3/formatic","last_synced_at":"2025-07-05T09:35:06.034Z","repository":{"id":232063293,"uuid":"782117431","full_name":"Cr0a3/Formatic","owner":"Cr0a3","description":"A easy to use Coff/Elf/Macho object file creator","archived":false,"fork":false,"pushed_at":"2024-04-25T07:26:21.000Z","size":75,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T01:04:33.266Z","etag":null,"topics":["codegen","coff","elf","macho","object-file","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/formatic","language":"Rust","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/Cr0a3.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":"2024-04-04T17:08:37.000Z","updated_at":"2025-03-21T08:48:24.000Z","dependencies_parsed_at":"2024-04-07T19:24:45.141Z","dependency_job_id":"cf52f86d-846c-4a2a-a32b-56a3c6797e17","html_url":"https://github.com/Cr0a3/Formatic","commit_stats":null,"previous_names":["toni-graphics/formatic","cr0a3/formatic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cr0a3/Formatic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cr0a3%2FFormatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cr0a3%2FFormatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cr0a3%2FFormatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cr0a3%2FFormatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cr0a3","download_url":"https://codeload.github.com/Cr0a3/Formatic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cr0a3%2FFormatic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261064425,"owners_count":23104724,"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":["codegen","coff","elf","macho","object-file","rust"],"created_at":"2024-10-01T15:44:51.296Z","updated_at":"2025-06-21T04:37:25.874Z","avatar_url":"https://github.com/Cr0a3.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formatic\n\nA libary for creating object files\n\n## Example\n\n```rust\nuse formatic::{Arch, BinFormat, Decl, Endian, Link, ObjectBuilder, Scope};\n\npub fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let mut obj = ObjectBuilder::new(\"test.o\");\n\n    obj.decls(vec![\n        (\"callme\", Decl::Function(Scope::Import)),\n        (\"call\", Decl::Function(Scope::Export)),\n        (\"data\", Decl::Data(Scope::Export)),\n    ]);\n\n    obj.define(\n        \"call\",\n        vec![\n            0xF3, 0x0F, 0x1E, 0xFA,         // endbr64\n            0x55,                           // push rbp\n            0x48, 0x89, 0xE5,               // mov rbp, rsp\n            0xE8, 0x00, 0x00, 0x00, 0x00,   // call callme\n            0x5D,                           // pop rbp\n            0xC3,                           // ret\n        ],\n    );\n\n    obj.define(\"data\", \n        b\"Hello World\".into()\n    );\n\n    obj.link(Link {\n        from: \"call\".into(),\n        to: \"callme\".into(),\n        at: 9,\n    });\n\n    obj.write(BinFormat::host(), Arch::host(), Endian::host())?;\n\n    Ok(())\n}\n```\n\nWhich gives the expected output:\n```bash\ncargo run --example simple\nbingrep test.o\n```\n\n```\nELF REL X86_64-little-endian @ 0x0:\n\ne_phoff: 0x0 e_shoff: 0x150 e_flags: 0x0 e_ehsize: 64 e_phentsize: 0 e_phnum: 0 e_shentsize: 64 e_shnum: 7 e_shstrndx: 6\n\nProgramHeaders(0):\n  Idx   Type   Flags   Offset   Vaddr   Paddr   Filesz   Memsz   Align  \n\nSectionHeaders(7):\n  Idx   Name                      Type   Flags              Offset   Addr   Size    Link         Entsize   Align  \n  0                           SHT_NULL                      0x0      0x0    0x0                  0x0       0x0    \n  1     .text.call        SHT_PROGBITS   ALLOC EXECINSTR    0x40     0x0    0x10                 0x0       0x10   \n  2     .rela.text.call       SHT_RELA   INFO_LINK          0xf8     0x0    0x18    .symtab(4)   0x18      0x8    \n  3     .rodata.value     SHT_PROGBITS   ALLOC              0x50     0x0    0xb                  0x0       0x10   \n  4     .symtab             SHT_SYMTAB                      0x60     0x0    0x78    .strtab(5)   0x18      0x8    \n  5     .strtab             SHT_STRTAB                      0xd8     0x0    0x1a                 0x0       0x1    \n  6     .shstrtab           SHT_STRTAB                      0x110    0x0    0x39                 0x0       0x1    \n\nSyms(5):\n               Addr   Bind       Type        Symbol   Size    Section            Other  \n                 0    LOCAL      NOTYPE               0x0                        0x0    \n                 0    LOCAL      FILE        test.o   0x0     ABS                0x0    \n                 0    GLOBAL     NOTYPE      callme   0x0                        0x0    \n                 0    GLOBAL     FUNC        call     0x10    .text.call(1)      0x2    \n                 0    GLOBAL     OBJECT      value    0xb     .rodata.value(3)   0x2    \n\nDyn Syms(0):\nDynamic Relas(0):\n\nDynamic Rel(0):\n\nPlt Relocations(0):\n\nShdr Relocations(1):\n  .text.call(1)\n               9 X86_64_PLT32 callme+-4\n\n\nDynamic: None\n\n\nLibraries(0):\n\nSoname: None\nInterpreter: None\nis_64: true\nis_lib: false\nlittle_endian: true\nentry: 0\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0a3%2Fformatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcr0a3%2Fformatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0a3%2Fformatic/lists"}