Skip to content

Commit 22ccb78

Browse files
committed
feat: cfg add
1 parent 93cc670 commit 22ccb78

4 files changed

Lines changed: 994 additions & 44 deletions

File tree

README.md

Lines changed: 121 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,151 @@
1-
# ReloadMe
1+
# REload.Me
22

3-
[![Python](https://img.shields.io/badge/python-%3E%3D3.9-blue)](https://www.python.org/)
4-
[![Rich](https://img.shields.io/badge/terminal-rich%20UI-7957d5)](https://github.com/Textualize/rich)
5-
[![Typer](https://img.shields.io/badge/CLI-typer-6cc24a)](https://github.com/tiangolo/typer)
3+
[![Python](https://img.shields.io/badge/Python-3.9+-blue.svg)](https://www.python.org/)
4+
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
5+
[![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows%20%7C%20macOS-lightgrey.svg)](https://github.com/yourusername/REload.Me)
6+
[![Build](https://img.shields.io/badge/Build-Stable-brightgreen.svg)](https://github.com/yourusername/REload.Me)
67

7-
REload.Me é uma CLI em Python para análise estática inicial de binários (PE e ELF), com coleta via r2pipe, apresentação com rich e mentoria opcional por LLM.
8+
Static binary analysis framework with integrated Control Flow Graph visualization and AI-assisted reverse engineering guidance.
89

9-
- Comando principal: `reloadme analyse|analyze <caminho_para_o_binario>`
10-
- Objetivo: preparar terreno, organizar dados e oferecer insights para análise dinâmica.
10+
## Overview
1111

12-
## Recursos (V1)
12+
REload.Me provides comprehensive static analysis capabilities for PE and ELF binaries, featuring real-time CFG generation, security assessment, and intelligent analysis recommendations. Built for security researchers, malware analysts, and reverse engineers.
1313

14-
- Informações do binário (iI/iIj): bintype, class, machine, bits, endian, os, subsystem, static, stripped, PIC, RELRO, rpath, runpath, interpreter.
15-
- Checksec (ij → bin.sec): Canary, NX, PIE, ASLR, RELRO, Fortify.
16-
- Funções principais: entrypoint real (iej/ij) e nomes-chave (main, entry0, _start, WinMain).
17-
- Todas as funções (aflj): endereço (VA), size, realsz, nbbs, calltype/cc, nargs, nome.
18-
- Strings (izj): amostra das principais strings.
19-
- Pseudocódigo C da main: r2ghidra (pdgj/pdg) com fallback (pdc/pdr/pdd).
20-
- Mentoria por IA (OpenAI): resumo e próximos passos com base nos dados coletados.
14+
## Features
2115

16+
**Static Analysis Engine**
17+
- Multi-format binary parsing (PE/ELF)
18+
- Security mitigation detection (ASLR, DEP, PIE, Canary)
19+
- Function discovery and analysis
20+
- Import/export enumeration
21+
- String extraction and analysis
2222

23-
## Instalação
23+
**Control Flow Analysis**
24+
- Real-time CFG generation via angr
25+
- Function-level flow visualization
26+
- Basic block analysis with metrics
27+
- Connection mapping and statistics
28+
- ASCII terminal rendering
2429

25-
1) Criar e ativar um virtualenv Python 3.9+ e instalar o pacote em modo editable:
30+
**Intelligence Layer**
31+
- AI-powered analysis recommendations
32+
- Dynamic analysis planning
33+
- Tool integration guidance
34+
- Educational context provision
2635

27-
```
36+
## Installation
37+
38+
```bash
39+
git clone https://github.com/marcostolosa/REload.Me.git
40+
cd REload.Me
2841
pip install -e .
2942
```
3043

31-
2) Dependências Python principais: `r2pipe`, `pefile`, `rich`, `typer`, `openai`.
44+
## Usage
3245

33-
3) Decompilação (opcional): para usar r2ghidra (*r2pm -i r2ghidra*) (`pdg`/`pdgj`), garanta o plugin disponível no ambiente do r2 utilizado pelo r2pipe. Sem ele, o sistema tenta fallbacks (`pdc`, `pdr`, `pdd`).
46+
```bash
47+
# Basic analysis
48+
reloadme analyze target.exe
3449

35-
## Uso
50+
# Include CFG analysis
51+
reloadme analyze target.exe --cfg
3652

37-
```
38-
reloadme analyse ./exemplo.bin
39-
reloadme analyze ./exemplo.bin
53+
# Function-specific CFG
54+
reloadme analyze target.exe --cfg-function main
4055
```
4156

42-
Fluxo de saída (em ordem):
43-
- Informações do Binário (iI)
44-
- Features de Segurança (checksec)
45-
- Funções Principais
46-
- Todas as Funções (aflj)
47-
- Strings (top 50)
48-
- Pseudocódigo C da main (quando disponível)
49-
- Análise do Mentor de IA (opcional)
57+
## Command Reference
5058

51-
## Configuração da IA (OpenAI)
59+
| Option | Description |
60+
|--------|-------------|
61+
| `analyze <file>` | Perform static analysis |
62+
| `--cfg` | Include full binary CFG |
63+
| `--cfg-function <name>` | Analyze specific function CFG |
5264

53-
Defina a variável `OPENAI_API_KEY` ou crie um arquivo `.r2ai.openai-key` contendo a chave na primeira linha.
65+
## Analysis Output
5466

55-
Linux/macOS:
67+
**Binary Information**
68+
- Architecture and platform details
69+
- Compilation metadata
70+
- Entry point identification
71+
72+
**Security Assessment**
5673
```
57-
export OPENAI_API_KEY="sua_chave"
74+
┌─────────────── Security Features ───────────────┐
75+
│ Canary │ Enabled │
76+
│ NX (DEP) │ Enabled │
77+
│ PIE │ Enabled │
78+
│ ASLR │ Enabled │
79+
└───────────────────────────────────────────────┘
5880
```
5981

60-
Windows (PowerShell):
82+
**Function Analysis**
83+
- Complete function enumeration
84+
- Entry point detection
85+
- Call convention analysis
86+
- Size and complexity metrics
87+
88+
**CFG Visualization**
6189
```
62-
$env:OPENAI_API_KEY="sua_chave"
90+
+- 0x401000 (size: 7, instr: 1)
91+
+-> 0x401007
92+
|
93+
+- 0x401007 (size: 17, instr: 4)
94+
+-> 0x401018
95+
|
96+
+- 0x401018 (size: 4, instr: 1)
97+
+-> 0x40101d
98+
+-> 0x40101c
6399
```
64100

65-
Arquivo `.r2ai.openai-key` (CWD ou HOME):
101+
## Architecture
102+
66103
```
67-
sk-...sua_chave...
104+
reloadme/
105+
├── analysis/
106+
│ ├── static_analyzer.py # Core analysis engine
107+
│ └── cfg_analyzer.py # CFG generation
108+
├── presentation/
109+
│ ├── display.py # Output formatting
110+
│ └── cfg_display.py # CFG visualization
111+
├── mentorship/
112+
│ └── ai_mentor.py # Intelligence layer
113+
└── main.py # CLI interface
68114
```
69115

70-
Se a chamada à API falhar, a execução continua e apenas a análise local é exibida.
116+
## Dependencies
117+
118+
**Core Requirements**
119+
- Python 3.9+
120+
- radare2/r2pipe
121+
- rich (terminal UI)
122+
- typer (CLI framework)
123+
124+
**CFG Analysis**
125+
- angr (binary analysis)
126+
- graphviz (visualization)
127+
128+
**AI Features**
129+
- OpenAI API (optional)
130+
131+
## Configuration
132+
133+
Set OpenAI API key for intelligence features:
134+
```bash
135+
export OPENAI_API_KEY="your-key-here"
136+
```
137+
138+
## License
139+
140+
MIT License - see [LICENSE](LICENSE) file.
141+
142+
## Technical Notes
143+
144+
- CFG generation requires angr framework
145+
- Large binaries may require extended analysis time
146+
- Terminal output optimized for dark themes
147+
- Cross-platform compatibility verified
148+
149+
---
71150

151+
**REload.Me** - Professional binary analysis framework

0 commit comments

Comments
 (0)