Better split matching code, fix UPX name

This commit is contained in:
Matt Nadareski
2021-03-22 00:41:18 -07:00
parent ea022de022
commit 7aca58a6c9
47 changed files with 251 additions and 200 deletions

View File

@@ -22,7 +22,7 @@ namespace BurnOutSharp.PackerType
}, "Caphyon Advanced Installer"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
}
}

View File

@@ -17,7 +17,7 @@ namespace BurnOutSharp.PackerType
new Matcher(new byte?[] { 0x41, 0x52, 0x4D, 0x44, 0x45, 0x42, 0x55, 0x47 }, "Armadillo"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
}
}

View File

@@ -29,7 +29,7 @@ namespace BurnOutSharp.PackerType
}, end: 200), "CExe"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
/// <inheritdoc/>

View File

@@ -21,7 +21,7 @@ namespace BurnOutSharp.PackerType
}, "EXE Stealth"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
}
}

View File

@@ -23,7 +23,7 @@ namespace BurnOutSharp.PackerType
"Inno Setup"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
/// <inheritdoc/>

View File

@@ -29,7 +29,7 @@ namespace BurnOutSharp.PackerType
}, "NSIS"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
public static string GetVersion(string file, byte[] fileContent, int index)

View File

@@ -27,7 +27,7 @@ namespace BurnOutSharp.PackerType
}, "PE Compact 2"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
public static string GetVersion(string file, byte[] fileContent, int position)

View File

@@ -44,7 +44,7 @@ namespace BurnOutSharp.PackerType
// }, GetVersion, "Setup Factory"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
/// <inheritdoc/>

View File

@@ -12,7 +12,7 @@ namespace BurnOutSharp.PackerType
var matchers = new List<Matcher>
{
// UPX!
new Matcher(new byte?[] { 0x55, 0x50, 0x58, 0x21 }, GetVersion, "Inno Setup"),
new Matcher(new byte?[] { 0x55, 0x50, 0x58, 0x21 }, GetVersion, "UPX"),
// NOS
new Matcher(new byte?[] { 0x4E, 0x4F, 0x53, 0x20 }, GetVersion, "UPX (NOS Variant)"),
@@ -42,7 +42,7 @@ namespace BurnOutSharp.PackerType
),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
public static string GetVersion(string file, byte[] fileContent, int index)

View File

@@ -26,7 +26,7 @@ namespace BurnOutSharp.PackerType
}, "WinRAR SFX"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
public Dictionary<string, List<string>> Scan(Scanner scanner, string file)

View File

@@ -29,7 +29,7 @@ namespace BurnOutSharp.PackerType
new Matcher(new byte?[] { 0x5F, 0x77, 0x69, 0x6E, 0x7A, 0x69, 0x70, 0x5F }, GetVersion, "WinZip SFX"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
/// <inheritdoc/>

View File

@@ -20,7 +20,7 @@ namespace BurnOutSharp.PackerType
new Matcher(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
/// <inheritdoc/>

View File

@@ -19,7 +19,7 @@ namespace BurnOutSharp.PackerType
}, "dotFuscator"),
};
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
}
}
}