Skip to content

Commit 71be695

Browse files
author
MLR
authored
Merge pull request Sidenai#11 from Sidenai/mylovereturns-patch-2
Added CONTRIBUTING.md
2 parents 960f6cb + a61ec72 commit 71be695

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Contributing to Hyperion
2+
3+
Thank you for contributing to Hyperion. We appreciate all help whether it is fixing bugs, adding architectures, improving the decompiler or cleaning up the UI.
4+
5+
## Getting Started
6+
7+
### 1. Development Setup
8+
To build the project locally you need **CMake 3.25+**, **vcpkg** and a **C++20 compatible compiler** (MSVC 2022+ is recommended for Windows).
9+
10+
```bash
11+
# Fork the repository on GitHub then clone your fork
12+
git clone --recursive https://github.com/Sidenai/hyperion-disassembler.git
13+
cd hyperion-disassembler
14+
15+
# Configure and build
16+
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
17+
cmake --build build --config Release
18+
```
19+
20+
### 2. Issues & Bug Reports
21+
Before starting on a major feature or fix check the [Issue Tracker](https://github.com/Sidenai/hyperion-disassembler/issues) to make sure nobody else is already working on it.
22+
* **Bugs:** Provide steps to reproduce, the expected behavior and what actually happened. Include OS and compiler versions. If the bug relates to a specific binary providing a sample helps immensely.
23+
* **Features:** Open a discussion issue before spending time on a massive PR so we can make sure the feature aligns with the project roadmap.
24+
25+
## AI Code Generation
26+
27+
If you use an AI coding assistant like Cursor, Copilot or ChatGPT to help write your PR you are strictly responsible for making sure it follows these guidelines.
28+
29+
* **Prompt context:** If you use an autonomous agent you must instruct it to read this file first.
30+
* **No comment spam:** AI tools love to over-comment code line by line. Strip out all redundant comments before submitting. We do not want `// initialize the variable` or `// loop through the array` in this codebase. If a PR is full of AI-generated comment spam it will be rejected immediately.
31+
* **Verify the code:** AIs often write outdated, unsafe or non-idiomatic C++. Make sure the generated code uses the modern C++20 features required below, handles bounds checking correctly and doesn't introduce memory leaks.
32+
33+
## Coding Rules
34+
35+
Hyperion is a high performance security tool. It adheres to a strict and minimalist C++ style. Follow these rules when writing code:
36+
37+
* **Modern C++20:** Write clean standard C++20. Use `<ranges>` and standard `<algorithm>` where it makes sense. Avoid over-engineering, deep inheritance hierarchies and heavy abstractions.
38+
* **Compiler warnings:** Code must compile cleanly. Treat warnings as errors. We enforce strict warning levels (`/W4` on MSVC, `-Wall -Wextra` on GCC/Clang).
39+
* **No exceptions:** Binaries are inherently untrusted and malformed data is common. Do not throw exceptions. Use `std::expected` or `std::optional` for error handling.
40+
* **Memory & RAII:** Manage resources using RAII. Never use raw `new` and `delete`. Use smart pointers (`std::unique_ptr`, `std::shared_ptr`) or value semantics.
41+
* **Fixed-width types:** When parsing binaries always use fixed-width integer types like `uint8_t`, `uint32_t` and `size_t`. Never use raw `int` or `long` for binary structures.
42+
* **Bounds checking:** Never trust offsets or sizes read from a binary file. Always validate bounds against the file or section size before reading or writing to memory to prevent crashes and exploits.
43+
* **Auto keyword:** Only use `auto` when the type is obvious from the right side of the assignment (like `std::make_unique`) or for complex iterators. Don't use it if it hides the underlying type.
44+
* **Concurrency:** Use the existing task scheduler and worker pool for parallel tasks. Do not spawn raw `std::thread` instances unless you are writing a long-running background service like the debug engine.
45+
* **Performance:** Keep hot paths optimized. Avoid unnecessary heap allocations inside loops (especially in the linear sweep and recursive descent stages). Pass by `const &` for non-trivial types.
46+
* **Naming conventions:** Use standard library style naming. This means `snake_case` for variables, functions and standard structs/classes.
47+
* **Comments:** Write comments that explain why the code does something rather than what it is doing.
48+
* **ImGui:** When adding UI components make sure to manage ImGui IDs properly using `##` suffixes to avoid focus conflicts.
49+
* **Magic numbers:** If you need a magic number it must match an external spec (PE, ELF, Mach-O) or just be a random 32/64-bit value for custom formats. Don't use joke constants like DEADBEEF, CAFEBABE or FEEDFACE since it causes ambiguity and makes the format too easy to fingerprint.
50+
51+
## Pull Request Process
52+
53+
1. Create a feature branch from `main` (`git checkout -b feature/my-cool-feature`).
54+
2. Make your changes and keep commits logically grouped.
55+
3. Ensure the project still builds across Windows, Linux and macOS. If you modify the decompiler or analysis engine test it against a few different binaries to catch regressions.
56+
4. Push your branch to your fork and open a Pull Request.
57+
5. Ensure all automated GitHub Actions CI checks pass.
58+
59+
## Community
60+
61+
If you need help or want to discuss architecture join our [Discord server](https://discord.gg/yjym2b7A).

0 commit comments

Comments
 (0)