Skip to content

Commit c254729

Browse files
Check .data/DATA sections for ASPack as well (#340)
Also add some comments regarding ASProtect.
1 parent 58707fe commit c254729

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

BinaryObjectScanner/Packer/ASPack.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace BinaryObjectScanner.Packer
88
{
99
// 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.
1011
public class ASPack : IExtractableExecutable<PortableExecutable>
1112
{
1213
/// <inheritdoc/>
@@ -35,6 +36,16 @@ public class ASPack : IExtractableExecutable<PortableExecutable>
3536
return match;
3637
}
3738

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+
3849
return null;
3950
}
4051

@@ -552,6 +563,38 @@ private static List<ContentMatchSet> GenerateMatchers()
552563
0x1C, 0x00
553564
}, "ASPack 2.x (without Poly) -> Solodovnikov Alexey"),
554565

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+
555598
#endregion
556599

557600
#region 2.xx (Long)

0 commit comments

Comments
 (0)