ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.1k stars 777 forks source link

Castle War 2 - Obfuscation Error #14938

Open desertking opened 5 months ago

desertking commented 5 months ago

Describe the bug

The game throws an obfuscation error. Some weird obfuscation is happening here, google even flagged it as a malware..

ERROR core/src/display_object/movie_clip.rs:2225 Got "TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: date)" when constructing AVM2 side of movie clip of type Please_Dont_Decompile*-___--_-_::Please_Dont_Decompile*-__-_---_

From Discord: uqers the obfuscator replaced all identifiers with Please_Dont_Decompile* followed by random dashes and underscores

Expected behavior

Load & Run

Content Location

https://www.spiele-umsonst.de/azad/downloads/flashgames/castlewars2.swf

Affected platform

Online demo

Operating system

All

Browser

All

Additional information

No response

n0samu commented 5 months ago

The bug isn't really related to obfuscation, it just makes finding the real bug a lot harder. 😛 Last time I looked at it, it seemed related to regex. It runs exec on a RegExp object and expects the returned value to have a date property.

Aaron1011 commented 1 week ago

The swf tries to use the regexp "#(?P<date>(.*))$. This needs named capture groups: https://github.com/ruffle-rs/ruffle/issues/10395