README.md aktualisiert

Signed-off-by: hax <hax@lainlounge.xyz>
This commit is contained in:
h@x 2025-01-05 18:22:32 +00:00
parent 15e18eead7
commit ebe1e8ec27

125
README.md
View file

@ -1,2 +1,125 @@
# Callygraphs
# Call Graph Generator 🌟🔗🌟
## Overview 🔍🌟📃
This project generates a call graph from an executable binary compiled with debugging symbols. The call graph is output in the DOT format, which can be visualized using tools like Graphviz. The project comprises the following components: 🔎🔧💡
1. **Shell Script**: Orchestrates the call graph generation process by invoking `gdb` to extract function call information.
2. **C Code**: Provides a minimal example of a program whose call graph can be analyzed.
3. **AWK Script**: Converts parsed call data into a DOT graph for visualization.
## Features 🔦🎨🛠
- Extracts function call relationships from binaries.
- Outputs in DOT format for easy visualization.
- Includes a minimal C example program for testing.
- Validates input for robustness and usability.
## Prerequisites 🛠️📝🔌
### Software Requirements 🌐🛠️📊
- `gdb` (GNU Debugger)
- `awk` (or `gawk` for enhanced features)
- `gcc` (GNU Compiler Collection)
- Graphviz (optional, for visualizing the DOT file)
### System Requirements 🎮🔱📦
- Linux or Unix-like operating system
- A terminal with permissions to execute scripts
## Project Structure 🔨🔧🔮
```
project/
|-- README.md # This file
|-- callgraph.sh # Shell script for generating the call graph
|-- example.c # C program to test call graph generation
|-- generate_graph.awk # AWK script to generate DOT file from call data
```
## Installation 🔄🎮🌐
1. Clone the repository: 📦🔗🌍
```bash
git clone <repository-url>
cd project
```
2. Make the scripts executable: 🌧️🛠️🔧
```bash
chmod +x callgraph.sh generate_graph.awk
```
3. Ensure the necessary tools are installed: 🔧🌱🌎
```bash
sudo apt install gdb gcc graphviz
```
## Usage 🛠️🔗🔄
### 1. Compile the Example Program 🔧🔄🔖
Compile the included `example.c` program with debugging symbols: 🔧🏋️‍♂️🎮
```bash
gcc -g -o example example.c
```
### 2. Generate the Call Graph 🎮🌄🏋️‍♂️
Run the shell script with the compiled binary: 📦🔍🎮
```bash
./callgraph.sh ./example > callgraph.txt
```
### 3. Generate the DOT Graph 🌍🔍📦
Use the AWK script to convert the call graph data into a DOT file: 🔗🔦🎮
```bash
./generate_graph.awk callgraph.txt > callgraph.dot
```
### 4. Visualize the Graph (Optional) 📝🎮🎨
Render the DOT file using Graphviz: 🔄🌧️🎮
```bash
dot -Tpng callgraph.dot -o callgraph.png
```
Open `callgraph.png` to view the generated graph. 🎨🎮🌄
## Example 🎮🌟🌄
### Input (Function Call Data) 🔦🔄🌧️
```bash
foo bar
bar baz
baz qux
```
### Output (DOT Format) 🌧️🎨🎮
```dot
digraph G {
"foo" -> "bar";
"bar" -> "baz";
"baz" -> "qux";
}
```
### Visualized Graph 🎨🎮🔍
The graph will show the relationships between functions as directed edges. 🔧🎨🌧️
## Contributing 🌟🌈🌄
1. Fork the repository. 🌧️📝🔧
2. Create a new branch: 🎮🔄🌟
```bash
git checkout -b feature-name
```
3. Make your changes and commit: 🌧️🎮🔗
```bash
git commit -m "Add feature"
```
4. Push to your branch: 🌟📝🎨
```bash
git push origin feature-name
```
5. Open a pull request. 🎮🔧🔦
## License 🌄🔍🎮
This project is licensed under the MIT License. See the LICENSE file for details. 🌟🔄🌧️
## Acknowledgments 🌟🔗🔧
- The GNU Project for `gdb` and `gcc`. 📝🎨🌄
- Graphviz for the graph visualization tools. 🌧️🎨🌄
## Contact 🌐📦🌎
For questions or feedback, please open an issue in the repository. 🔄🌟🎨