Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
Bumps version
Adds a new detection method (currently only detects qlutch)
  • Loading branch information
OpticFusion1 committed Feb 17, 2021
1 parent 1be1769 commit 02e668e
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 209 deletions.
2 changes: 1 addition & 1 deletion MCAntiMalware-Core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<artifactId>MCAntiMalware</artifactId>
<packaging>jar</packaging>
<version>8.4.4</version>
<version>8.5</version>

<build>
<resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,30 @@ public boolean isWebsiteBlacklisted(String website) {
return a(isWebsiteBlacklisted, website);
}

private final String isFileNameBlacklisted = "SELECT count(*) FROM BlacklistedFileNames WHERE Name LIKE ?";

public boolean isFileNameBlacklisted(String fileName){
return a(isFileNameBlacklisted, fileName);
}

private final String fileNameToCheckResult = "SELECT type, platform, family, variant FROM BlacklistedFileNames INNER JOIN MalwareChecks ON BlacklistedFileNames.MalwareID = MalwareChecks._rowid_ WHERE Name = ?";

public CheckResult blacklistedFileNameToCheckResult(String fileName) {
try {
PreparedStatement pSt = connection.prepareStatement(fileNameToCheckResult);
pSt.setString(1, fileName);
try (ResultSet rs = pSt.executeQuery()) {
if (rs.next()) {
return new CheckResult(rs.getString("platform"), rs.getString("type"), rs.getString("family"),
rs.getString("variant"));
}
}
} catch (SQLException ex) {
logger.exception(ex);
}
return null;
}

//TOOD: Come up with a proper name for the method and "a" parameter
private boolean a(String query, String a) {
try {
Expand Down
Loading

0 comments on commit 02e668e

Please sign in to comment.