|
7 | 7 | namespace BinaryObjectScanner.Packer |
8 | 8 | { |
9 | 9 | // TODO: Add extraction |
| 10 | + // TODO: Research and add support for ASProtect. It seems to be an additional layer of protection for ASPack, making detecting it separately more difficult. |
10 | 11 | public class ASPack : IExtractableExecutable<PortableExecutable> |
11 | 12 | { |
12 | 13 | /// <inheritdoc/> |
@@ -35,6 +36,16 @@ public class ASPack : IExtractableExecutable<PortableExecutable> |
35 | 36 | return match; |
36 | 37 | } |
37 | 38 |
|
| 39 | + // Get the .data/DATA section, if it exists |
| 40 | + var dataSectionRaw = pex.GetFirstSectionData(".data") ?? pex.GetFirstSectionData("DATA"); |
| 41 | + if (dataSectionRaw != null) |
| 42 | + { |
| 43 | + var matchers = GenerateMatchers(); |
| 44 | + var match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug); |
| 45 | + if (!string.IsNullOrEmpty(match)) |
| 46 | + return match; |
| 47 | + } |
| 48 | + |
38 | 49 | return null; |
39 | 50 | } |
40 | 51 |
|
@@ -552,6 +563,38 @@ private static List<ContentMatchSet> GenerateMatchers() |
552 | 563 | 0x1C, 0x00 |
553 | 564 | }, "ASPack 2.x (without Poly) -> Solodovnikov Alexey"), |
554 | 565 |
|
| 566 | + // Commented out due to "ASPack 2.1" getting detected before this. More research is needed. |
| 567 | + // Based on detection rules from https://github.com/x64dbg/yarasigs/blob/master/Old_Internal_PEiD.yara |
| 568 | + /* new(new byte?[] |
| 569 | + { |
| 570 | + 0x60, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9, 0xEB, |
| 571 | + 0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01, 0x00, |
| 572 | + 0x00, 0x00, 0xEB, 0x5D, 0xBB, 0xED, 0xFF, 0xFF, |
| 573 | + 0xFF, 0x03, 0xDD, 0x81, 0xEB, 0x00, null, null, |
| 574 | + null, 0x80, 0x7D, 0x4D, 0x01, 0x75, 0x0C, 0x8B, |
| 575 | + 0x74, 0x24, 0x28, 0x83, 0xFE, 0x01, 0x89, 0x5D, |
| 576 | + 0x4E, 0x75, 0x31, 0x8D, 0x45, 0x53, 0x50, 0x53, |
| 577 | + 0xFF, 0xB5, null, 0x09, 0x00, 0x00, 0x8D, 0x45, |
| 578 | + 0x35, 0x50, 0xE9, 0x82, 0x00, 0x00, 0x00, 0x00, |
| 579 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 580 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 581 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, null, |
| 582 | + 0x00, 0x00, 0x00, 0x00, 0xB8, 0xF8, 0xC0, 0xA5, |
| 583 | + 0x23, 0x50, 0x50, 0x03, 0x45, 0x4E, 0x5B, 0x85, |
| 584 | + 0xC0, 0x74, 0x1C, 0xEB, 0x01, 0xE8, 0x81, 0xFB, |
| 585 | + 0xF8, 0xC0, 0xA5, 0x23, 0x74, 0x35, 0x33, 0xD2, |
| 586 | + 0x56, 0x6A, 0x00, 0x56, 0xFF, 0x75, 0x4E, 0xFF, |
| 587 | + 0xD0, 0x5E, 0x83, 0xFE, 0x00, 0x75, 0x24, 0x33, |
| 588 | + 0xD2, 0x8B, 0x45, 0x41, 0x85, 0xC0, 0x74, 0x07, |
| 589 | + 0x52, 0x52, 0xFF, 0x75, 0x35, 0xFF, 0xD0, 0x8B, |
| 590 | + 0x45, 0x35, 0x85, 0xC0, 0x74, 0x0D, 0x68, 0x00, |
| 591 | + 0x80, 0x00, 0x00, 0x6A, 0x00, 0xFF, 0x75, 0x35, |
| 592 | + 0xFF, 0x55, 0x3D, 0x5B, 0x0B, 0xDB, 0x61, 0x75, |
| 593 | + 0x06, 0x6A, 0x01, 0x58, 0xC2, 0x0C, 0x00, 0x33, |
| 594 | + 0xC0, 0xF7, 0xD8, 0x1B, 0xC0, 0x40, 0xC2, 0x0C, |
| 595 | + 0x00 |
| 596 | + }, "ASProtect SKE 2.x -> Solodovnikov Alexey"), */ |
| 597 | + |
555 | 598 | #endregion |
556 | 599 |
|
557 | 600 | #region 2.xx (Long) |
|
0 commit comments