fioman
fioman

Reputation: 33

Flash AS3 Main swf's binary checksum

I have a 'Shell' swf as the main swf to protect other things in the project.

Shell swf's procedure is:

  1. check stage property, so it can't be loaded as a child.
  2. check Capabilities.isDebugger, so it can't be run in a debugger.
  3. load a decoder lib. the decoder lib is built by flascc, quite difficult to decompile.
  4. use decoder to validate self. if failed or skipped, decoder won't do any decoding job.
  5. load encoded main entry of the project, decode it & add it to stage.

The problem is step 4, I want to do binary checksum of Shell swf.

Questiones are:

  1. How can i get the original binary content of the Shell swf file on startup ?
  2. if not, is Shell swf's LoaderInfo.bytes consistent in different versions of flash player ?
  3. if not, is there any good way to do the validation job in step 4 ?

Upvotes: 1

Views: 383

Answers (1)

Alex Koz.
Alex Koz.

Reputation: 497

If you create an AIR app you can temporarily load original file ("Shell.swf") in application bundle using standard URLLoader or File and FileStream. If your app will work in browser then you can get self-file-name and URL from loaderInfo and load it using URLLoader. Anyway after your verification process complete you need unload it.

Upvotes: 0

Related Questions