diff --git a/INSTALL.md b/INSTALL.md index 6d2e000d..0cbcadee 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -59,7 +59,7 @@ target("...") cmake --preset windows-release -S . cmake --build cmake-build/build/windows-release --target omath -j 6 ``` - Use **\-\** preset to build siutable version for yourself. Like **windows-release** or **linux-release**. + Use **\-\** preset to build suitable version for yourself. Like **windows-release** or **linux-release**. | Platform Name | Build Config | |---------------|---------------| diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..000ea345 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,17 @@ +# Welcome to MkDocs + +For full documentation visit [mkdocs.org](https://www.mkdocs.org). + +## Commands + +* `mkdocs new [dir-name]` - Create a new project. +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. +* `mkdocs -h` - Print help message and exit. + +## Project layout + + mkdocs.yml # The configuration file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/include/omath/rev_eng/internal_rev_object.hpp b/include/omath/rev_eng/internal_rev_object.hpp index 63249fbb..033ebd3d 100644 --- a/include/omath/rev_eng/internal_rev_object.hpp +++ b/include/omath/rev_eng/internal_rev_object.hpp @@ -26,7 +26,11 @@ namespace omath::rev_eng template ReturnType call_virtual_method(auto... arg_list) { +#ifdef _MSC_VER using VirtualMethodType = ReturnType(__thiscall*)(void*, decltype(arg_list)...); +#else + using VirtualMethodType = ReturnType(__fastcall*)(void*, decltype(arg_list)...); +#endif return (*reinterpret_cast(this))[id](this, arg_list...); } }; diff --git a/include/omath/system/pe/data_directory.hpp b/include/omath/system/pe/data_directory.hpp new file mode 100644 index 00000000..9a6f9f56 --- /dev/null +++ b/include/omath/system/pe/data_directory.hpp @@ -0,0 +1,5 @@ +// +// Created by Vlad on 10/8/2025. +// + +#pragma once diff --git a/include/omath/system/pe/dos_header.hpp b/include/omath/system/pe/dos_header.hpp new file mode 100644 index 00000000..d483b25d --- /dev/null +++ b/include/omath/system/pe/dos_header.hpp @@ -0,0 +1,32 @@ +// +// Created by Vlad on 10/7/2025. +// + +#pragma once +#include + +namespace omath::system::pe +{ + struct DosHeader final + { + std::uint16_t e_magic; + std::uint16_t e_cblp; + std::uint16_t e_cp; + std::uint16_t e_crlc; + std::uint16_t e_cparhdr; + std::uint16_t e_minalloc; + std::uint16_t e_maxalloc; + std::uint16_t e_ss; + std::uint16_t e_sp; + std::uint16_t e_csum; + std::uint16_t e_ip; + std::uint16_t e_cs; + std::uint16_t e_lfarlc; + std::uint16_t e_ovno; + std::uint16_t e_res[4]; + std::uint16_t e_oemid; + std::uint16_t e_oeminfo; + std::uint16_t e_res2[10]; + std::uint32_t e_lfanew; + }; +} \ No newline at end of file diff --git a/include/omath/system/pe/file_header.hpp b/include/omath/system/pe/file_header.hpp new file mode 100644 index 00000000..84490f6a --- /dev/null +++ b/include/omath/system/pe/file_header.hpp @@ -0,0 +1,56 @@ +// +// Created by Vlad on 10/7/2025. +// + +#pragma once +#include + +namespace omath::system::pe +{ + enum class MachineId : std::uint16_t + { + UNKNOWN = 0x0000, + TARGET_HOST = 0x0001, // Useful for indicating we want to interact with the host and not a WoW guest. + I386 = 0x014C, // Intel 386. + R3000 = 0x0162, // MIPS little-endian, 0x160 big-endian + R4000 = 0x0166, // MIPS little-endian + R10000 = 0x0168, // MIPS little-endian + WCEMIPSV2 = 0x0169, // MIPS little-endian WCE v2 + ALPHA = 0x0184, // Alpha_AXP + SH3 = 0x01A2, // SH3 little-endian + SH3DSP = 0x01A3, + SH3E = 0x01A4, // SH3E little-endian + SH4 = 0x01A6, // SH4 little-endian + SH5 = 0x01A8, // SH5 + ARM = 0x01C0, // ARM Little-Endian + THUMB = 0x01C2, // ARM Thumb/Thumb-2 Little-Endian + ARMNT = 0x01C4, // ARM Thumb-2 Little-Endian + AM33 = 0x01D3, + POWERPC = 0x01F0, // IBM PowerPC Little-Endian + POWERPCP = 0x01F1, + IA64 = 0x0200, // Intel 64 + MIPS16 = 0x0266, // MIPS + ALPHA64 = 0x0284, // ALPHA64 + MIPSFPU = 0x0366, // MIPS + MIPSFPU16 = 0x0466, // MIPS + AXP64 = 0x0284, + TRICORE = 0x0520, // Infineon + CEF = 0x0CEF, + EBC = 0x0EBC, // EFI Byte Code + AMD64 = 0x8664, // AMD64 (K8) + M32R = 0x9041, // M32R little-endian + ARM64 = 0xAA64, // ARM64 Little-Endian + CEE = 0xC0EE, + }; + + struct FileHeader final + { + MachineId machine; + uint16_t num_sections; + uint32_t timedate_stamp; + uint32_t ptr_symbols; + uint32_t num_symbols; + uint16_t size_optional_header; + std::uint16_t characteristics; + }; +} \ No newline at end of file diff --git a/include/omath/system/pe/image_nt_headers.hpp b/include/omath/system/pe/image_nt_headers.hpp new file mode 100644 index 00000000..ef30448f --- /dev/null +++ b/include/omath/system/pe/image_nt_headers.hpp @@ -0,0 +1,23 @@ +// +// Created by Vlad on 10/9/2025. +// + +#pragma once +#include "file_header.hpp" +#include "optional_header.hpp" + +namespace omath::system::pe +{ + enum class NtArchitecture + { + x32_bit, + x64_bit, + }; + template + struct ImageNtHeaders final + { + std::uint32_t signature; + FileHeader file_header; + OptionalHeader optional_header; + }; +} // namespace omath::system::pe \ No newline at end of file diff --git a/include/omath/system/pe/optional_header.hpp b/include/omath/system/pe/optional_header.hpp new file mode 100644 index 00000000..b27dd5e0 --- /dev/null +++ b/include/omath/system/pe/optional_header.hpp @@ -0,0 +1,118 @@ +// +// Created by Vlad on 10/8/2025. +// +#pragma once +#include + +namespace omath::system::pe +{ + static constexpr std::uint16_t opt_hdr32_magic = 0x010B; + static constexpr std::uint16_t opt_hdr64_magic = 0x020B; + enum class SubsystemId : std::uint16_t + { + unknown = 0x0000, + native = 0x0001, + windows_gui = 0x0002, + windows_cui = 0x0003, + os2_cui = 0x0005, + posix_cui = 0x0007, + native_windows = 0x0008, + windows_ce_gui = 0x0009, + efi_application = 0x000A, + efi_boot_service_driver = 0x000B, + efi_runtime_driver = 0x000C, + efi_rom = 0x000D, + xbox = 0x000E, + windows_boot_application = 0x0010, + xbox_code_catalog = 0x0011, + }; + + struct DataDirectory final + { + std::uint32_t rva; + std::uint32_t size; + }; + struct OptionalHeaderX64 final + { + // Standard fields. + std::uint16_t magic; + std::uint16_t linker_version; + + std::uint32_t size_code; + std::uint32_t size_init_data; + std::uint32_t size_uninit_data; + + std::uint32_t entry_point; + std::uint32_t base_of_code; + + // NT additional fields. + std::uint64_t image_base; + std::uint32_t section_alignment; + std::uint32_t file_alignment; + + std::uint32_t os_version; + std::uint32_t img_version; + std::uint32_t subsystem_version; + std::uint32_t win32_version_value; + + std::uint32_t size_image; + std::uint32_t size_headers; + + std::uint32_t checksum; + SubsystemId subsystem; + std::uint16_t characteristics; + + std::uint64_t size_stack_reserve; + std::uint64_t size_stack_commit; + std::uint64_t size_heap_reserve; + std::uint64_t size_heap_commit; + + std::uint32_t ldr_flags; + + std::uint32_t num_data_directories; + DataDirectory data_directories[16]; + }; + struct OptionalHeaderX86 final + { + // Standard fields. + uint16_t magic; + uint16_t linker_version; + + uint32_t size_code; + uint32_t size_init_data; + uint32_t size_uninit_data; + + uint32_t entry_point; + uint32_t base_of_code; + uint32_t base_of_data; + + // NT additional fields. + uint32_t image_base; + uint32_t section_alignment; + uint32_t file_alignment; + + std::uint32_t os_version; + std::uint32_t img_version; + std::uint32_t subsystem_version; + uint32_t win32_version_value; + + uint32_t size_image; + uint32_t size_headers; + + uint32_t checksum; + SubsystemId subsystem; + std::uint16_t characteristics; + + uint32_t size_stack_reserve; + uint32_t size_stack_commit; + uint32_t size_heap_reserve; + uint32_t size_heap_commit; + + uint32_t ldr_flags; + + uint32_t num_data_directories; + DataDirectory data_directories[16]; + }; + template + using OptionalHeader = std::conditional_t; +} // namespace omath::system::pe \ No newline at end of file diff --git a/include/omath/system/pe/section_header.hpp b/include/omath/system/pe/section_header.hpp new file mode 100644 index 00000000..8c5448fb --- /dev/null +++ b/include/omath/system/pe/section_header.hpp @@ -0,0 +1,32 @@ +// +// Created by Vlad on 10/8/2025. +// + +#pragma once +#include + +// Section header +// +namespace omath::system::pe +{ + struct SectionHeader final + { + char name[8]; + union + { + std::uint32_t physical_address; + std::uint32_t virtual_size; + }; + std::uint32_t virtual_address; + + std::uint32_t size_raw_data; + std::uint32_t ptr_raw_data; + + std::uint32_t ptr_relocs; + std::uint32_t ptr_line_numbers; + std::uint32_t num_relocs; + std::uint32_t num_line_numbers; + + std::uint32_t characteristics; + }; +} \ No newline at end of file diff --git a/include/omath/utility/pattern_scan.hpp b/include/omath/utility/pattern_scan.hpp index d8486f0c..ae7c7146 100644 --- a/include/omath/utility/pattern_scan.hpp +++ b/include/omath/utility/pattern_scan.hpp @@ -26,7 +26,7 @@ namespace omath { INVALID_PATTERN_STRING }; - class PatternScanner + class PatternScanner final { friend unit_test_pattern_scan_read_test_Test; friend unit_test_pattern_scan_corner_case_1_Test; @@ -36,11 +36,11 @@ namespace omath public: [[nodiscard]] - static std::span::const_iterator scan_for_pattern(const std::span& range, + static std::span::iterator scan_for_pattern(const std::span& range, const std::string_view& pattern); [[nodiscard]] - static std::span::const_iterator scan_for_pattern(std::span&& range, + static std::span::iterator scan_for_pattern(std::span&& range, const std::string_view& pattern) = delete; template diff --git a/include/omath/utility/pe_pattern_scan.hpp b/include/omath/utility/pe_pattern_scan.hpp new file mode 100644 index 00000000..8d582744 --- /dev/null +++ b/include/omath/utility/pe_pattern_scan.hpp @@ -0,0 +1,43 @@ +// +// Created by Vlad on 10/7/2025. +// + +#pragma once +#include +#include +#include +#include +#include +namespace omath +{ + struct PeSectionScanResult + { + std::uint64_t virtual_base_addr; + std::uint64_t raw_base_addr; + std::ptrdiff_t target_offset; + }; + class PePatternScanner final + { + private: + struct Section + { + std::uint64_t virtual_base_addr; + std::uint64_t raw_base_addr; + std::vector data; + }; + + public: + [[nodiscard]] + static std::optional scan_for_pattern_in_loaded_module(const std::string_view& module_name, + const std::string_view& pattern); + + [[nodiscard]] + static std::optional + scan_for_pattern_in_file(const std::filesystem::path& path_to_file, const std::string_view& pattern, + const std::string_view& target_section_name = ".text"); + + [[nodiscard]] + static std::optional
extract_section_from_pe_file(const std::filesystem::path& path_to_file, + const std::string_view& section_name); + }; +} // namespace omath \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..c97182f5 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1 @@ +site_name: My Docs diff --git a/source/utility/pattern_scan.cpp b/source/utility/pattern_scan.cpp index 2c0e3282..b6443479 100644 --- a/source/utility/pattern_scan.cpp +++ b/source/utility/pattern_scan.cpp @@ -4,13 +4,30 @@ #include "omath/utility/pattern_scan.hpp" #include #include +#include + +namespace +{ + [[nodiscard]] + constexpr bool is_wildcard(const std::string_view& byte_str) + { + return byte_str == "?" || byte_str == "??"; + } + + [[nodiscard]] + constexpr bool invalid_byte_str_size(const std::string_view& byte_str) + { + return byte_str.empty() || byte_str.size() >= 3; + } +} + namespace omath { - std::span::const_iterator + std::span::iterator PatternScanner::scan_for_pattern(const std::span& range, const std::string_view& pattern) { - return scan_for_pattern(range.cbegin(), range.cend(), pattern); + return scan_for_pattern(range.begin(), range.end(), pattern); } std::expected>, PatternScanError> PatternScanner::parse_pattern(const std::string_view& pattern_string) @@ -28,13 +45,13 @@ namespace omath const std::string_view byte_str = pattern_string.substr(sting_view_start, sting_view_end); - if (byte_str.empty()) [[unlikely]] + if (invalid_byte_str_size(byte_str)) [[unlikely]] { start = end != pattern_string.end() ? std::next(end) : end; continue; } - if (byte_str == "?" || byte_str == "??") + if (is_wildcard(byte_str)) { pattern.emplace_back(std::nullopt); diff --git a/source/utility/pe_pattern_scan.cpp b/source/utility/pe_pattern_scan.cpp new file mode 100644 index 00000000..9a63bd9e --- /dev/null +++ b/source/utility/pe_pattern_scan.cpp @@ -0,0 +1,158 @@ +// +// Created by Vlad on 10/7/2025. +// +#include "omath/utility/pe_pattern_scan.hpp" +#include "omath/system/pe/image_nt_headers.hpp" +#include "omath/system/pe/section_header.hpp" +#include "omath/utility/pattern_scan.hpp" +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#endif + +using namespace omath::system::pe; +using NtHeaderVariant = std::variant, ImageNtHeaders>; + +namespace +{ + [[nodiscard]] + NtHeaderVariant get_nt_header_from_file(std::fstream& file, const DosHeader& dos_header) + { + ImageNtHeaders x86_headers; + file.seekg(dos_header.e_lfanew, std::ios::beg); + file.read(reinterpret_cast(&x86_headers), sizeof(x86_headers)); + + if (x86_headers.optional_header.magic == opt_hdr32_magic) + return x86_headers; + + ImageNtHeaders x64_headers; + file.seekg(dos_header.e_lfanew, std::ios::beg); + file.read(reinterpret_cast(&x64_headers), sizeof(x64_headers)); + + return x64_headers; + } + + [[nodiscard]] + constexpr bool invalid_dos_header_file(const DosHeader& dos_header) + { + constexpr std::uint16_t dos_hdr_magic = 0x5A4D; + return dos_header.e_magic != dos_hdr_magic; + } + [[nodiscard]] + constexpr bool invalid_nt_header_file(const NtHeaderVariant& variant) + { + constexpr std::uint32_t nt_hdr_magic = 0x4550; + return std::visit([](const auto& header) -> bool { return header.signature != nt_hdr_magic; }, variant); + } +} // namespace + +namespace omath +{ + + std::optional + PePatternScanner::scan_for_pattern_in_loaded_module([[maybe_unused]] const std::string_view& module_name, + [[maybe_unused]] const std::string_view& pattern) + { +#ifdef _WIN32 + const auto base_address = reinterpret_cast(GetModuleHandleA(module_name.data())); + + if (!base_address) + return std::nullopt; + + const auto dos_headers = reinterpret_cast(base_address); + const auto image_nt_headers = reinterpret_cast(base_address + dos_headers->e_lfanew); + + // Define .code segment as scan area + const auto start = image_nt_headers->OptionalHeader.BaseOfCode; + const auto scan_size = image_nt_headers->OptionalHeader.SizeOfCode; + + const auto scan_range = std::span{reinterpret_cast(base_address) + start, scan_size}; + + const auto result = PatternScanner::scan_for_pattern(scan_range, pattern); + + if (result != scan_range.cend()) + return reinterpret_cast(&*result); + + return std::nullopt; +#else + throw std::runtime_error("Pattern scan for loaded modules is only for windows platform"); +#endif + } + std::optional + PePatternScanner::scan_for_pattern_in_file(const std::filesystem::path& path_to_file, + const std::string_view& pattern, + const std::string_view& target_section_name) + { + const auto pe_section = extract_section_from_pe_file(path_to_file, target_section_name); + + if (!pe_section.has_value()) + return std::nullopt; + + const auto scan_result = + PatternScanner::scan_for_pattern(pe_section->data.cbegin(), pe_section->data.cend(), pattern); + + if (scan_result == pe_section->data.cend()) + return std::nullopt; + const auto offset = std::distance(pe_section->data.begin(), scan_result); + + return PeSectionScanResult{.virtual_base_addr = pe_section->virtual_base_addr, + .raw_base_addr = pe_section->raw_base_addr, + .target_offset = offset}; + } + std::optional + PePatternScanner::extract_section_from_pe_file(const std::filesystem::path& path_to_file, + const std::string_view& section_name) + { + std::fstream file(path_to_file, std::ios::binary | std::ios::in); + + if (!file.is_open()) [[unlikely]] + return std::nullopt; + + DosHeader dos_header{}; + file.read(reinterpret_cast(&dos_header), sizeof(dos_header)); + + if (invalid_dos_header_file(dos_header)) [[unlikely]] + return std::nullopt; + + const auto nt_headers = get_nt_header_from_file(file, dos_header); + + if (invalid_nt_header_file(nt_headers)) [[unlikely]] + return std::nullopt; + + return std::visit( + [&file, &dos_header, §ion_name](auto& concrete_headers) -> std::optional
+ { + constexpr std::size_t size_of_signature = sizeof(concrete_headers.signature); + const auto offset_to_segment_table = dos_header.e_lfanew + + concrete_headers.file_header.size_optional_header + + sizeof(FileHeader) + size_of_signature; + + file.seekg(static_cast(offset_to_segment_table), std::ios::beg); + + for (std::size_t i = 0; i < concrete_headers.file_header.num_sections; i++) + { + SectionHeader current_section{}; + file.read(reinterpret_cast(¤t_section), sizeof(current_section)); + + if (std::string_view(current_section.name) != section_name) + continue; + + std::vector section_data(current_section.size_raw_data); + + file.seekg(current_section.ptr_raw_data, std::ios::beg); + file.read(reinterpret_cast(section_data.data()), + static_cast(section_data.size())); + return Section{.virtual_base_addr = current_section.virtual_address + + concrete_headers.optional_header.image_base, + .raw_base_addr = current_section.ptr_raw_data, + .data = std::move(section_data)}; + } + return std::nullopt; + }, + nt_headers); + } +} // namespace omath \ No newline at end of file diff --git a/tests/general/unit_test_pattern_scan.cpp b/tests/general/unit_test_pattern_scan.cpp index d0da462e..b974c401 100644 --- a/tests/general/unit_test_pattern_scan.cpp +++ b/tests/general/unit_test_pattern_scan.cpp @@ -1,11 +1,11 @@ // // Created by Vlad on 10/4/2025. // +#include "omath/utility/pe_pattern_scan.hpp" #include "gtest/gtest.h" #include #include - - +#include TEST(unit_test_pattern_scan, read_test) { const auto result = omath::PatternScanner::parse_pattern("FF ? ?? E9"); @@ -49,6 +49,5 @@ TEST(unit_test_pattern_scan, corner_case_3) TEST(unit_test_pattern_scan, corner_case_4) { const auto result = omath::PatternScanner::parse_pattern("X ? ?? E9 "); - EXPECT_FALSE(result.has_value()); } \ No newline at end of file diff --git a/writerside/c.list b/writerside/c.list deleted file mode 100644 index 5fca6a61..00000000 --- a/writerside/c.list +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/writerside/cfg/buildprofiles.xml b/writerside/cfg/buildprofiles.xml deleted file mode 100644 index d2654201..00000000 --- a/writerside/cfg/buildprofiles.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - true - - - - diff --git a/writerside/images/completion_procedure.png b/writerside/images/completion_procedure.png deleted file mode 100644 index 3535a3f3..00000000 Binary files a/writerside/images/completion_procedure.png and /dev/null differ diff --git a/writerside/images/completion_procedure_dark.png b/writerside/images/completion_procedure_dark.png deleted file mode 100644 index a65beb0e..00000000 Binary files a/writerside/images/completion_procedure_dark.png and /dev/null differ diff --git a/writerside/images/convert_table_to_xml.png b/writerside/images/convert_table_to_xml.png deleted file mode 100644 index 2518a64c..00000000 Binary files a/writerside/images/convert_table_to_xml.png and /dev/null differ diff --git a/writerside/images/convert_table_to_xml_dark.png b/writerside/images/convert_table_to_xml_dark.png deleted file mode 100644 index 47161226..00000000 Binary files a/writerside/images/convert_table_to_xml_dark.png and /dev/null differ diff --git a/writerside/images/new_topic_options.png b/writerside/images/new_topic_options.png deleted file mode 100644 index bc6abb62..00000000 Binary files a/writerside/images/new_topic_options.png and /dev/null differ diff --git a/writerside/images/new_topic_options_dark.png b/writerside/images/new_topic_options_dark.png deleted file mode 100644 index bf3e48d1..00000000 Binary files a/writerside/images/new_topic_options_dark.png and /dev/null differ diff --git a/writerside/o.tree b/writerside/o.tree deleted file mode 100644 index df951e50..00000000 --- a/writerside/o.tree +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/writerside/redirection-rules.xml b/writerside/redirection-rules.xml deleted file mode 100644 index e06c4572..00000000 --- a/writerside/redirection-rules.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - " from OMATH]]> - Empty-MD-Topic.html - - \ No newline at end of file diff --git a/writerside/topics/Code-Of-Conduct.md b/writerside/topics/Code-Of-Conduct.md deleted file mode 100644 index bf542488..00000000 --- a/writerside/topics/Code-Of-Conduct.md +++ /dev/null @@ -1,95 +0,0 @@ -# Code Of Conduct - -## 🎯 Goal - -My goal is to provide a space where it is safe for everyone to contribute to, -and get support for, open-source software in a respectful and cooperative -manner. - -I value all contributions and want to make this project and its -surrounding community a place for everyone. - -As members, contributors, and everyone else who may participate in the -development, I strive to keep the entire experience civil. - -## 📜 Standards - -Our community standards exist in order to make sure everyone feels comfortable -contributing to the project(s) together. - -Our standards are: -- Do not harass, attack, or in any other way discriminate against anyone, including - for their protected traits, including, but not limited to, sex, religion, race, - appearance, gender, identity, nationality, sexuality, etc. -- Do not go off-topic, do not post spam. -- Treat everyone with respect. - -Examples of breaking each rule respectively include: -- Harassment, bullying or inappropriate jokes about another person. -- Posting distasteful imagery, trolling, or posting things unrelated to the topic at hand. -- Treating someone as worse because of their lack of understanding of an issue. - -## ⚡ Enforcement - -Enforcement of this CoC is done by Orange++ and/or other core contributors. - -I, as the core developer, will strive my best to keep this community civil and -following the standards outlined above. - -### 🚩 Reporting incidents - -If you believe an incident of breaking these standards has occurred, but nobody has -taken appropriate action, you can privately contact the people responsible for dealing -with such incidents in multiple ways: - -***E-Mail*** -- `orange-cpp@yandex.ru` - -***Discord*** -- `@orange_cpp` - -***Telegram*** -- `@orange_cpp` - -I guarantee your privacy and will not share those reports with anyone. - -## ⚖️ Enforcement Strategy - -Depending on the severity of the infraction, any action from the list below may be applied. -Please keep in mind cases are reviewed on a per-case basis and members are the ultimate -deciding factor in the type of punishment. - -If the matter benefited from an outside opinion, a member might reach for more opinions -from people unrelated, however, the final decision regarding the action -to be taken is still up to the member. - -For example, if the matter at hand regards a representative of a marginalized group or minority, -the member might ask for a first-hand opinion from another representative of such group. - -### ✏️ Correction/Edit - -If your message is found to be misleading or poorly worded, a member might -edit your message. - -### ⚠️ Warning/Deletion - -If your message is found inappropriate, a member might give you a public or private warning, -and/or delete your message. - -### 🔇 Mute - -If your message is disruptive, or you have been repeatedly violating the standards, -a member might mute (or temporarily ban) you. - -### ⛔ Ban - -If your message is hateful, very disruptive, or other, less serious infractions are repeated -ignoring previous punishments, a member might ban you permanently. - -## 🔎 Scope - -This CoC shall apply to all projects ran under the Orange++ lead and all _official_ communities -outside of GitHub. - -However, it is worth noting that official communities outside of GitHub might have their own, -additional sets of rules. \ No newline at end of file diff --git a/writerside/topics/Community.md b/writerside/topics/Community.md deleted file mode 100644 index 4f18848b..00000000 --- a/writerside/topics/Community.md +++ /dev/null @@ -1,11 +0,0 @@ -# Credits - -Thanks to everyone who made this possible, including: - -- Saikari aka luadebug for VCPKG port. - -And a big hand to everyone else who has contributed over the past! - -THANKS! <3 - - -- Orange++ \ No newline at end of file diff --git a/writerside/topics/Documentation.md b/writerside/topics/Documentation.md deleted file mode 100644 index a99f4a2b..00000000 --- a/writerside/topics/Documentation.md +++ /dev/null @@ -1,54 +0,0 @@ -# 📥Installation Guide - -## Using vcpkg -**Note**: Support vcpkg for package management -1. Install [vcpkg](https://github.com/microsoft/vcpkg) -2. Run the following command to install the orange-math package: -``` -vcpkg install orange-math -``` -CMakeLists.txt -```cmake -find_package(omath CONFIG REQUIRED) -target_link_libraries(main PRIVATE omath::omath) -``` -For detailed commands on installing different versions and more information, please refer to Microsoft's [official instructions](https://learn.microsoft.com/en-us/vcpkg/get_started/overview). - -## Build from source using CMake -1. **Preparation** - - Install needed tools: cmake, clang, git, msvc (windows only). - - 1. **Linux:** - ```bash - sudo pacman -Sy cmake ninja clang git - ``` - 2. **MacOS:** - ```bash - brew install llvm git cmake ninja - ``` - 3. **Windows:** - - Install Visual Studio from [here](https://visualstudio.microsoft.com/downloads/) and Git from [here](https://git-scm.com/downloads). - - Use x64 Native Tools shell to execute needed commands down below. -2. **Clone the repository:** - ```bash - git clone https://github.com/orange-cpp/omath.git - ``` -3. **Navigate to the project directory:** - ```bash - cd omath - ``` -4. **Build the project using CMake:** - ```bash - cmake --preset windows-release -S . - cmake --build cmake-build/build/windows-release --target omath -j 6 - ``` - Use **\-\** preset to build siutable version for yourself. Like **windows-release** or **linux-release**. - - | Platform Name | Build Config | - |---------------|---------------| - | windows | release/debug | - | linux | release/debug | - | darwin | release/debug | \ No newline at end of file diff --git a/writerside/topics/License.md b/writerside/topics/License.md deleted file mode 100644 index 4f4ff045..00000000 --- a/writerside/topics/License.md +++ /dev/null @@ -1,9 +0,0 @@ -# License - -Copyright (c) 2025 Orange++ - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/writerside/topics/starter-topic.md b/writerside/topics/starter-topic.md deleted file mode 100644 index 878557f7..00000000 --- a/writerside/topics/starter-topic.md +++ /dev/null @@ -1,67 +0,0 @@ -# Intro - -![banner](https://i.imgur.com/SM9ccP6.png) - -Oranges's Math Library (omath) is a comprehensive, open-source library aimed at providing efficient, reliable, and versatile mathematical functions and algorithms. Developed primarily in C++, this library is designed to cater to a wide range of mathematical operations essential in scientific computing, engineering, and academic research. - -## 👁‍🗨 Features -- **Efficiency**: Optimized for performance, ensuring quick computations using AVX2. -- **Versatility**: Includes a wide array of mathematical functions and algorithms. -- **Ease of Use**: Simplified interface for convenient integration into various projects. -- **Projectile Prediction**: Projectile prediction engine with O(N) algo complexity, that can power you projectile aim-bot. -- **3D Projection**: No need to find view-projection matrix anymore you can make your own projection pipeline. -- **Collision Detection**: Production ready code to handle collision detection by using simple interfaces. -- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution -- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types! - -## Supported Render Pipelines -| ENGINE | SUPPORT | -|----------|---------| -| Source | ✅YES | -| Unity | ✅YES | -| IWEngine | ✅YES | -| Unreal | ❌NO | - -## Supported Operating Systems - -| OS | SUPPORT | -|----------------|---------| -| Windows 10/11 | ✅YES | -| Linux | ✅YES | -| Darwin (MacOS) | ✅YES | - -## ⏬ Installation -Please read our [installation guide](https://github.com/orange-cpp/omath/blob/main/INSTALL.md). If this link doesn't work check out INSTALL.md file. - -## ❔ Usage -Simple world to screen function -```c++ -TEST(UnitTestProjection, IsPointOnScreen) -{ - const omath::projection::Camera camera({0.f, 0.f, 0.f}, {0, 0.f, 0.f} , {1920.f, 1080.f}, 110.f, 0.1f, 500.f); - - const auto proj = camera.WorldToScreen({100, 0, 15}); - EXPECT_TRUE(proj.has_value()); -} -``` -## Showcase - -With `omath/projection` module you can achieve simple ESP hack for powered by Source/Unreal/Unity engine games, like [Apex Legends](https://store.steampowered.com/app/1172470/Apex_Legends/). - -![banner](https://i.imgur.com/lcJrfcZ.png) -Or for InfinityWard Engine based games. Like Call of Duty Black Ops 2! -![banner](https://i.imgur.com/F8dmdoo.png) -Or create simple trigger bot with embeded traceline from omath::collision::LineTrace -![banner](https://i.imgur.com/fxMjRKo.jpeg) -Or even advanced projectile aimbot -[Watch Video](https://youtu.be/lM_NJ1yCunw?si=5E87OrQMeypxSJ3E) - - -## 🫵🏻 Contributing -Contributions to `omath` are welcome! Please read `CONTRIBUTING.md` for details on our code of conduct and the process for submitting pull requests. - -## 📜 License -This project is licensed under the MIT - see the `LICENSE` file for details. - -## 💘 Acknowledgments -- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors) diff --git a/writerside/v.list b/writerside/v.list deleted file mode 100644 index 2d12cb39..00000000 --- a/writerside/v.list +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/writerside/writerside.cfg b/writerside/writerside.cfg deleted file mode 100644 index 4e8ae9ec..00000000 --- a/writerside/writerside.cfg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file