Skip to content

Commit 09b1ffb

Browse files
committed
Add contribution docs and Turkish README; update UI
Added CODE_OF_CONDUCT.md and CONTRIBUTING.md for project governance and contribution guidelines. Introduced README_TR.md for Turkish documentation. Updated README.md with badges, improved instructions, and added UI/CLI usage details. Modified app.py to default UI language to English and removed emoji prefixes from UI labels for a cleaner look.
1 parent a27e51e commit 09b1ffb

5 files changed

Lines changed: 381 additions & 25 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **edgetype@goygoyengine.com**. All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interaction in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74+
75+
[homepage]: https://www.contributor-covenant.org
76+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

CONTRIBUTING.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Contributing to Pattern Analyzer
2+
3+
First off, thank you for considering contributing to Pattern Analyzer! We welcome any contributions, from fixing a typo in the documentation to implementing a brand-new analysis plugin.
4+
5+
This document provides guidelines for contributing to the project.
6+
7+
## Code of Conduct
8+
9+
This project and everyone participating in it is governed by the [Pattern Analyzer Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
10+
11+
## How Can I Contribute?
12+
13+
There are many ways to contribute to Pattern Analyzer:
14+
15+
- **Reporting Bugs**: If you find a bug, please open an issue and provide detailed steps to reproduce it.
16+
- **Suggesting Enhancements**: Have an idea for a new feature or a new plugin? Open an issue to discuss it.
17+
- **Improving Documentation**: If you find parts of the documentation unclear or incomplete, feel free to submit a pull request with your improvements.
18+
- **Writing Code**: Contribute by fixing bugs, improving existing features, or adding new plugins.
19+
20+
## Your First Code Contribution
21+
22+
Unsure where to begin? A great place to start is by looking for issues tagged with `good first issue` or `help wanted`.
23+
24+
### Development Setup
25+
26+
To get your development environment ready, please follow these steps:
27+
28+
1. **Fork the repository** on GitHub.
29+
30+
2. **Clone your fork** locally:
31+
```bash
32+
git clone https://github.com/edgetype/pattern-analyzer.git
33+
cd pattern-analyzer
34+
```
35+
36+
3. **Create a virtual environment**:
37+
```bash
38+
python -m venv .venv
39+
```
40+
41+
4. **Activate the virtual environment**:
42+
- On Windows:
43+
```powershell
44+
.venv\Scripts\Activate.ps1
45+
```
46+
- On macOS and Linux:
47+
```bash
48+
source .venv/bin/activate
49+
```
50+
51+
5. **Install dependencies** in editable mode. This is crucial as it allows your local code changes to be immediately reflected when you run the `patternanalyzer` command.
52+
```bash
53+
pip install -e .[test,ml,ui]
54+
```
55+
56+
### Pull Request Process
57+
58+
1. **Create a new branch** for your feature or bug fix:
59+
```bash
60+
git checkout -b feature/my-awesome-plugin-or-something-else
61+
```
62+
63+
2. **Make your changes**. Write clean, readable code and follow the existing code style.
64+
65+
3. **Add tests** for your changes. This is very important.
66+
- If you're fixing a bug, add a test that fails without your change and passes with it.
67+
- If you're adding a new feature, add tests that cover its functionality.
68+
- Tests are located in the `tests/` directory.
69+
70+
4. **Run the full test suite** to ensure everything is working correctly:
71+
```bash
72+
pytest
73+
```
74+
75+
5. **Update the documentation** if necessary.
76+
- If you've added a new plugin, add it to the `docs/test-reference.md` file.
77+
- If you've changed the CLI or API, update the relevant sections in the `docs/` folder.
78+
79+
6. **Commit your changes** with a clear and descriptive commit message.
80+
81+
7. **Push your branch** to your fork on GitHub:
82+
```bash
83+
git push origin feature/my-awesome-plugin
84+
```
85+
86+
8. **Open a Pull Request** to the `main` branch of the original repository.
87+
- Provide a clear title and a detailed description of your changes.
88+
- If your PR addresses an existing issue, link it by including `Closes #123` in the description.
89+
90+
Your pull request will be reviewed, and we'll provide feedback. Thank you for your contribution!
91+
92+
### A Note on Plugin Development
93+
94+
One of the most valuable ways to contribute is by creating new plugins. The framework is designed to make this easy. For a detailed guide on creating your own tests, transforms, or visualizers, please see our **[Plugin Developer Guide](./docs/plugin-developer-guide.md)**.

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
2+
<!-- Badges -->
3+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
4+
[![Python](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/)
5+
[![Donate](https://img.shields.io/badge/sponsor-GitHub%20Sponsors-ff69b4.svg)](https://github.com/sponsors/edgetype)
6+
17
# Pattern Analyzer
28

39
Pattern Analyzer is a comprehensive, plugin-based framework for binary data analysis in Python. It provides a powerful engine to apply statistical tests, cryptographic analysis, and structural format detection on any binary data source.
410

11+
*[Turkish](./README_TR.md)*
12+
513
## Features
614

715
- **Extensible Plugin Architecture**: Easily add new statistical tests, data transformers, or visualizers.
@@ -23,7 +31,7 @@ It is recommended to install Pattern Analyzer in a virtual environment.
2331

2432
```bash
2533
# Clone the repository
26-
git clone https://github.com/your-username/pattern-analyzer.git
34+
git clone https://github.com/edgetype/pattern-analyzer.git
2735
cd pattern-analyzer
2836

2937
# Create and activate a virtual environment
@@ -43,6 +51,8 @@ The optional dependencies are:
4351

4452
### Command Line Interface (CLI)
4553

54+
**Standard Analysis**
55+
4656
Analyze a binary file using a default set of tests and save the report.
4757

4858
```bash
@@ -52,7 +62,33 @@ patternanalyzer analyze test.bin --out report.json
5262
Use a specific configuration profile for a focused analysis (e.g., cryptographic tests).
5363

5464
```bash
55-
patternanalyzer analyze encrypted.bin --profile crypto --out crypto_report.json
65+
patternanalyzer analyze encrypted.bin --profile crypto --out crypto_report.json```
66+
67+
**Discovery Mode**
68+
69+
If you don't know what kind of transformation might have been applied to your data, use `--discover` mode. It automatically tries to find common patterns like single-byte XOR keys and reports the most likely candidates.
70+
71+
```bash
72+
patternanalyzer analyze secret.bin --discover --out discover_report.json
73+
```
74+
The output file `discover_report.json` will contain a list of potential transformations and a preview of the resulting data.
75+
76+
### User Interfaces (Web & Terminal)
77+
78+
**Web UI (Streamlit)**
79+
80+
Launch an interactive web interface to upload files and visualize results.
81+
82+
```bash
83+
patternanalyzer serve-ui
84+
```
85+
86+
**Terminal UI (TUI)**
87+
88+
Start a terminal-based interface for analysis directly in your console.
89+
90+
```bash
91+
patternanalyzer tui
5692
```
5793
5894
### Python API

README_TR.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
[Click for the English version](./README.md)
2+
3+
# Pattern Analyzer
4+
5+
Pattern Analyzer, ikili (binary) verileri analiz etmek için Python'da yazılmış kapsamlı ve eklenti tabanlı bir çerçevedir. Herhangi bir ikili veri kaynağına istatistiksel testler, kriptografik analizler ve yapısal format tespiti uygulamak için güçlü bir motor sağlar.
6+
7+
## Özellikler
8+
9+
- **Genişletilebilir Eklenti Mimarisi**: Kolayca yeni istatistiksel testler, veri dönüştürücüler veya görselleştiriciler ekleyin.
10+
- **Zengin Eklenti Kütüphanesi**: Aşağıdakiler için çok çeşitli yerleşik eklentilerle birlikte gelir:
11+
- **İstatistiksel Analiz**: NIST benzeri testler (Monobit, Runs, FFT), Dieharder'dan esinlenilmiş testler ve Hurst Exponent ve Entropi gibi gelişmiş metrikler.
12+
- **Kriptografik Analiz**: ECB modu şifrelemesini, tekrarlayan anahtar XOR desenlerini algılar ve AES S-box'ları gibi bilinen sabitleri arar.
13+
- **Yapısal Analiz**: ZIP, PNG ve PDF gibi formatlar için temel ayrıştırıcılar.
14+
- **Makine Öğrenmesi**: Anomali tespiti için Autoencoder, LSTM ve önceden eğitilmiş sınıflandırıcılar kullanır.
15+
- **Çoklu Arayüzler**: Pattern Analyzer'ı istediğiniz gibi kullanın:
16+
- Betikleme ve otomasyon için **Komut Satırı Arayüzü (CLI)**.
17+
- Etkileşimli analiz ve görselleştirme için **Web Kullanıcı Arayüzü (Streamlit)**.
18+
- Terminal tabanlı etkileşim için **Metin Tabanlı Kullanıcı Arayüzü (TUI)**.
19+
- Pattern Analyzer'ı diğer hizmetlere entegre etmek için **REST API (FastAPI)**.
20+
- **Yüksek Performanslı Motor**: Güvenlik ve kararlılık için paralel test yürütmeyi, büyük dosyalar için akış (streaming) analizini ve sanal alanlı (sandboxed) eklenti yürütmeyi destekler.
21+
22+
## Kurulum
23+
24+
Pattern Analyzer'ı sanal bir ortamda kurmanız önerilir.
25+
26+
```bash
27+
# Depoyu klonlayın
28+
git clone https://github.com/edgetype/pattern-analyzer.git
29+
cd pattern-analyzer
30+
31+
# Sanal bir ortam oluşturun ve etkinleştirin
32+
python -m venv .venv
33+
# Windows'ta: .venv\Scripts\activate
34+
# macOS/Linux'ta: source .venv/bin/activate
35+
36+
# Paketi tüm isteğe bağlı bağımlılıklarla birlikte düzenlenebilir modda kurun
37+
pip install -e .[test,ml,ui]
38+
```
39+
İsteğe bağlı bağımlılıklar:
40+
- `test`: `pytest` ile test paketini çalıştırmak için.
41+
- `ml`: Makine öğrenmesi tabanlı eklentiler için (TensorFlow, scikit-learn).
42+
- `ui`: Streamlit web arayüzü ve Textual TUI için.
43+
44+
## Hızlı Başlangıç
45+
46+
### Komut Satırı Arayüzü (CLI)
47+
48+
**Standart Analiz**
49+
50+
Bir ikili dosyayı varsayılan test setiyle analiz edin ve raporu kaydedin.
51+
52+
```bash
53+
patternanalyzer analyze test.bin --out report.json
54+
```
55+
56+
Odaklanmış bir analiz için belirli bir yapılandırma profili kullanın (örneğin, kriptografik testler).
57+
58+
```bash
59+
patternanalyzer analyze encrypted.bin --profile crypto --out crypto_report.json
60+
```
61+
62+
**Keşif Modu (Discovery Mode)**
63+
64+
Verilerinize ne tür bir dönüşüm uygulanmış olabileceğini bilmiyorsanız `--discover` modunu kullanın. Bu mod, tek baytlık XOR anahtarları gibi yaygın desenleri otomatik olarak bulmaya çalışır ve en olası adayları raporlar.
65+
66+
```bash
67+
patternanalyzer analyze secret.bin --discover --out discover_report.json
68+
```
69+
Çıktı dosyası `discover_report.json`, potansiyel dönüşümlerin bir listesini ve sonuç verisinin bir önizlemesini içerecektir.
70+
71+
### Kullanıcı Arayüzleri (Web & Terminal)
72+
73+
**Web Arayüzü (Streamlit)**
74+
75+
Dosyaları yüklemek ve sonuçları görselleştirmek için etkileşimli bir web arayüzü başlatın.
76+
77+
```bash
78+
patternanalyzer serve-ui
79+
```
80+
81+
**Terminal Arayüzü (TUI)**
82+
83+
Doğrudan konsolunuzda analiz yapmak için terminal tabanlı bir arayüz başlatın.
84+
85+
```bash
86+
patternanalyzer tui
87+
```
88+
89+
### Python API
90+
91+
Programatik olarak bir analiz işlem hattı çalıştırın.
92+
93+
```python
94+
from patternanalyzer.engine import Engine
95+
96+
# Analiz motorunu başlat
97+
engine = Engine()
98+
99+
# Bir dosyadan veri yükle
100+
with open("test.bin", "rb") as f:
101+
data_bytes = f.read()
102+
103+
# Bir analiz yapılandırması tanımla
104+
# Bu örnek, monobit testini çalıştırmadan önce basit bir XOR dönüşümü uygular
105+
config = {
106+
"transforms": [{"name": "xor_const", "params": {"xor_value": 127}}],
107+
"tests": [{"name": "monobit", "params": {}}],
108+
"fdr_q": 0.05 # Yanlış Keşif Oranı (FDR) anlamlılık seviyesini ayarla
109+
}
110+
111+
# Analizi çalıştır
112+
output = engine.analyze(data_bytes, config)
113+
114+
# Sonuçları yazdır
115+
import json
116+
print(json.dumps(output, indent=2))
117+
```
118+
119+
## Proje Yapısı
120+
121+
```
122+
pattern-analyzer/
123+
├── patternanalyzer/ # Çerçevenin ana kaynak kodu
124+
│ ├── plugins/ # Yerleşik analiz ve dönüşüm eklentileri
125+
│ ├── __init__.py
126+
│ ├── engine.py # Çekirdek analiz motoru
127+
│ ├── plugin_api.py # Eklentiler için temel sınıflar (Test, Transform, Visual)
128+
│ ├── cli.py # Click tabanlı Komut Satırı Arayüzü
129+
│ ├── api.py # FastAPI tabanlı REST API
130+
│ ├── tui.py # Textual tabanlı Terminal Kullanıcı Arayüzü
131+
│ └── ...
132+
├── app.py # Streamlit Web Kullanıcı Arayüzü
133+
├── docs/ # MkDocs için dokümantasyon dosyaları
134+
├── tests/ # Pytest birim ve entegrasyon testleri
135+
├── pyproject.toml # Proje üst verileri ve bağımlılıklar
136+
└── README.md
137+
```
138+
139+
## Katkıda Bulunma
140+
141+
Katkılarınızı bekliyoruz! Lütfen bir "issue" açmaktan veya bir "pull request" göndermekten çekinmeyin.
142+
143+
1. Depoyu "fork"layın.
144+
2. Yeni bir özellik dalı oluşturun (`git checkout -b feature/my-new-feature`).
145+
3. Değişikliklerinizi uygulayın ve testler ekleyin.
146+
4. Tüm testlerin geçtiğinden emin olun (`pytest`).
147+
5. Bir "pull request" gönderin.
148+
149+
## Lisans
150+
151+
Bu proje MIT Lisansı altında lisanslanmıştır. Ayrıntılar için [LICENSE](LICENSE) dosyasına bakın.

0 commit comments

Comments
 (0)