Commit Graph

722 Commits

Author SHA1 Message Date
81ed5f80d7 Merge pull request #84 from luadebug/patch-1
internal_rev_object.hpp: do not use __fastcall for non-Windows platforms
v3.9.1
2025-10-10 07:47:25 +03:00
Saikari
e385686323 Update internal_rev_object.hpp 2025-10-09 21:34:19 +03:00
086eda4ee3 Merge pull request #82 from orange-cpp/feature/pe_scanner
Updates PE header structure for x64
v3.9.0
2025-10-09 20:45:21 +03:00
9419e390da Allows specifying target section for file scan
Enables users to specify the target section name when scanning a PE file for a pattern.
This provides more flexibility in locating patterns within a PE file, as it's not limited to the ".text" section.
2025-10-09 20:42:03 +03:00
d919600ac2 Removes unused path parameter from function.
Simplifies `extract_section_from_pe_file` by removing the unused path parameter.
This clarifies the function's purpose and improves readability.
2025-10-09 20:36:10 +03:00
11681ac601 Refactors PE header parsing for improved robustness
Simplifies PE header reading and validation logic, extracting common functionality into helper functions.

Introduces `get_nt_header_from_file` to handle both x86 and x64 PE headers.

Adds validation checks for both DOS and NT headers to ensure file integrity.

Improves code readability and maintainability by reducing redundancy in header parsing.

Relates to feature/pe_scanner
2025-10-09 20:32:36 +03:00
6c5152297a Uses correct calling convention for virtual methods
Adjusts the virtual method calling convention based on the compiler (_MSC_VER).
This ensures compatibility and correct behavior on different platforms.
2025-10-09 20:08:04 +03:00
547f64e4c4 Removes platform-specific error handling
Simplifies pattern scanner logic by removing conditional compilation for non-Windows platforms.

The error handling previously thrown on non-Windows platforms was unnecessary as this functionality is not intended for those systems. This change streamlines the code and removes a misleading error message.
2025-10-09 20:03:43 +03:00
3129e32f0c Uses std::uint16_t for SubsystemId enum
Ensures consistency by using `std::uint16_t` instead of `uint16_t` for the `SubsystemId` enum.

Relates to feature/pe_scanner
2025-10-09 20:01:34 +03:00
72b54e9673 Removes PE scanner test code
Eliminates the PE scanner test code from the unit tests.

This removes a test that appears to be broken or no longer relevant, since the test directly references a file path.
2025-10-09 19:58:58 +03:00
2ff291b255 Supports broader architectures in PE scanner
Updates the PE scanner implementation to support both 32-bit and 64-bit architectures.
Leverages `std::variant` and a generic `ImageNtHeaders` to abstract architecture-specific details.
Simplifies the logic for retrieving section data, generalizing the process for improved maintainability.
2025-10-09 19:58:19 +03:00
8eda1ce4bc Adds PE scanner infrastructure and data structures
Initializes infrastructure for PE file scanning.

Adds data structures for PE headers (DOS, optional, section),
including user-defined types for section characteristics.

Refactors existing pattern scanning code to utilize new PE data structures.

Adds basic parsing of PE headers.
2025-10-08 19:22:20 +03:00
e1b4375621 fixed for mac improved readability 2025-10-08 19:22:20 +03:00
d84259fdcc Adds PE file header definitions
Defines `DosHeader` and `FileHeader` structures to represent PE file header information.
Includes definitions for `MachineId` enum and `FileCharacteristics` union.
These definitions are prerequisite for PE file parsing and analysis.
2025-10-08 19:22:20 +03:00
d64c7ad756 Adds PE section extraction and pattern scanning
Adds functionality to extract a specific section from a PE file and scan for a given pattern within that section.

