Prompt for Function Summary (No Context)
Please analyze the following binary function and provide a clear summary:
Function Name: {func_name}
Note: This may be an auto-generated symbol (like sub_1234) that doesn't reflect the actual purpose.
Decompiled Code:
{decomp_func}
Assembly Instructions:
{instructions}
Please focus on:
- What the function does (its main purpose/functionality)
- Key operations it performs
- What kind of data it processes
- Its role in the program (utility, main logic, error handling, etc.)
Provide a 1-2 sentence description and a meaningful function name using common programming conventions (e.g., snake_case or camelCase).
Response in the following JSON format:
{
"description": "Brief 1-2 sentence description of what this function does",
"name": "descriptive_function_name"
}
Prompt for Function Summary (With Context)
Analyze the function '{func.name}' and provide a concise summary and a descriptive name.
Function: {func.name}
Address: {func.address}
Decompiled C-like code:
```c
{func.decompiled_code}
```
This function calls the following functions, for which summaries are provided:
{callee_context if callee_context else "None"}
Based on the function's code and the summaries of the functions it calls, provide:
1. A descriptive name for the function.
2. A concise one-sentence summary of its purpose.
Respond with a JSON object in the format:
{
"name": "descriptive_function_name",
"summary": "one_sentence_summary"
}
Prompt for Function Summary With Context (Recursive Dependency)
Analyze the following group of mutually recursive functions and provide a concise summary and a descriptive name for each.
The following functions form a recursive group:
{func_details}
This group of functions calls the following external functions, for which summaries are provided:
{callee_context if callee_context else "None"}
For each function in the group, provide:
1. A descriptive name for the function.
2. A concise one-sentence summary of its purpose.
Respond with a JSON object containing a list of summaries, one for each function in the group. The `original_name` field must exactly match the function name from the input.
The format should be:
{
"summaries": [
{example_summaries_str}
]
}
Prompt for File Summary
Please analyze the following binary function and provide a clear summary:
Function Name: {func_name}
Note: This may be an auto-generated symbol (like sub_1234) that doesn't reflect the actual purpose.
Decompiled Code:
{decomp_func}
Assembly Instructions:
{instructions}
Please focus on:
- What the function does (its main purpose/functionality)
- Key operations it performs
- What kind of data it processes
- Its role in the program (utility, main logic, error handling, etc.)
Provide a 1-2 sentence description and a meaningful function name using common programming conventions (e.g., snake_case or camelCase).
Response in the following JSON format:
{
"description": "Brief 1-2 sentence description of what this function does",
"name": "descriptive_function_name"
}
Prompt for Boundary Function Refine
You are a reverse engineering assistant. Your task is to decide if a function at the boundary of two file clusters is placed correctly.
Suspicious Function:
- Name: {func.guessed_name or func.name}
- Summary: {func.summary or 'No summary available.'}
- Decompiled Code:
```c
{func.decompiled_code}
```
This function is currently in a group of functions, but it also has structural relations (function calls or data access overlap) with an adjacent group. Please analyze its semantic relationship with both groups and decide where it fits better.
{current_group_text}
{adjacent_group_text}
Decision: Based on the semantic content, function names, and overall purpose, is the "Suspicious Function" more related to its "Current Group" or the "Adjacent Group"?
Respond with a JSON object in the following format ONLY:
{
"decision": "current" | "adjacent",
"reasoning": "A brief explanation for your choice."
}
Prompt for File Placement
You are analyzing a binary reverse engineering task where functions need to be grouped into files.
Overall Binary Context:
- Project Summary: {project_summary}
- Total Functions in Binary: {total_functions}
Candidate File to Place:
- Name: {candidate_name}
- Summary: {candidate_summary}
- Functions:
{candidate_functions_formatted}
Existing Groups:
Group 1: {group_1_name}
- Summary: {group_1_summary}
- Functions:
{group_1_functions}
Group 2: {group_2_name}
- Summary: {group_2_summary}
- Functions:
{group_2_functions}
[... additional groups ...]
Function Call Relationships:
{call_relationships}
**Task**: Determine which existing group the candidate file should be merged with, or if it should remain standalone.
**Analysis Instructions**:
1. **Semantic Similarity**: Compare the candidate file's purpose and functionality with each existing group. Look for:
- Shared themes, terminology, or naming patterns
- Related functionality or complementary purposes
- Similar abstraction levels or scope
2. **Function Call Relationships**: Consider the call relationships between the candidate file and existing groups. Files that call each other frequently are more likely to be from the same source file.
3. **Comparative Analysis**: The candidate should only be merged with a group if it is significantly more similar to that group than to any other group or if it has strong functional cohesion with that group.
4. **Standalone Decision**: Only keep the candidate standalone if it has a truly distinct purpose that doesn't fit well with any existing group.
**Valid Options**:
- Merge with Group 1 through Group {num_groups} (specify the group number)
- Keep standalone (if it doesn't fit well with any group)
Please respond with a JSON object in the following format:
{
"decision": "merge_with_group_N" | "keep_standalone",
"group_index": N | -1,
"reasoning": "Brief explanation of the decision, focusing on why this group was chosen or why it should remain standalone"
}
Where N is the group number (1-{num_groups}) if merging, or use "keep_standalone" with group_index -1 if it should remain alone.