Register - Login
Views: 99391011
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
04-24-22 09:27:38 AM
Jul - The Cutting Room Floor - Mega Man X1 copy protection New poll - New thread - New reply
Next newer thread | Next older thread
devin

Yoshi
i'm mima irl
Level: 112


Posts: 3042/3519
EXP: 14918959
For next: 419246

Since: 04-29-08

Pronouns: any
From: FL

Since last post: 297 days
Last activity: 1 day

Posted on 04-12-14 01:28:54 AM (last edited by devin at 04-13-14 12:00:56 AM) Link | Quote
Here are some notes I took about some rather aggressive copy protection in Mega Man X. It checks for the presence of SRAM at various addresses and has (at least) three main effects if it detects it:
  • After 128 enemies have been destroyed, a Buster shot bouncing off of something will cause the level to abruptly end and return you to the intro, and dropped health pickups disappear almost immediately

  • After jumping between 128 and 256 times, every other jump will have severely reduced height

  • After taking damage 128 times, controller input becomes completely random every frame, making the game completely unplayable


Each effect has multiple redundant routines which try to detect (in a very specific, easy-to-circumvent way) if any of the other routines have been tampered with, and can make the effect even more apparent than normal - in probably the worst case, if the game thinks you're trying to hack away a part of the "random input" effect, it'll just take effect as soon as you collect any health instead. Pretty nasty.

Of course, the self-protection only works by testing a couple of specific bytes in each routine, so there are plenty of other ways around it. It's very aggressive and also very ineffectual.

There's an additional routine that checks the ROM itself to make sure it's mirrored correctly (specifically it makes sure banks 00 and 40 are mapped to the same physical ROM address), and if this fails, any enemy dropping a 1up will cause you to return to the intro stage at the end of the current stage. I haven't checked to see if this routine has similar hack protection.

I'm going to write about this on the article proper later, but here's some notes for now:

84A46D (A1): if $701000 (SRAM) is mapped, increase $1F9D (when destroying an enemy)

84A3BF (A2): if byte at $84A475 != $84A3C7 (A1 tampered), increase $1F9D (when destroying an enemy)
848FCD (A3): if byte at $84A481 != $849D29 (A2 tampered), increase $1F9D (every frame, wrapping FF->00)
if this is >= 128 when a buster shot bounces, the level ends prematurely and returns to the intro,
and dropped health pickups disappear immediately after landing

818526 (B1): if $700804 (SRAM) is mapped, increase $1F9E (when X begins falling)
819602 (B2): if word at $81853B != #$1F9E (B1 tampered), increase $1F9E (when jumping)
81942E (B3): if byte at $809E75 != $81853A (B1 tampered), $1F9E |= 128 immediately (when firing)
819950 (B4): if byte at $818533 != $81966A (B1 tampered), $1F9E |= 128 immediately (when jumping)
if this is >= 128, every other jump has half the maximum height until counter reaches 255
(possible other effects tied to this counter as well)

849D07 (C1): if $700505 (SRAM) is mapped, increase $1F9F (when X takes damage)
849F97 (C2): if byte at $849D0A != $849AF5 or $849D0E (C1 tampered), $1F9F |= 128 immediately (when X gains health)
when this is >= 128 , start spamming bogus controller input every frame

81816B (D1): if $700800 (SRAM) is mapped, increase $0C2B (dp+$83) (every frame)
effect unknown


____________________
Photo by Luc Viatour
devin

Yoshi
i'm mima irl
Level: 112


Posts: 3044/3519
EXP: 14918959
For next: 419246

Since: 04-29-08

Pronouns: any
From: FL

Since last post: 297 days
Last activity: 1 day

Posted on 04-15-14 12:48:39 AM (last edited by devin at 04-15-14 01:26:22 AM) Link | Quote
Small addendum: Demon's Crest; another SRAM/LoROM-based protection. This one doesn't try to protect itself.

80875A: if $701FFF is mapped, set byte at $7E0EEB to $FF (during capcom logo)

829B33: if byte at $80FFC0 != 40FFC0 (mirroring), set byte at $7E0EED to $FF (when ???)
cannot pause/view menu

80E561: if $701FFF is mapped, set byte at $7E0EEC to $FF (when taking damage)
BEE356: if byte at $80FFC1 != 40FFC1 (mirroring), set byte at $7E0EEE to $FF (when ???)
opening boss (or all bosses/all enemies?) invincible


Super Street Fighter II:

C407C3: if byte at $41934A != $C1934A (mirroring), increase $7E00EF (checked frequently during game)

screen is blanked once timer gets to about 50


____________________
Photo by Luc Viatour
Next newer thread | Next older thread
Jul - The Cutting Room Floor - Mega Man X1 copy protection New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

29 database queries, 1 query cache hits.
Query execution time:  0.085030 seconds
Script execution time:  0.007304 seconds
Total render time:  0.092334 seconds


