View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-11-2021 , 11:56   Re: [INC] Md5 Security Plugin
Reply With Quote #25

Quote:
Originally Posted by SpliN View Post
PHP Code:
#define IP "ip_here"

stock protection()
{
    new 
svip[25]
    
get_user_ip(0,svip,sizeof(svip)-1,0)
    if(!
equali(IP,svip))
    {
        
set_fail_state("This Plugin Licensed")
    }

You do know anyone can recompile amxx and nullify set_fail_state or hook& block it with orpheu/okapi, right??
No matter how complex your protection checks are(and here they are not, cause it can be bypassed by changing a cvar), if you use pause/set_fail_state anyone can remove your protection with 5 lines of code.

For anyone wondering, here is set_fail_state's windows signature for 1.8.2:
Code:
{
    "name"        : "set_fail_state",
    "library"     : "amxmodx_mm",
	 "arguments" :
    [
        {
            "type" : "pointer"
        },
		{
			"type" : "pointer"
		}
    ],
    "return" :
    {
        "type" : "int"
    },
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,"*",0x83,"*","*",0x6A,"*",0xB9,"*","*","*","*",0xE8,"*","*","*","*",0xB8]
        },    
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "to_be_determined"
        }
    ]
}
The linux signature can be determined too, but this is just an example. Now, just do OrpheuRegisterHook(OrpheuGetFunction("set_fai l_state"), ...) and return OrpheuSupercede. Boom, no need to worry about "protections" anymore.
__________________

Last edited by HamletEagle; 02-11-2021 at 12:01.
HamletEagle is offline