Site Locking, is this easy in Monkey?

Monkey Forums/Monkey Programming/Site Locking, is this easy in Monkey?

Armitage1982(Posted 2013) [#1]
Someone is asking in the BlitzMax forum if Site Locking is possible with the current version of Monkey :
I'v searched the monkeycoder and blitz forums and can't get any info on this.
Id hate to buy it without knowing if its gonna be a problem.

(http://blitzmax.com/Community/posts.php?topic=101384)

I thought it would be a good idea to get answers here.


Gerry Quinn(Posted 2013) [#2]
It's not built-in, but you can always do whatever you want to the native code to try to achieve site locking. For example there are ActionScript recipes for site-locking Flash, and Monkey gets translated into ActionScript which you can modify, before it makes a Flash program.


bazmonkey(Posted 2013) [#3]
I'm not an expert, but I looked into all this recently.

For site locking I've used something like:
https://www.mochimedia.com/community/forum/topic/how-to-sitelock-games-edit-fixed-code-shown
https://www.mochimedia.com/community/forum/topic/what-is-the-easiest-way-to-sitelock-a-game-as3

But, these are basic measures and easy to crack [Edit - but better than nothing as 'programmer' says below].

Other tools can provide obfuscation, and encryption of the swf inside a wrapper, adding some extra layers, and maybe protecting the site lock code.

I've used a simple preloader along the lines of therevills's method:
http://monkeycoder.co.nz/Community/posts.php?topic=2406
Depending on how you do it, the generated monkey code doesn't need to be altered, its just embedded by the preloader.

Mochi adds its own preloader and encryption, if you choose to distribute that way (but its still hacked I think). Ultimately, its all a lot of work to do properly, you could just buy secureSwf, but even that is not unhackable.


programmer(Posted 2013) [#4]
Extern

#If TARGET="flash"
Function GetDomain:String()="function():String { return new flash.net.LocalConnection().domain; }"
#EndIf

Public

#If TARGET<>"flash"
Function GetDomain:String()
    Return ""
End Function
#EndIf

Usage:
Print("Current domain: " + GetDomain())
If GetDomain() <> "ungrounded.net" Then
    Error("STOLEN!")
EndIf



bazmonkey(Posted 2013) [#5]
my concern is people will think a 1-line domain check is secure, when in fact all their code is easily accessible via any decompiler. one click and that line of code is gone.


programmer(Posted 2013) [#6]
my concern is people will think a 1-line domain check is secure, when in fact all their code is easily accessible via any decompiler.
IMHO My 1-line domain check is enough. Because chinese hackers can hack any site-lock in less then 5 mins using RABCDAsm, SWF Memory Dump and/or SWF Revealer Ultimate. Even DoSWF is hackable.


bazmonkey(Posted 2013) [#7]
Agreed - its a tricky one. Fighting against something that is impossible to beat. 1-line check is better than nothing. And secureSwf is expensive :(