TidyHTML vomit below
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 2 column 301 - Warning: unescaped & or unknown entity "&page"
line 119 column 11 - Warning: <form> isn't allowed in <table> elements
line 118 column 10 - Info: <table> previously mentioned
line 120 column 11 - Warning: missing <tr>
line 120 column 119 - Warning: missing </font> before </td>
line 124 column 16 - Warning: plain text isn't allowed in <tr> elements
line 120 column 11 - Info: <tr> previously mentioned
line 125 column 68 - Warning: missing </nobr> before </td>
line 141 column 68 - Warning: missing </nobr> before <tr>
line 147 column 35 - Warning: missing <tr>
line 147 column 50 - Warning: missing </font> before </td>
line 148 column 37 - Warning: unescaped & or unknown entity "&id"
line 147 column 198 - Warning: missing </font> before </table>
line 149 column 35 - Warning: missing <tr>
line 149 column 50 - Warning: missing </font> before </td>
line 149 column 91 - Warning: missing </font> before </table>
line 156 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 158 column 9 - Warning: missing <tr>
line 176 column 13 - Warning: missing <tr>
line 177 column 102 - Warning: unescaped & or unknown entity "&postid"
line 179 column 546 - Warning: missing </span> before <ul>
line 180 column 824 - Warning: inserting implicit <span>
line 181 column 1 - Warning: missing <li>
line 181 column 1 - Warning: inserting implicit <span>
line 181 column 1 - Warning: missing </span> before <li>
line 181 column 1037 - Warning: inserting implicit <span>
line 182 column 1 - Warning: missing <li>
line 182 column 1 - Warning: inserting implicit <span>
line 182 column 1 - Warning: missing </span> before <li>
line 182 column 1141 - Warning: inserting implicit <span>
line 183 column 1 - Warning: inserting implicit <span>
line 183 column 1 - Warning: missing </span> before <pre>
line 210 column 3789 - Warning: inserting implicit <span>
line 213 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 215 column 9 - Warning: missing <tr>
line 233 column 13 - Warning: missing <tr>
line 234 column 102 - Warning: unescaped & or unknown entity "&postid"
line 236 column 546 - Warning: missing </span> before <pre>
line 246 column 1 - Warning: inserting implicit <span>
line 246 column 1 - Warning: missing </span> before <pre>
line 250 column 1388 - Warning: inserting implicit <span>
line 253 column 17 - Warning: missing <tr>
line 253 column 17 - Warning: discarding unexpected <table>
line 256 column 35 - Warning: missing <tr>
line 256 column 50 - Warning: missing </font> before </td>
line 256 column 91 - Warning: missing </font> before </table>
line 258 column 35 - Warning: missing <tr>
line 258 column 50 - Warning: missing </font> before </td>
line 259 column 37 - Warning: unescaped & or unknown entity "&id"
line 258 column 198 - Warning: missing </font> before </table>
line 260 column 17 - Warning: discarding unexpected </textarea>
line 260 column 28 - Warning: discarding unexpected </form>
line 260 column 35 - Warning: discarding unexpected </embed>
line 260 column 43 - Warning: discarding unexpected </noembed>
line 260 column 53 - Warning: discarding unexpected </noscript>
line 260 column 64 - Warning: discarding unexpected </noembed>
line 260 column 74 - Warning: discarding unexpected </embed>
line 260 column 82 - Warning: discarding unexpected </table>
line 260 column 90 - Warning: discarding unexpected </table>
line 262 column 9 - Warning: missing </font> before <table>
line 274 column 25 - Warning: discarding unexpected </font>
line 283 column 57 - Warning: discarding unexpected </font>
line 261 column 1 - Warning: missing </center>
line 120 column 63 - Warning: <img> lacks "alt" attribute
line 125 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 125 column 93 - Warning: <img> lacks "alt" attribute
line 141 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 141 column 98 - Warning: <img> lacks "alt" attribute
line 148 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 246 - Warning: <img> proprietary attribute value "absmiddle"
line 160 column 11 - Warning: <img> lacks "alt" attribute
line 161 column 23 - Warning: <img> lacks "alt" attribute
line 161 column 64 - Warning: <img> lacks "alt" attribute
line 161 column 113 - Warning: <img> lacks "alt" attribute
line 161 column 163 - Warning: <img> lacks "alt" attribute
line 162 column 11 - Warning: <img> lacks "alt" attribute
line 172 column 15 - Warning: <img> lacks "alt" attribute
line 217 column 11 - Warning: <img> lacks "alt" attribute
line 218 column 23 - Warning: <img> lacks "alt" attribute
line 218 column 64 - Warning: <img> lacks "alt" attribute
line 218 column 113 - Warning: <img> lacks "alt" attribute
line 218 column 163 - Warning: <img> lacks "alt" attribute
line 219 column 11 - Warning: <img> lacks "alt" attribute
line 229 column 15 - Warning: <img> lacks "alt" attribute
line 259 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 259 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 259 column 246 - Warning: <img> proprietary attribute value "absmiddle"
line 268 column 25 - Warning: <img> lacks "alt" attribute
line 273 column 267 - Warning: <img> lacks "alt" attribute
line 149 column 50 - Warning: trimming empty <font>
line 253 column 17 - Warning: trimming empty <tr>
line 256 column 50 - Warning: trimming empty <font>
line 125 column 68 - Warning: <nobr> is not approved by W3C
line 141 column 68 - Warning: <nobr> is not approved by W3C
line 177 column 27 - Warning: <nobr> is not approved by W3C
line 234 column 27 - Warning: <nobr> is not approved by W3C
Info: Document content looks like HTML5
Info: No system identifier in emitted doctype
Tidy found 96 warnings and 0 errors!


The alt attribute should be used to give a short description
of an image; longer descriptions should be given with the
longdesc attribute which takes a URL linked to the description.
These measures are needed for people using non-graphical browsers.

For further advice on how to make your pages accessible
see http://www.w3.org/WAI/GL.
You are recommended to use CSS to specify the font and
properties such as its size and color. This will reduce
the size of HTML files and make them easier to maintain
compared with using <FONT> elements.

You are recommended to use CSS to control line wrapping.
Use "white-space: nowrap" to inhibit wrapping in place
of inserting <NOBR>...</NOBR> into the markup.

About HTML Tidy: https://github.com/htacg/tidy-html5
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
Validate your HTML documents: http://validator.w3.org/nu/
Lobby your company to join the W3C: http://www.w3.org/Consortium

Do you speak a language other than English, or a different variant of
English? Consider helping us to localize HTML Tidy. For details please see
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md