|
11 | 11 | namespace BinaryObjectScanner.Protection |
12 | 12 | { |
13 | 13 | // TODO: Investigate SecuROM for Macintosh |
| 14 | + // TODO: Think of a way to detect dfe |
14 | 15 | public class SecuROM : IExecutableCheck<PortableExecutable>, IPathCheck |
15 | 16 | { |
16 | 17 | /// <summary> |
@@ -100,10 +101,15 @@ public class SecuROM : IExecutableCheck<PortableExecutable>, IPathCheck |
100 | 101 | /// <inheritdoc/> |
101 | 102 | public string? CheckExecutable(string file, PortableExecutable exe, bool includeDebug) |
102 | 103 | { |
103 | | - // Check if executable is a Securom PA Module |
| 104 | + // Check if executable is a SecuROM PA module |
104 | 105 | var paModule = CheckProductActivation(exe); |
105 | 106 | if (paModule != null) |
106 | 107 | return paModule; |
| 108 | + |
| 109 | + // Check if executable is another kind of SecuROM module |
| 110 | + var otherModule = CheckModule(exe); |
| 111 | + if (otherModule != null) |
| 112 | + return otherModule; |
107 | 113 |
|
108 | 114 | // Check if executable contains a SecuROM Matroschka Package |
109 | 115 | var package = exe.MatroschkaPackage; |
@@ -459,6 +465,74 @@ private static string GetV8WhiteLabelVersion(PortableExecutable exe) |
459 | 465 |
|
460 | 466 | // Custom Module Checks |
461 | 467 |
|
| 468 | + if (exe.ProductName.OptionalEquals("drEAm")) |
| 469 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()} - EA Game Authorization Management"; |
| 470 | + |
| 471 | + // Fallback for PA if none of the above occur, in the case of companies that used their own modified PA |
| 472 | + // variants. PiD refers to this as "SecuROM Modified PA Module". |
| 473 | + // Found in Redump entries 111997 (paul.dll) and 56373+56374 (AurParticleSystem.dll). The developers of |
| 474 | + // both, Softstar and Aurogon respectively(?), seem to have some connection, and use similar-looking |
| 475 | + // modified PA. It probably has its own name like EA's GAM, but I don't currently know what that would be. |
| 476 | + // Regardless, even if these are given their own named variant later, this check should remain in order to |
| 477 | + // catch other modified PA variants (this would have also caught EA GAM, for example) and to match PiD's |
| 478 | + // detection abilities. |
| 479 | + |
| 480 | + name = exe.ExportTable?.ExportNameTable?.Strings?[0]; |
| 481 | + if (name.OptionalEquals("drm_pagui_doit")) |
| 482 | + { |
| 483 | + // Not all of them are guaranteed to have an internal version |
| 484 | + var version = exe.GetInternalVersion(); |
| 485 | + if (string.IsNullOrEmpty(version)) |
| 486 | + return $"SecuROM Product Activation - Modified"; |
| 487 | + |
| 488 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()} - Modified"; |
| 489 | + } |
| 490 | + |
| 491 | + return null; |
| 492 | + } |
| 493 | + |
| 494 | + /// <summary> |
| 495 | + /// Helper method to check if a given PortableExecutable is another kind of SecuROM module. |
| 496 | + /// </summary> |
| 497 | + private static string? CheckModule(PortableExecutable exe) |
| 498 | + { |
| 499 | + // Alf.dll |
| 500 | + var name = exe.ProductName; |
| 501 | + if (name.OptionalEquals("DFA Unlock Dll")) |
| 502 | + return $"SecuROM DFA Unlock v{exe.GetInternalVersion()}"; |
| 503 | + |
| 504 | + if (name.OptionalEquals("Release Control Unlock Dll")) |
| 505 | + return $"SecuROM Release Control Unlock v{exe.GetInternalVersion()}"; |
| 506 | + |
| 507 | + // Dfa.dll and ca.dll. The former seems to become the latter later on. |
| 508 | + name = exe.FileDescription; |
| 509 | + if (name.OptionalEquals("SecuROM Data File Activation Library")) |
| 510 | + return $"SecuROM Data File Activation v{exe.GetInternalVersion()}"; |
| 511 | + |
| 512 | + // Copyright is only checked because "Content Activation Library" seems broad on its own. |
| 513 | + if (name.OptionalEquals("Content Activation Library") && exe.LegalCopyright.OptionalContains("Sony DADC Austria AG")) |
| 514 | + return $"SecuROM Content Activation v{exe.GetInternalVersion()}"; |
| 515 | + |
| 516 | + name = exe.InternalName; |
| 517 | + |
| 518 | + // Checks if ProductName isn't drEAm to organize custom module checks at the end. |
| 519 | + if (name.OptionalEquals("paul.dll", StringComparison.OrdinalIgnoreCase) ^ exe.ProductName.OptionalEquals("drEAm")) |
| 520 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()}"; |
| 521 | + else if (name.OptionalEquals("paul_dll_activate_and_play.dll")) |
| 522 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()}"; |
| 523 | + else if (name.OptionalEquals("paul_dll_preview_and_review.dll")) |
| 524 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()}"; |
| 525 | + |
| 526 | + name = exe.OriginalFilename; |
| 527 | + if (name.OptionalEquals("paul_dll_activate_and_play.dll")) |
| 528 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()}"; |
| 529 | + |
| 530 | + name = exe.ProductName; |
| 531 | + if (name.OptionalContains("SecuROM Activate & Play")) |
| 532 | + return $"SecuROM Product Activation v{exe.GetInternalVersion()}"; |
| 533 | + |
| 534 | + // Custom Module Checks |
| 535 | + |
462 | 536 | if (exe.ProductName.OptionalEquals("drEAm")) |
463 | 537 | return $"SecuROM Product Activation v{exe.GetInternalVersion()} - EA Game Authorization Management"; |
464 | 538 |
|
|
0 commit comments