This file provides guidance and important rules working with code in this repository.
- Use a progressive disclosure approach for agent coding in this repository: start from high-level information in Serena memories, and only locate/read specific files or symbols when necessary to avoid expanding too much context at once.
- Perfer use serena mcp tools to understand the architecture and code hierarchy quickly.
- ALWAYS Call Serena's
activate_projectbefore reading memories.
- Check
READMD.md
rename is a unified renaming tool that supports renaming functions, global variables, local variables, and stack variables.
{
"batch": {
"func": [...], // Function renaming
"data": [...], // Global/data variable renaming
"local": [...], // Local variable renaming
"stack": [...] // Stack variable renaming
}
}{
"batch": {
"func": {
"addr": "0x12345678", // Function address (hex or decimal)
"name": "NewFuncName" // New function name
}
}
}{
"batch": {
"data": {
"old": "old_global_name", // Current variable name
"new": "new_global_name" // New variable name
}
}
}{
"batch": {
"local": {
"func_addr": "0x12345678", // Function address containing the local variable
"old": "v1", // Current variable name
"new": "playerIndex" // New variable name
}
}
}{
"batch": {
"stack": {
"func_addr": "0x12345678", // Function address containing the stack variable
"old": "var_20", // Current variable name
"new": "bufferSize" // New variable name
}
}
}Multiple rename operations can be performed simultaneously:
{
"batch": {
"func": [
{"addr": "0x1000", "name": "InitPlayer"},
{"addr": "0x2000", "name": "UpdateHealth"}
],
"local": [
{"func_addr": "0x1000", "old": "a1", "new": "pPlayer"},
{"func_addr": "0x1000", "old": "v5", "new": "healthValue"}
]
}
}get_bytes reads bytes from memory addresses in the binary.
{
"regions": {
"addr": "0x12345678", // Address to read from (hex or decimal)
"size": 16 // Number of bytes to read
}
}Read 16 bytes from a single address:
{
"regions": {
"addr": "0x140001000",
"size": 16
}
}Read bytes from multiple addresses simultaneously:
{
"regions": [
{"addr": "0x140001000", "size": 16},
{"addr": "0x140002000", "size": 32},
{"addr": "0x140003000", "size": 8}
]
}int_convert converts numbers between different formats (hex, decimal, binary, ASCII).
{
"inputs": {
"text": "0x41424344", // Number string to convert (hex, decimal, or binary)
"size": 4 // Byte size for conversion (omit for auto-detect)
}
}Convert a hex number:
{
"inputs": {
"text": "0x41424344"
}
}Returns decimal, hexadecimal, bytes (little-endian), binary, and ASCII representation (if printable).
Convert multiple numbers simultaneously:
{
"inputs": [
{"text": "0xFF"},
{"text": "12345"},
{"text": "0b11001100"}
]
}Force a specific byte size for the conversion:
{
"inputs": {
"text": "0x90",
"size": 4
}
}get_int reads integer values from memory addresses. Use ty to specify the integer type including signedness and byte order.
ty follows the pattern {sign}{bits}{endian}:
- sign:
i(signed) oru(unsigned) - bits:
8,16,32,64 - endian (optional):
le(little-endian, default) orbe(big-endian)
Examples: i8, u64, i16le, i16be, u32be
{
"queries": {
"addr": "0x12345678", // Address to read from (hex or decimal)
"ty": "u32" // Integer type (i8/u64/i16le/i16be/etc)
}
}Read an unsigned 32-bit integer:
{
"queries": {
"addr": "0x140001000",
"ty": "u32"
}
}Read multiple integers simultaneously:
{
"queries": [
{"addr": "0x140001000", "ty": "u32"},
{"addr": "0x140001004", "ty": "i16le"},
{"addr": "0x140001008", "ty": "u64"}
]
}