Introduces `extract_section_from_pe_file` to isolate a section, enabling more targeted pattern searches.
Overhauls `scan_for_pattern_in_file` to utilize extracted section data and improve accuracy.
2025-10-08 19:22:20 +03:00
710f91999f Adds scan functionality for PE files
Introduces a method to scan for patterns within specified PE files.
This facilitates searching for patterns outside of loaded modules.
2025-10-08 19:22:20 +03:00
f3fe0e3cee added pe pattern scan 2025-10-08 19:22:20 +03:00
c5c5c2e972 Clarifies build preset usage in INSTALL.md
Rephrases the explanation regarding build presets for clarity in the INSTALL.md file.
The text now more explicitly advises users on selecting appropriate presets.
2025-10-08 19:22:20 +03:00
a7cb056ce7 Moves PE headers file to omath directory
Organizes the project by relocating the PE headers file to the omath directory structure.
This improves code organization and maintainability.
2025-10-08 19:22:20 +03:00
dae1555ec4 added mkdoc 2025-10-08 19:22:19 +03:00
2c6ef1b8cc Defines PE header structure for x64
Introduces a structure for representing the DOS header
within a PE (Portable Executable) file for x64 architectures.
This definition enables easier parsing and manipulation of PE header information.
2025-10-08 19:22:19 +03:00
d70e8853e8 Add Kaspersky LLC to license restrictions 2025-10-08 17:48:24 +03:00
e35d64b486 Disables rvalue overload of scan_for_pattern
Prevents implicit conversions and unexpected behavior by deleting the rvalue overload of `scan_for_pattern`.
2025-10-06 15:05:04 +03:00
9868c832a1 Corrects function signature
Adjusts the `scan_for_pattern` function signature to correctly use `const std::string_view&`.
2025-10-06 14:46:40 +03:00
42e46f9921 added global header 2025-10-06 14:36:00 +03:00
e7ccc2ead0 added concept for iterators, reworked interface 2025-10-06 14:25:52 +03:00
170f969697 improved scanner interface 2025-10-06 14:21:52 +03:00
131fd891b0 added unlikely 2025-10-06 14:04:43 +03:00
a5396b72cb Merge pull request #81 from orange-cpp/feature/pattern_scan
Improves pattern scanning functionality and adds corner case tests
2025-10-05 15:59:59 +03:00
ec876ea292 Includes header for fixed-width integer types
Adds `#include ` to ensure platform-independent use of fixed-width integer types.
2025-10-05 15:56:35 +03:00
8021050fad Uses std::ranges::find for pattern scanning
Replaces `std::find` with `std::ranges::find` for improved code consistency and potentially better performance when dealing with ranges.
2025-10-05 15:54:54 +03:00
bd585b5412 Uses parsed pattern size in pattern scan
Updates the pattern scan loop to iterate over the size of the parsed pattern, ensuring correct iteration when using parsed patterns.
2025-10-05 14:14:31 +03:00
06f9a8c9ee Adds pattern scanning functionality and corner case tests
Implements a pattern scanning feature that allows searching for byte patterns within a byte range.

Adds `scan_for_pattern` method to `PatternScanner` to locate a pattern within a byte span.

Adds corner case tests to verify functionality and handle invalid inputs.
2025-10-05 06:37:20 +03:00
160b51da94 Adds corner case tests for pattern scanning
Adds new test cases to cover additional scenarios for pattern scanning, including tests for leading/trailing whitespace and spacing variations to ensure robustness.
2025-10-04 18:43:05 +03:00
064edf9ef1 Handles empty pattern strings
Skips processing when encountering an empty string slice during pattern scanning.
This prevents unexpected behavior and potential errors when the pattern string contains sections that result in an empty byte string.
2025-10-04 18:33:57 +03:00
f17d36dcd3 Adds pattern scanning functionality
Implements a pattern scanner for byte sequence parsing.

Introduces `omath::PatternScanner` to parse pattern strings, which represent byte sequences.
Adds support for wildcard characters ('?' and '?') to represent optional bytes in the pattern.
Includes unit tests for basic read operations to ensure proper functionality.
2025-10-04 18:30:43 +03:00
ec4f9f6c90 Merge pull request #80 from orange-cpp/feature/rev_eng
Feature: Reverse Engineering classes
2025-10-04 10:09:07 +03:00
cbee8c2c95 finished test 2025-10-04 10:04:34 +03:00
dc6edbb67f update global header 2025-10-04 09:52:14 +03:00
74381eda5c added external class 2025-10-04 09:47:48 +03:00
1ef7833bd9 reordored omath headers 2025-10-03 13:51:53 +03:00
c10386f3f6 added rev_object 2025-10-03 13:43:47 +03:00
413cef4f23 version update v3.8.2 2025-10-03 13:16:48 +03:00
867cee41c3 femoved useless file 2025-10-03 13:14:11 +03:00
990fe78a33 fixed wrong spam of command option into build log 2025-10-03 12:40:18 +03:00
1efdb50f73 Merge pull request #78 from luadebug/patch-1
CMakeLists.txt: support AVX2 detection
2025-10-01 03:10:24 +03:00
Saikari
86fea065e7 CMakeLists.txt: do not use /ARCH:AVX since we have /ARCH:AVX2 already 2025-09-30 23:40:07 +03:00
Saikari
ac046aae6c Update CMakeLists.txt 2025-09-30 23:18:00 +03:00
Saikari
9646054877 CMakeLists.txt: support AVX2 detection for https://github.com/xmake-io/xmake-repo/pull/8277 2025-09-30 21:40:25 +03:00
6334002639 forgot linux macos 2025-09-29 11:23:28 +03:00