Skip to content

Commit

Permalink
Updated: Copy Protection Section(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Apr 1, 2024
1 parent 0785e37 commit 4911149
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"alacritty",
"alloc",
"APPINSTALLER",
"Assasin's",
"autopopulated",
"bannerlord",
"behaviour",
Expand All @@ -15,6 +16,7 @@
"Breakin",
"characteroverhaul",
"CLSCTX",
"codefusion",
"Compat",
"COMPLUS",
"coreclr",
Expand Down Expand Up @@ -91,6 +93,8 @@
"runtimes",
"seasidehill",
"seasidehillmidnight",
"secdrv",
"Secu",
"SIGABRT",
"sigaction",
"SIGBUS",
Expand All @@ -107,6 +111,7 @@
"Steamless",
"Steamworks",
"struct",
"stxt",
"superfences",
"taleworlds",
"tasklist",
Expand All @@ -125,6 +130,7 @@
"winapi",
"winget",
"writeln",
"xdelta",
"Yeppers"
]
}
34 changes: 20 additions & 14 deletions docs/Loader/Copy-Protection/About.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# About Copy Protection
# About Copy Protection (DRM)

!!! info

Expand All @@ -11,26 +11,32 @@ And unfortunately, naturally, that means sometimes copy protection gets in the w

## Sub-Sections

- [Windows: Steam](./Windows-Steam.md)
- [Windows: Denuvo](./Windows-Denuvo.md)
- [Windows: Microsoft Store](./Windows-MSStore.md)
- [Windows: Steam](./Windows-Steam.md)
- [Windows: SafeDisc](./Windows-SafeDisc.md)

## Miscellaneous
## Suggestions & Actions

### Denuvo
### Prefer DRM-Free Versions

!!! question "Some Denuvo titles have Anti-Debugging Measures"
!!! info "Mods should always target DRM-Free version(s) of games if available."

However it is unclear whether it is an optional Denuvo component or additional DRM from the publisher.
In some rare scenarios a game may be officially distributed in both
DRM-Free and ***Defective by Design*** versions.

!!! info
Example: `Yakuza: Like a Dragon`

- [DRM Free Goodness](https://www.gog.com/en/game/yakuza_like_a_dragon) on GOG
- [Denuvo Infested Garbage](https://store.steampowered.com/app/1235140/Yakuza_Like_a_Dragon/) on Steam

The Steam version is harder to mod, may have more performance issues and will one day...

Some SEGA games circa 2017 featuring Denuvo also have an anti-debug measure where `ntdll.DbgUiRemoteBreakin` will
constantly be rewritten with `ret` (0xC3) on a background thread to prevent debugging.
***STOP. WORKING. FOREVER.***

It is usually easy to patch. Known affected titles include Sonic Forces and Puyo Puyo Tetris.
With the GOG version, you can at least have peace of mind and one day show your kids or grandkids
the joy of your childhood games.

Aside from obfuscating select game functions, generally Denuvo is
surprisingly the least intrusive modern DRM solution as far as loading mods is concerned.
### Prefer DRM-Free Versions

All the pain is transferred to those making mods, be it waiting 30 hours for static analysis
to finish, or obfuscating the random game function.
### Detection
40 changes: 40 additions & 0 deletions docs/Loader/Copy-Protection/Windows-Denuvo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Denuvo

Aside from obfuscating select game functions, generally Denuvo is
surprisingly the least intrusive modern DRM solution as far as loading mods is concerned.

All the pain is transferred to those making mods, be it waiting 30 hours for static analysis
to finish, or obfuscating the random game function.

That said, unlike something like SecuROM or SafeDisc, the original game isn't totally wrecked
all over the place.

## Detection

!!! info "Denuvo has an 'offline activation portal', in case your PC cannot connect to their servers."

This is a failsafe in case the game cannot connect to the Denuvo servers to verify the license.

By signature scanning for the domain `support.codefusion.technology` (usually UTF-16), you can verify
a game as Denuvo protected.

!!! note "Some extra optional steps"

After that URL you get 4 bytes (unknown purpose) and (in all my samples) `01 00 00 00 66 66 66 2E 0F 1F 84 00 00 00 00 00`.

Following that is another null terminated string which contains the specific product ID. For example, in `Persona 5 Royal`, this is `P5R_9AG4H12`.

Combine the two, you get `https://support.codefusion.technology/P5R_9AG4H12`.

## Anti-Debugging Measures

!!! question "Some Denuvo titles have Anti-Debugging Measures"

However it is unclear whether it is an optional Denuvo component or additional DRM from the publisher.

!!! info

Some SEGA games circa 2017 featuring Denuvo also have an anti-debug measure where `ntdll.DbgUiRemoteBreakin` will
constantly be rewritten with `ret` (0xC3) on a background thread to prevent debugging.

It is usually easy to patch. Known affected titles include Sonic Forces and Puyo Puyo Tetris.
43 changes: 43 additions & 0 deletions docs/Loader/Copy-Protection/Windows-SafeDisc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SafeDisc

!!! error "These games cannot be played on Wine or Windows 7+"

SafeDisc is not supported on Windows 7 and later, or on Wine.

This is due to the fact that SafeDisc requires a driver. Wine won't run kernel drivers,
and Windows 7 (with updates) and later have blacklisted the driver.

## Detection

### SafeDisc V1

Unknown.

### SafeDisc V2, V3, V4

Search for string `BoG_ *90.0&!! Yy>`.
Should usually be after Section Headers in PE header.

After this magic string, you can also extract version (if you feel like it).
It comes as set of `u32` integers right before section end.

Verified this to work with following games:

- SafeDisc V3 Confirmed with `Sims 2`
- SafeDisc V4 Confirmed with `Assasin's Creed` & `Sonic Heroes`

!!! tip "If you feel adventurous, you can also check for section named `stxt371`."

## Mitigation Strategies

Tell the user to get a DRM free version of the game.<br/>
This may either be a DRM-free release from the publisher (if possible), or a cracked version.

That's all.

!!! warning

Please do not distribute or post linked to cracked EXE files.

Binary diffs (e.g. xdelta, VCDiff) patches that convert legal installs to community preferred
game version(s) are ok, but not redistribution of unmodified game files.
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ nav:
- Other: Loader/Platforms/Other.md
- Copy Protection:
- About: Loader/Copy-Protection/About.md
- Windows - Steam: Loader/Copy-Protection/Windows-Steam.md
- Windows - Denuvo: Loader/Copy-Protection/Windows-Denuvo.md
- Windows - MS Store: Loader/Copy-Protection/Windows-MSStore.md
- Windows - Steam: Loader/Copy-Protection/Windows-Steam.md
- Backends:
- About: Loader/Backends/About.md
- Native: Loader/Backends/Native.md
Expand Down

0 comments on commit 4911149

Please sign in to comment.