{"owner":"radareorg","repo":"radare2","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# Agentic Coding Guidelines for radare2\n\nradare2 is a modular reverse engineering framework.\n\n## Locations\n\n- **Header files**: `./libr/include`\n- **Manpages**: `./man/`\n- **Plugins**: `./libr/*/p/` subdirectories\n- **Test binaries**: Separate `radare2-testbins` repository (cloned into `./test/bins` by r2r)\n- **Test files**: `./test/db/`. Source files can use `// R2R` comments to reference tests\n\n## Formatting\n\nDo not run `clang-format-radare2` unless clearly specified by the user.\nFollow the already existing and defined coding style.\nOptionally run `sys/lint.sh` script if you are unsure about the linter.\n\n- Indent code with **tabs**, spaces for comments and no trailing spaces\n- Space before opening parenthesis: `if (a)`, `foo ()`, `sizeof (int)`\n- Function signatures do not require a space before `(` and must fit in one line\n- Always use braces `{}` for conditionals, even single statements\n- Switch `case` labels column-aligned with the `switch` keyword\n- Declare and assign variables in the same line if possible (No K&R style); they do not need to be grouped at the beginning of the block\n- No C99 `for (int i = ...)` declarations; declare variables before the loop\n- Use `R_PACKED()` macro for packed structures for portability\n- Use types from `<r_types.h>` (`ut8`, `ut16`, `ut32`, `ut64`) instead of `<stdint.h>`\n- Use `PFMT64` macros instead of `%lld` for portable formatting\n\n## Coding Rules\n\n### Memory Management\n\n- `R_NEW`/`R_NEW0` never return NULL; no null checks needed for small constant allocations\n- Check for integer overflow before large allocations using `r_mul_overflow_*`\n- Never use `alloca()` or variable-length stack arrays\n- Do not check for NULL before calling `free()` or `*_free` functions\n- `r_json_parse` does not own the input string; free it after freeing the parser\n- `r_json_parsedup` duplicates and owns the input string; the copy is freed by `r_json_free`\n- Prefer `r_json_parsedup` to avoid manual string lifetime management\n\n### API Usage\n\n- Use `R_RETURN_*` macros in public `R_API` functions for programming error checks\n- Use standard `if` statements for runtime error checks (e.g., malloc failures)\n- Never use `<assert.h>`; use `\"r_util/r_assert.h\"`\n- Prefer `!strcmp ()` over `strcmp () == 0`\n- Use string and memory parsing functions from `libr/util` before libc if possible:\n  - Use `r_str_newf` instead of manual malloc + snprintf\n  - Use `r_strbuf_*` for string concatenation in loops; avoid `r_str_append`\n  - Use `r_str_pad2` to create repeated character strings\n  - Use `r_read_be32`/`r_read_le32` for endian-safe reads\n\n### Commands\n\n- Handle the `?` subcommand to display help\n- Keep functions short; split complex logic into helper functions\n\n### Logging\n\n- Use `R_LOG_*` APIs for user-facing messages\n- Only use `eprintf` during draft/wip development for debugging purposes\n- Use the `R2_DEBUG=1` environment to catch bugs during testing\n\n### Parameter Annotations\n\nUse these macros to document function parameters:\n- `R_OUT`: output parameter (written to)\n- `R_INOUT`: read/write parameter\n- `R_OWN`: ownership transferred to callee\n- `R_BORROW`: caller retains ownership\n- `R_NONNULL`: pointer must not be null\n- `R_NULLABLE`: pointer may be null\n- `R_DEPRECATED`: do not use in new code\n\n## Building\n\n- Never run `gcc` directly; always use `make -j > /dev/null`\n- Do not build `.o` files separately\n- `sudo make symstall` creates symlinked system-wide installation\n- Symlinks ensure working directory builds work as system installations\n- The `./configure` script is generated with `acr` from the configure.acr\n  - Never modify the `configure` script directly. always autogenerate it\n- For new library dependencies, update both `Makefile` and `meson.build`\n- For new plugins, register in:\n  - `dist/plugins-cfg/plugins.def.cfg`\n  - `dist/plugins-cfg/plugins.static.cfg`\n  - Relevant `libr/*/meson.build` plugin list\n\n## Testing\n\n- When running `r2` oneliners take this into account:\n  - The filename to open must be always the last argument\n  - Use the `-n` flag to avoid loading binary headers and read the plain file\n    - Similar IO behaviour can be achieved with `-e io.va=false`\n- Run the `test/db` tests with `r2r <path/to/db/..>`\n- Source files can reference tests with `// R2R` comments\n- Large test binaries belong in `radare2-testbins` repository, not this repo\n- Run `sys/sanitize.sh` to compile with address sanitizer for memory debugging\n\n## Commits\n\nDo not create commits by yourself. Instead, at the end of your work suggest a one-line commit message following these conventions:\n\n- Start with a capital letter\n- If the change is relevant for the users and must be listed in the release changelog:\n  - Append one double-hash tag as the **last word** in the message\n  - Tags are lowercase, alphabetic only (no numbers or symbols)\n  - When in doubt; check `git log` to find examples of other commits.\n  - Security vulnerabilities must be tagged with `##crash`\n  - Available tags: `abi`, `analysis`, `arch`, `asm`, `bin`, `ci`, `cons`, `core`, `crash`, `debug`, `doc`, `esil`, `fs`, `http`, `io`, `r2js`, `lang`, `print`, `project`, `r2pipe`, `r2r`, `search`, `shell`, `threads`, `tools`, `trace`, `types`, `util`, `visual`, `zign`\n"},"files":{"AGENTS.md":"# Agentic Coding Guidelines for radare2\n\nradare2 is a modular reverse engineering framework.\n\n## Locations\n\n- **Header files**: `./libr/include`\n- **Manpages**: `./man/`\n- **Plugins**: `./libr/*/p/` subdirectories\n- **Test binaries**: Separate `radare2-testbins` repository (cloned into `./test/bins` by r2r)\n- **Test files**: `./test/db/`. Source files can use `// R2R` comments to reference tests\n\n## Formatting\n\nDo not run `clang-format-radare2` unless clearly specified by the user.\nFollow the already existing and defined coding style.\nOptionally run `sys/lint.sh` script if you are unsure about the linter.\n\n- Indent code with **tabs**, spaces for comments and no trailing spaces\n- Space before opening parenthesis: `if (a)`, `foo ()`, `sizeof (int)`\n- Function signatures do not require a space before `(` and must fit in one line\n- Always use braces `{}` for conditionals, even single statements\n- Switch `case` labels column-aligned with the `switch` keyword\n- Declare and assign variables in the same line if possible (No K&R style); they do not need to be grouped at the beginning of the block\n- No C99 `for (int i = ...)` declarations; declare variables before the loop\n- Use `R_PACKED()` macro for packed structures for portability\n- Use types from `<r_types.h>` (`ut8`, `ut16`, `ut32`, `ut64`) instead of `<stdint.h>`\n- Use `PFMT64` macros instead of `%lld` for portable formatting\n\n## Coding Rules\n\n### Memory Management\n\n- `R_NEW`/`R_NEW0` never return NULL; no null checks needed for small constant allocations\n- Check for integer overflow before large allocations using `r_mul_overflow_*`\n- Never use `alloca()` or variable-length stack arrays\n- Do not check for NULL before calling `free()` or `*_free` functions\n- `r_json_parse` does not own the input string; free it after freeing the parser\n- `r_json_parsedup` duplicates and owns the input string; the copy is freed by `r_json_free`\n- Prefer `r_json_parsedup` to avoid manual string lifetime management\n\n### API Usage\n\n- Use `R_RETURN_*` macros in public `R_API` functions for programming error checks\n- Use standard `if` statements for runtime error checks (e.g., malloc failures)\n- Never use `<assert.h>`; use `\"r_util/r_assert.h\"`\n- Prefer `!strcmp ()` over `strcmp () == 0`\n- Use string and memory parsing functions from `libr/util` before libc if possible:\n  - Use `r_str_newf` instead of manual malloc + snprintf\n  - Use `r_strbuf_*` for string concatenation in loops; avoid `r_str_append`\n  - Use `r_str_pad2` to create repeated character strings\n  - Use `r_read_be32`/`r_read_le32` for endian-safe reads\n\n### Commands\n\n- Handle the `?` subcommand to display help\n- Keep functions short; split complex logic into helper functions\n\n### Logging\n\n- Use `R_LOG_*` APIs for user-facing messages\n- Only use `eprintf` during draft/wip development for debugging purposes\n- Use the `R2_DEBUG=1` environment to catch bugs during testing\n\n### Parameter Annotations\n\nUse these macros to document function parameters:\n- `R_OUT`: output parameter (written to)\n- `R_INOUT`: read/write parameter\n- `R_OWN`: ownership transferred to callee\n- `R_BORROW`: caller retains ownership\n- `R_NONNULL`: pointer must not be null\n- `R_NULLABLE`: pointer may be null\n- `R_DEPRECATED`: do not use in new code\n\n## Building\n\n- Never run `gcc` directly; always use `make -j > /dev/null`\n- Do not build `.o` files separately\n- `sudo make symstall` creates symlinked system-wide installation\n- Symlinks ensure working directory builds work as system installations\n- The `./configure` script is generated with `acr` from the configure.acr\n  - Never modify the `configure` script directly. always autogenerate it\n- For new library dependencies, update both `Makefile` and `meson.build`\n- For new plugins, register in:\n  - `dist/plugins-cfg/plugins.def.cfg`\n  - `dist/plugins-cfg/plugins.static.cfg`\n  - Relevant `libr/*/meson.build` plugin list\n\n## Testing\n\n- When running `r2` oneliners take this into account:\n  - The filename to open must be always the last argument\n  - Use the `-n` flag to avoid loading binary headers and read the plain file\n    - Similar IO behaviour can be achieved with `-e io.va=false`\n- Run the `test/db` tests with `r2r <path/to/db/..>`\n- Source files can reference tests with `// R2R` comments\n- Large test binaries belong in `radare2-testbins` repository, not this repo\n- Run `sys/sanitize.sh` to compile with address sanitizer for memory debugging\n\n## Commits\n\nDo not create commits by yourself. Instead, at the end of your work suggest a one-line commit message following these conventions:\n\n- Start with a capital letter\n- If the change is relevant for the users and must be listed in the release changelog:\n  - Append one double-hash tag as the **last word** in the message\n  - Tags are lowercase, alphabetic only (no numbers or symbols)\n  - When in doubt; check `git log` to find examples of other commits.\n  - Security vulnerabilities must be tagged with `##crash`\n  - Available tags: `abi`, `analysis`, `arch`, `asm`, `bin`, `ci`, `cons`, `core`, `crash`, `debug`, `doc`, `esil`, `fs`, `http`, `io`, `r2js`, `lang`, `print`, `project`, `r2pipe`, `r2r`, `search`, `shell`, `threads`, `tools`, `trace`, `types`, `util`, `visual`, `zign`\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# Agentic Coding Guidelines for radare2\n\nradare2 is a modular reverse engineering framework.\n\n## Locations\n\n- **Header files**: `./libr/include`\n- **Manpages**: `./man/`\n- **Plugins**: `./libr/*/p/` subdirectories\n- **Test binaries**: Separate `radare2-testbins` repository (cloned into `./test/bins` by r2r)\n- **Test files**: `./test/db/`. Source files can use `// R2R` comments to reference tests\n\n## Formatting\n\nDo not run `clang-format-radare2` unless clearly specified by the user.\nFollow the already existing and defined coding style.\nOptionally run `sys/lint.sh` script if you are unsure about the linter.\n\n- Indent code with **tabs**, spaces for comments and no trailing spaces\n- Space before opening parenthesis: `if (a)`, `foo ()`, `sizeof (int)`\n- Function signatures do not require a space before `(` and must fit in one line\n- Always use braces `{}` for conditionals, even single statements\n- Switch `case` labels column-aligned with the `switch` keyword\n- Declare and assign variables in the same line if possible (No K&R style); they do not need to be grouped at the beginning of the block\n- No C99 `for (int i = ...)` declarations; declare variables before the loop\n- Use `R_PACKED()` macro for packed structures for portability\n- Use types from `<r_types.h>` (`ut8`, `ut16`, `ut32`, `ut64`) instead of `<stdint.h>`\n- Use `PFMT64` macros instead of `%lld` for portable formatting\n\n## Coding Rules\n\n### Memory Management\n\n- `R_NEW`/`R_NEW0` never return NULL; no null checks needed for small constant allocations\n- Check for integer overflow before large allocations using `r_mul_overflow_*`\n- Never use `alloca()` or variable-length stack arrays\n- Do not check for NULL before calling `free()` or `*_free` functions\n- `r_json_parse` does not own the input string; free it after freeing the parser\n- `r_json_parsedup` duplicates and owns the input string; the copy is freed by `r_json_free`\n- Prefer `r_json_parsedup` to avoid manual string lifetime management\n\n### API Usage\n\n- Use `R_RETURN_*` macros in public `R_API` functions for programming error checks\n- Use standard `if` statements for runtime error checks (e.g., malloc failures)\n- Never use `<assert.h>`; use `\"r_util/r_assert.h\"`\n- Prefer `!strcmp ()` over `strcmp () == 0`\n- Use string and memory parsing functions from `libr/util` before libc if possible:\n  - Use `r_str_newf` instead of manual malloc + snprintf\n  - Use `r_strbuf_*` for string concatenation in loops; avoid `r_str_append`\n  - Use `r_str_pad2` to create repeated character strings\n  - Use `r_read_be32`/`r_read_le32` for endian-safe reads\n\n### Commands\n\n- Handle the `?` subcommand to display help\n- Keep functions short; split complex logic into helper functions\n\n### Logging\n\n- Use `R_LOG_*` APIs for user-facing messages\n- Only use `eprintf` during draft/wip development for debugging purposes\n- Use the `R2_DEBUG=1` environment to catch bugs during testing\n\n### Parameter Annotations\n\nUse these macros to document function parameters:\n- `R_OUT`: output parameter (written to)\n- `R_INOUT`: read/write parameter\n- `R_OWN`: ownership transferred to callee\n- `R_BORROW`: caller retains ownership\n- `R_NONNULL`: pointer must not be null\n- `R_NULLABLE`: pointer may be null\n- `R_DEPRECATED`: do not use in new code\n\n## Building\n\n- Never run `gcc` directly; always use `make -j > /dev/null`\n- Do not build `.o` files separately\n- `sudo make symstall` creates symlinked system-wide installation\n- Symlinks ensure working directory builds work as system installations\n- The `./configure` script is generated with `acr` from the configure.acr\n  - Never modify the `configure` script directly. always autogenerate it\n- For new library dependencies, update both `Makefile` and `meson.build`\n- For new plugins, register in:\n  - `dist/plugins-cfg/plugins.def.cfg`\n  - `dist/plugins-cfg/plugins.static.cfg`\n  - Relevant `libr/*/meson.build` plugin list\n\n## Testing\n\n- When running `r2` oneliners take this into account:\n  - The filename to open must be always the last argument\n  - Use the `-n` flag to avoid loading binary headers and read the plain file\n    - Similar IO behaviour can be achieved with `-e io.va=false`\n- Run the `test/db` tests with `r2r <path/to/db/..>`\n- Source files can reference tests with `// R2R` comments\n- Large test binaries belong in `radare2-testbins` repository, not this repo\n- Run `sys/sanitize.sh` to compile with address sanitizer for memory debugging\n\n## Commits\n\nDo not create commits by yourself. Instead, at the end of your work suggest a one-line commit message following these conventions:\n\n- Start with a capital letter\n- If the change is relevant for the users and must be listed in the release changelog:\n  - Append one double-hash tag as the **last word** in the message\n  - Tags are lowercase, alphabetic only (no numbers or symbols)\n  - When in doubt; check `git log` to find examples of other commits.\n  - Security vulnerabilities must be tagged with `##crash`\n  - Available tags: `abi`, `analysis`, `arch`, `asm`, `bin`, `ci`, `cons`, `core`, `crash`, `debug`, `doc`, `esil`, `fs`, `http`, `io`, `r2js`, `lang`, `print`, `project`, `r2pipe`, `r2r`, `search`, `shell`, `threads`, `tools`, `trace`, `types`, `util`, `visual`, `zign`\n","category":"root","tokens":1304}]}