diff --git a/Coding Guide.md b/Coding Guide.md index c7d3c10b..d2e8752b 100644 --- a/Coding Guide.md +++ b/Coding Guide.md @@ -373,14 +373,16 @@ If the project or directory you are looking for is not included in the above, pl This section contains information on in-code organization principles that depend on the part of the project you are working in. See the following table for details. +Typed checks, such as `IExecutableCheck` should always follow this order: `MSDOS`, `LinearExecutable`, `NewExecutable`, `PortableExecutable`. + | Project | Description | | --- | --- | | `BinaryObjectScanner` | Varies from file to file. | | `BinaryObjectScanner/FileType` | `IDetectable` implementations, `IExtractable` implementations, helper methods. | -| `BinaryObjectScanner/GameEngine` | `IContentCheck` implementations, `IExecutableCheck` implementations, `IExecutableCheck` implementations, `IExecutableCheck` implementations, `IPathCheck` implementations, `IExtractable` implementations, helper methods. | +| `BinaryObjectScanner/GameEngine` | `IContentCheck` implementations, `IExecutableCheck` implementations, `IPathCheck` implementations, `IExtractableExecutable` implementations, helper methods. | | `BinaryObjectScanner/Interfaces` | Methods ordered alphabetically. | -| `BinaryObjectScanner/Packer` | `IContentCheck` implementations, `IExecutableCheck` implementations, `IExecutableCheck` implementations, `IExecutableCheck` implementations, `IPathCheck` implementations, `IExtractable` implementations, helper methods. | -| `BinaryObjectScanner/Protection` | `IContentCheck` implementations, `IExecutableCheck` implementations, `IExecutableCheck` implementations, `IExecutableCheck` implementations, `IPathCheck` implementations, `IExtractable` implementations, helper methods. | +| `BinaryObjectScanner/Packer` | `IContentCheck` implementations, `IExecutableCheck` implementations, `IPathCheck` implementations, `IExtractableExecutable` implementations, helper methods. | +| `BinaryObjectScanner/Protection` | `IContentCheck` implementations, `IExecutableCheck` implementations, `IPathCheck` implementations, `IExtractableExecutable` implementations, helper methods. | | `ExtractionTool` | New functionality should be added as a combination of a flag with a long and a short form, a new line in the help text, and a new method (if necessary). | | `ProtectionScan` | New functionality should be added as a combination of a flag with a long and a short form, a new line in the help text, and a new method (if necessary). | diff --git a/Developer Guide.md b/Developer Guide.md index 233ad020..42d9034d 100644 --- a/Developer Guide.md +++ b/Developer Guide.md @@ -36,14 +36,18 @@ Adding a new checker or format should happen in a few distinct steps: - If it is a new supported file type (such as an archive format), create the file in `BinaryObjectScanner.FileType`. By default, you will need to implement `BinaryObjectScanner.Interfaces.IDetectable` or `BinaryObjectScanner.Interfaces.IExtractable`. Do not implement any other interfaces. Please consider asking project maintainers before doing this work, especially if there are external dependencies. - - If it is a new supported game engine or standard library, create the file in `BinaryObjectScanner.GameEngine`. By default, you will need to implement at least one of: `BinaryObjectScanner.Interfaces.IExecutableCheck`, `BinaryObjectScanner.Interfaces.IExecutableCheck`, and `BinaryObjectScanner.Interfaces.IExecutableCheck`. It is exceptionally rare to need to implement `BinaryObjectScanner.Interfaces.IPathCheck`. + - If it is a new supported game engine or standard library, create the file in `BinaryObjectScanner.GameEngine`. By default, you will need to implement `BinaryObjectScanner.Interfaces.IExecutableCheck` or `BinaryObjectScanner.Interfaces.IExtractableExecutable`. It is exceptionally rare to need to implement `BinaryObjectScanner.Interfaces.IPathCheck`. - - If it is a new supported executable packer, compressor, or installer format, create the file in `BinaryObjectScanner.Packer`. By default, you will need to implement `BinaryObjectScanner.Interfaces.IExtractable` as well as at least one of: `BinaryObjectScanner.Interfaces.IExecutableCheck`, `BinaryObjectScanner.Interfaces.IExecutableCheck`, and `BinaryObjectScanner.Interfaces.IExecutableCheck`. It is exceptionally rare to need to implement `BinaryObjectScanner.Interfaces.IPathCheck`. + - If it is a new supported executable packer, compressor, or installer format, create the file in `BinaryObjectScanner.Packer`. By default, you will need to implement at least one of: `BinaryObjectScanner.Interfaces.IExtractableExecutable`. It is exceptionally rare to need to implement `BinaryObjectScanner.Interfaces.IPathCheck`. - - If it is a new supported DRM scheme, copy protection, or obfuscator, create the file in `BinaryObjectScanner.Protection`. By default, you will need to implement at least one of:`BinaryObjectScanner.Interfaces.IExecutableCheck`, `BinaryObjectScanner.Interfaces.IExecutableCheck`, `BinaryObjectScanner.Interfaces.IExecutableCheck`, and `BinaryObjectScanner.Interfaces.IPathCheck`. It is exceptionally rare to need to implement `BinaryObjectScanner.Interfaces.Extractable`. + - If it is a new supported DRM scheme, copy protection, or obfuscator, create the file in `BinaryObjectScanner.Protection`. By default, you will need to implement at least one of: `BinaryObjectScanner.Interfaces.IExecutableCheck`, `BinaryObjectScanner.Interfaces.IExtractableExecutable`, or `BinaryObjectScanner.Interfaces.IPathCheck`. - In addition to the above, there is a debug-only interface called `BinaryObjectScanner.Interfaces.IContentCheck`. Though there are examples of this being used in code, it is highly recommended to avoid this in a final implementation. + - Typed executable checks, such as `IExecutableCheck` should always follow this order: `MSDOS`, `LinearExecutable`, `NewExecutable`, `PortableExecutable`. + + - If both `IExecutableCheck` and `IExtractableExecutable` are needed, only `IExtractableExecutable` is required because it extends from `IExecutableCheck`. + 2. Look at other, similar classes for guidelines on how any given set of checks should be implemented. Test early and often, including using debugging tools. Err on the side of over-commenting. Do not try to be clever with your code; readable code is royalty. 3. Unless otherwise directed to by a maintainer, the only way to get changes in is through a pull request on GitHub. We do not accept patches in the form of patchfiles or archives. Please note that the maintainers may need an increased amount of time to review for obscure or hard-to-find protections.