{"id":28102259,"url":"https://github.com/urpagin/syslang","last_synced_at":"2026-05-02T02:35:00.500Z","repository":{"id":292588091,"uuid":"981346721","full_name":"Urpagin/syslang","owner":"Urpagin","description":"Invoke Linux syscalls from the CLI + interpret syslang source files.","archived":false,"fork":false,"pushed_at":"2025-08-23T07:51:15.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T19:45:00.798Z","etag":null,"topics":["argument-parsing","cli","command-line","dsl","interpreter","kernel-interfaces","language","linux","low-level","number-types","posix","programming-language","rust","shell","string-types","syscall-arguments","syscall-number","syscalls","syslang","type-hinting"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Urpagin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2025-05-10T22:32:31.000Z","updated_at":"2025-08-23T20:58:08.000Z","dependencies_parsed_at":"2025-05-12T23:25:21.780Z","dependency_job_id":"d6f10498-99aa-4c71-ad1a-2bc0e1d61eac","html_url":"https://github.com/Urpagin/syslang","commit_stats":null,"previous_names":["urpagin/dynamic-syscall","urpagin/syslang"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Urpagin/syslang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fsyslang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fsyslang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fsyslang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fsyslang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urpagin","download_url":"https://codeload.github.com/Urpagin/syslang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fsyslang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32521108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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":["argument-parsing","cli","command-line","dsl","interpreter","kernel-interfaces","language","linux","low-level","number-types","posix","programming-language","rust","shell","string-types","syscall-arguments","syscall-number","syscalls","syslang","type-hinting"],"created_at":"2025-05-13T19:48:52.491Z","updated_at":"2026-05-02T02:35:00.491Z","avatar_url":"https://github.com/Urpagin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Syscalls\n\n## Syslang 🧩\n\nThe project has now evolved into a very simple programming language. You can interpret `.scx` files using the `--interpret \u003cscx source file\u003e` argument.\n\nThe language currently supports:\n\n* One keyword: `syscall`\n* Two data types: numbers like `42` and strings like `\"this is a string\"`\n* Comments: start a line with `#` to write a comment\n\nWhat it doesn't have (yet):\n\n* Variables\n* Loops\n* Functions\n* Transpilation or compilation\n* And more. I'm not even sure if it qualifies as a full programming language at this point. Maybe it's more of a DSL (domain-specific language).\n\n## Purpose 🎯\n\nThe purpose of this project is to reduce the friction involved in making a system call directly from userspace. It allows you to invoke syscalls without the need to write or compile a full C or Rust program. Just provide the syscall number and up to six arguments, and it will do the rest.\n\n## Usage 🛠️\n\nThe first argument is the **syscall number**. You do **not** need to type hint it.\nThe next arguments (up to a maximum of six) **must** be type hinted:\n\n* Use `n:\u003cvalue\u003e` to indicate an unsigned number (`usize`)\n* Use `s:\u003cvalue\u003e` to indicate a string whose pointer should be passed\n\nArguments are passed in the order expected by the syscall.\n\n### Interpreting Syslang source files\n\n* `--interpret \u003c.scx source file\u003e` to interpret the file\n* `--quiet` to enable quiet mode when interpreting a source file (silences any prints)\n\nTo get a grasp on the syntax, check out the `.scx` files under the `examples/` directory.\n\n## Examples 📌\n\nIf you want to use the `write(2)` syscall (instead of bothering with `echo(1)` or `printf(1)`) you can use this program to directly interface with the kernel.\n\nReference for syscall numbers: [Linux System Call Table (x86\\_64)](https://filippo.io/linux-syscall-table/)\n(**Double-click on a row** to reveal the arguments list.)\n\n### Writing to stdout\n\nSystem call number 1 corresponds to `write`, which takes:\n\n1. A file descriptor (e.g., `1` for `stdout`)\n2. A pointer to the buffer (e.g., `\"Hello, World\\n\"`)\n3. The number of bytes to write (e.g., `13`, including the newline)\n\nExample:\n\n```bash\n./dynamic-syscall 1 n:1 $'s:Hello, World\\n' n:13\n```\n\n**Note:** To correctly pass special characters like `\\n`, use **ANSI C quoting** by prefixing your string with `$` and enclosing it in single quotes. Otherwise, characters like `\\n` will be passed as the literal backslash and `n` (i.e., `\"\\\\n\"`), because of how Bash handles escaping.\n\n### Sending SIGKILL to a process\n\n1. Identify the PID of the target process (e.g., `414195`).\n2. Run:\n\n```bash\n./dynamic-syscall 62 n:414195 n:9\n```\n\nExplanation:\n\n* Syscall 62 is `kill(2)`, which takes:\n\n  * A `pid` (`pid_t`): the ID of the process to signal\n  * A signal number (`int`): in this case, `9` (`SIGKILL`) to immediately terminate the process\n\n## Limitations ⚠️\n\nCurrently, only two argument types are supported:\n\n* `s:` string (converted to a pointer)\n* `n:` unsigned number (`usize`)\n\nYou **can** pass negative numbers, and they usually work, because casting from `i32` to `usize` preserves the bit pattern. However, this is architecture dependent and not type safe. Be cautious.\n\n## Future Improvements (TODO) 🗒️\n\n* Allow plain numbers (e.g., `42`) to default to `usize` without requiring the `n:` prefix?\n* Add support for additional types (`i32`, `NULL`, raw pointers, flags, etc.)\n* Optional unescaping of common character sequences (`\\n`, `\\t`, etc.) internally\n* For debug printing, have a map for each syscall number and print their names (e.g., `1` would be `write`)\n* Allow non-base-10 numbers (e.g., `0xFF` or `0o644`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furpagin%2Fsyslang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furpagin%2Fsyslang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furpagin%2Fsyslang/lists"}