Skip to content

Commit 2982a0b

Browse files
authored
Merge branch 'avast:master' into master
2 parents e51a874 + b9791c8 commit 2982a0b

File tree

10 files changed

+49
-11
lines changed

10 files changed

+49
-11
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/bash
22

3-
brew install pkg-config autoconf automake libtool openssl python@3.7
4-
brew link --overwrite python@3.7
3+
brew install pkg-config autoconf automake libtool openssl python@3.10
4+
brew link --overwrite python@3.10

.github/workflows/retdec-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110

111111
docs-build:
112112
name: doxygen-build (Linux)
113-
runs-on: ubuntu-18.04
113+
runs-on: ubuntu-latest
114114

115115
steps:
116116
# Checkouts the correct commit/branch.

src/bin2llvmir/optimizations/decoder/decoder_init.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace bin2llvmir {
2121
/**
2222
* Initialize capstone2llvmir translator according to the architecture of
2323
* file to decompile.
24-
* @return @c True if error, @c false otherwise.
2524
*/
2625
void Decoder::initTranslator()
2726
{

src/bin2llvmir/optimizations/idioms/idioms_abstract.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ bool IdiomsAbstract::findBranchDependingOn(llvm::BranchInst ** br, llvm::BasicBl
4444
*
4545
* @param val instruction value to look for
4646
* @param bb BasicBlock to erase instruction from
47-
* @return void
4847
*/
4948
void IdiomsAbstract::eraseInstFromBasicBlock(llvm::Value * val, llvm::BasicBlock * bb) {
5049
for (llvm::BasicBlock::iterator end = bb->end(), i = bb->begin(); i != end; ++i) {

src/config/parameters.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ void Parameters::fixRelativePaths(const std::string& configPath)
476476

477477
/**
478478
* Returns JSON object (associative array) holding parameters information.
479-
* @return JSON object.
480479
*/
481480
template <typename Writer>
482481
void Parameters::serialize(Writer& writer) const

src/cpdetect/heuristics/heuristics.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,6 @@ bool Heuristics::parseOpen64Comment(const std::string &record)
585585

586586
/**
587587
* Try to detect used compiler based on content of comment sections
588-
* @return @c true if used compiler was successfully detected,
589-
* @c false otherwise
590588
*/
591589
void Heuristics::getCommentSectionsHeuristics()
592590
{

src/fileformat/file_format/pe/pe_format.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,10 @@ void PeFormat::loadDotnetHeaders()
21602160
metadataHeader->setVersion(version);
21612161
metadataHeader->setFlags(flags);
21622162

2163+
// Check if it is actually a .NET application, this check is important to be aligned with YARA scanning
2164+
if (!isDotNet())
2165+
return;
2166+
21632167
auto currentAddress = metadataHeaderStreamsHeader + 4;
21642168
for (std::uint64_t i = 0; i < streamCount; ++i)
21652169
{
@@ -2593,6 +2597,13 @@ void PeFormat::parseStringStream(std::uint64_t baseAddress, std::uint64_t offset
25932597
while (currentOffset < size)
25942598
{
25952599
std::string string;
2600+
std::uint64_t c = 0;
2601+
auto successful_read = get1Byte(address + currentOffset, c, getEndianness());
2602+
// If the reading fails (OOB or other) don't continue and terminate
2603+
if (!successful_read)
2604+
{
2605+
break;
2606+
}
25962607
getNTBS(address + currentOffset, string);
25972608
stringStream->addString(currentOffset, string);
25982609
// +1 for null-terminator

src/fileformat/types/dotnet_types/dotnet_type_reconstructor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ bool DotnetTypeReconstructor::reconstructNestedClasses()
666666
if (enclosingItr == defClassTable.end())
667667
continue;
668668

669+
// Ignore self-references
670+
if (nestedItr == enclosingItr)
671+
continue;
672+
669673
const std::string& namespac = nestedItr->second->getNameSpace();
670674
if (namespac.empty())
671675
{

src/fileinfo/file_information/file_information.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,6 @@ std::string FileInformation::getDepsListFailedToLoad() const
13421342

13431343
/**
13441344
* Sets the name of the dependency file that failed to load
1345-
* @return Nothing
13461345
*/
13471346
void FileInformation::setDepsListFailedToLoad(const std::string & depsList)
13481347
{

support/yara_patterns/tools/pe/x86/packers.yara

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@
66
import "pe"
77
import "dotnet"
88

9+
rule AppPacker_1_3_x {
10+
meta:
11+
tool = "P"
12+
name = "AppPacker 1.3.x"
13+
strings:
14+
$h01 = { 3C 53 65 72 47 72 65 65 6E 3E } // Overlay: "<SerGreen>"
15+
condition:
16+
pe.data_directories[0x0E].virtual_address != 0 and // No pe.is_dotnet in retdec's YARA
17+
pe.version_info["Comments"] contains "Packed portable application inside" and
18+
pe.version_info["CompanyName"] contains "SerGreen" and
19+
$h01 at pe.overlay.offset
20+
}
21+
922
rule blizzard_protector {
1023
meta:
1124
tool = "P"
12-
name = "!EP"
25+
name = "BlizzardProtector"
1326
version = "1.0"
14-
extra = "BlizzardProtector"
1527
condition:
1628
filesize > 5MB and
1729
(pe.sections[4].name == "_RDATA" or pe.sections[5].name == "_RDATA" or pe.sections[6].name == "_RDATA" or pe.sections[7].name == "_RDATA") and
@@ -42,6 +54,23 @@ rule blizzard_protector {
4254
)
4355
}
4456

57+
rule cfusion_app_25
58+
{
59+
meta:
60+
tool = "P"
61+
name = "Clickteam Fusion"
62+
version = "2.5"
63+
strings:
64+
$s01 = "cf25appsync" wide // Created mutex
65+
$s02 = ".00.FusionApp" wide // Temporary directory suffix
66+
$s03 = "Mf2MainClassTh" wide // Window class
67+
condition:
68+
pe.is_32bit() and
69+
pe.exports("NvOptimusEnablement") and // Causes AMD drivers to select the most optimal GPU
70+
pe.exports("AmdPowerXpressRequestHighPerformance") and
71+
all of them
72+
}
73+
4574
rule ep_exepack_10 {
4675
meta:
4776
tool = "P"

0 commit comments

Comments
 (0)