{"id":34653920,"url":"https://github.com/tontinton/panther","last_synced_at":"2025-12-24T18:00:20.552Z","repository":{"id":54398975,"uuid":"299420070","full_name":"tontinton/panther","owner":"tontinton","description":"A shellcode compiler","archived":false,"fork":false,"pushed_at":"2021-04-17T17:55:09.000Z","size":38944,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-05T19:34:14.013Z","etag":null,"topics":["bytecode","compiler","language","llvm","nim","nim-lang","parser","shellcode","shellcode-development"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tontinton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-28T20:09:04.000Z","updated_at":"2023-03-17T08:36:48.000Z","dependencies_parsed_at":"2022-08-13T14:30:49.066Z","dependency_job_id":null,"html_url":"https://github.com/tontinton/panther","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/tontinton/panther","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontinton%2Fpanther","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontinton%2Fpanther/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontinton%2Fpanther/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontinton%2Fpanther/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tontinton","download_url":"https://codeload.github.com/tontinton/panther/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontinton%2Fpanther/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005974,"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-12-24T02:00:07.193Z","response_time":83,"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":["bytecode","compiler","language","llvm","nim","nim-lang","parser","shellcode","shellcode-development"],"created_at":"2025-12-24T18:00:14.793Z","updated_at":"2025-12-24T18:00:20.537Z","avatar_url":"https://github.com/tontinton.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./logo.svg\"\u003e\n\n## Introduction\nThe panther language is a language made for exploitations.\n\nIt's main focus is **minimal code size** through code size \noptimizations and compiling directly to a **shellcode** (position independent code).\n\n## Flow\n\n1. **Lexer**: Parse text file into tokens\n2. **Parser**: Parse tokens into AST\n3. **Analyzer**: Validate that the AST is correct panther syntax\n4. **Bytecode**: Parse AST into bytecode\n5. **LLVM**: Parse bytecode into LLVM IR\n6. **Optimizations + Backend**: llvm\n\n## What can it do currently? \nCurrently, the panther binary can compile a single file using the llvm backend, with minimal type inference and type checking.\n\nWhen running the panther compiler on ``main.pan``\n```bash\n# Compile the panther compiler\nnimble build -d:release\n\n# Panther compiles an object file, in this example I compile to a windows COFF\n./panther c -i main.pan -o output.o -t x86_64-pe-windows-coff\n\n# Link the object file to an executable, needed to get rid of relocations\nld -nostartfiles output.o -o output.exe\n\n# Extract the .shell section created by the compiler\nobjcopy -j .shell -O binary output.exe shellcode.bin\n```\n\nWhen ``main.pan`` looks like:\n```rust\nproc _start();  // First function in the shellcode\n\nproc fib(a: s32) -\u003e s32 {\n    if a \u003c 2 {\n        return a;\n    } else {\n        return fib(a - 1) + fib(a - 2);\n    }\n}\n\n// The printf symbol predetermined by an address.\n// In the future I would like to add a feature of searching for a symbol at runtime.\nlet printf = 0x402ba0 as proc(fmt: string, num1: s32, num2: s32);\n\nproc _start() {\n    let i = 1;\n    while i \u003c= 15 {\n        printf(\"%d: %d\\n\", i, fib(i));\n        i = i + 1;\n    }\n}\n```\n\nResults in a shellcode (``shellcode.bin``) that prints the the first 15 fibonnaci numbers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftontinton%2Fpanther","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftontinton%2Fpanther","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftontinton%2Fpanther/lists"}