|
1 | | -# ReloadMe |
| 1 | +# REload.Me |
2 | 2 |
|
3 | | -[](https://www.python.org/) |
4 | | -[](https://github.com/Textualize/rich) |
5 | | -[](https://github.com/tiangolo/typer) |
| 3 | +[](https://www.python.org/) |
| 4 | +[](LICENSE) |
| 5 | +[](https://github.com/yourusername/REload.Me) |
| 6 | +[](https://github.com/yourusername/REload.Me) |
6 | 7 |
|
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. |
8 | 9 |
|
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 |
11 | 11 |
|
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. |
13 | 13 |
|
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 |
21 | 15 |
|
| 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 |
22 | 22 |
|
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 |
24 | 29 |
|
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 |
26 | 35 |
|
27 | | -``` |
| 36 | +## Installation |
| 37 | + |
| 38 | +```bash |
| 39 | +git clone https://github.com/marcostolosa/REload.Me.git |
| 40 | +cd REload.Me |
28 | 41 | pip install -e . |
29 | 42 | ``` |
30 | 43 |
|
31 | | -2) Dependências Python principais: `r2pipe`, `pefile`, `rich`, `typer`, `openai`. |
| 44 | +## Usage |
32 | 45 |
|
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 |
34 | 49 |
|
35 | | -## Uso |
| 50 | +# Include CFG analysis |
| 51 | +reloadme analyze target.exe --cfg |
36 | 52 |
|
37 | | -``` |
38 | | -reloadme analyse ./exemplo.bin |
39 | | -reloadme analyze ./exemplo.bin |
| 53 | +# Function-specific CFG |
| 54 | +reloadme analyze target.exe --cfg-function main |
40 | 55 | ``` |
41 | 56 |
|
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 |
50 | 58 |
|
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 | |
52 | 64 |
|
53 | | -Defina a variável `OPENAI_API_KEY` ou crie um arquivo `.r2ai.openai-key` contendo a chave na primeira linha. |
| 65 | +## Analysis Output |
54 | 66 |
|
55 | | -Linux/macOS: |
| 67 | +**Binary Information** |
| 68 | +- Architecture and platform details |
| 69 | +- Compilation metadata |
| 70 | +- Entry point identification |
| 71 | + |
| 72 | +**Security Assessment** |
56 | 73 | ``` |
57 | | -export OPENAI_API_KEY="sua_chave" |
| 74 | +┌─────────────── Security Features ───────────────┐ |
| 75 | +│ Canary │ Enabled │ |
| 76 | +│ NX (DEP) │ Enabled │ |
| 77 | +│ PIE │ Enabled │ |
| 78 | +│ ASLR │ Enabled │ |
| 79 | +└───────────────────────────────────────────────┘ |
58 | 80 | ``` |
59 | 81 |
|
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** |
61 | 89 | ``` |
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 |
63 | 99 | ``` |
64 | 100 |
|
65 | | -Arquivo `.r2ai.openai-key` (CWD ou HOME): |
| 101 | +## Architecture |
| 102 | + |
66 | 103 | ``` |
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 |
68 | 114 | ``` |
69 | 115 |
|
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 | +--- |
71 | 150 |
|
| 151 | +**REload.Me** - Professional binary analysis framework |
0 commit comments