<TuT> Some protection

06/19/2013 11:29 MrGanja#1

You must config: your server ip, and the files of the client.

You must cript your .py file like base64 if we want to do the ip protection more better..

Python script:
PHP Code:
    def login_UP(self):
        
t_serverInfo = serverInfo.TESTADDR["ip"]
        if 
not t_serverInfo == "your server ip":
            
snd.PlaySound("sound/ui/loginfail.wav")
            if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                
self.PopupDisplayMessage(text.EN["modify_file"])
            if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                
self.PopupDisplayMessage(text.DE["modify_file"])
            if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                
self.PopupDisplayMessage(text.IT["modify_file"])
            if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                
self.PopupDisplayMessage(text.RO["modify_file"])
            
net.Disconnect()
            return
        else:
            
self.login_Find()

    
def login_Find(self):
        
PrincipalyFiles = ['artpclnt.dll','channel.inf','devil.dll','DSETUP.dll','errorlog.exe','ErrorLog.txt','granny2.dll','ijl15.dll','ilu.dll','locale.cfg','metin2.cfg','metin2client.exe','mouse.cfg','mscoree.dll','MSS32.DLL','msvcp60.dll','MSVCRTD.DLL','python22.dll','SpeedTreeRT.dll','syserr.txt','unicows.dll','Thumbs.db','ymir.wmv','gf.wmv','BGM','lib','mark','miles','pack','screenshot','upload']
        
BGMFiles = ['a_rhapsody_of_war.mp3','another_way.mp3','back_to_back.mp3','blacksea.mp3','catacomb_of_devil.mp3','characterselect.mp3','death_of_landmark.mp3','desert.mp3','enter_the_east.mp3','follow_war_god.mp3','last-war2.mp3','login_window.mp3','lost_my_name.mp3','m2bg.mp3','misty_forest.mp3','monkey_temple.mp3','mountain_of_death.mp3','mt.mp3','Only_my_battle.mp3','open_the_gate.mp3','save_me.mp3','wedding.mp3','wonderland.mp3','xmas.mp3']
        
LibFiles = ['__future__.pyc','copy_reg.pyc','linecache.pyc','ntpath.pyc','os.pyc','site.pyc','stat.pyc','string.pyc','traceback.pyc','types.pyc','UserDict.pyc']
        
MilesFiles = ['mss32.dll','mssa3d.m3d','mssds3d.m3d','mssdsp.flt','mssdx7.m3d','msseax.m3d','mssmp3.asi','mssrsx.m3d','msssoft.m3d','mssvoice.asi']
        
PackFiles = ['BGM.eix','BGM.epk','Effect.eix','Effect.epk','ETC.eix','ETC.epk','guild.eix','guild.epk','icon.eix','icon.epk','Index','indoordeviltower1.eix','indoordeviltower1.epk','indoormonkeydungeon1.eix','indoormonkeydungeon1.epk','indoormonkeydungeon2.eix','indoormonkeydungeon2.epk','indoormonkeydungeon3.eix','indoormonkeydungeon3.epk','indoorspiderdungeon1.eix','indoorspiderdungeon1.epk','item.eix','item.epk','locale_ro.eix','locale_ro.epk','monster2.eix','monster2.epk','Monster.eix','Monster.epk','npc2.eix','npc2.epk','NPC.eix','NPC.epk','Outdoor.eix','Outdoor.epk','OutdoorA1.eix','OutdoorA1.epk','OutdoorA2.eix','OutdoorA2.epk','OutdoorA3.eix','OutdoorA3.epk','OutdoorB1.eix','OutdoorB1.epk','OutdoorB3.eix','OutdoorB3.epk','OutdoorC1.eix','OutdoorC1.epk','OutdoorC3.eix','OutdoorC3.epk','outdoordesert1.eix','outdoordesert1.epk','outdoorduel.eix','outdoorduel.epk','outdoorempirebattle1.eix','outdoorempirebattle1.epk','outdoorfielddungeon1.eix','outdoorfielddungeon1.epk','outdoorflame1.eix','outdoorflame1.epk','outdoorgmguildbuild.eix','outdoorgmguildbuild.epk','outdoorguild1.eix','outdoorguild1.epk','outdoorguild2.eix','outdoorguild2.epk','outdoorguild3.eix','outdoorguild3.epk','outdoormilgyo1.eix','outdoormilgyo1.epk','OutdoorSnow1.eix','OutdoorSnow1.epk','outdoort1.eix','outdoort1.epk','outdoort2.eix','outdoort2.epk','outdoort3.eix','outdoort3.epk','outdoort4.eix','outdoort4.epk','outdoortrent02.eix','outdoortrent02.epk','outdoortrent.eix','outdoortrent.epk','outdoorwedding.eix','outdoorwedding.epk','pc2.eix','pc2.epk','PC.eix','PC.epk','Property.eix','Property.epk','Psyco.eix','Psyco.epk','root.eix','root.epk','season1.eix','season1.epk','season2.eix','season2.epk','season3_eu.eix','season3_eu.epk','sound2.eix','sound2.epk','Sound.eix','Sound.epk','Terrain.eix','Terrain.epk','textureset.eix','textureset.epk','Tree.eix','Tree.epk','uiloading.eix','uiloading.epk','uiscript.eix','uiscript.epk','Zone.eix','Zone.epk']
        
        
path = os.getcwd()
        
principaly = os.listdir(path)
        
bgm = os.listdir('BGM')
        
lib = os.listdir('lib')
        
miles = os.listdir('miles')
        
pack = os.listdir('pack')
        if 
principaly != PrincipalyFiles:
            for 
item in principaly:
                if 
not item in PrincipalyFiles:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["corrupted_file"] + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["corrupted_file"] + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["corrupted_file"] + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["corrupted_file"] + str(item) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if PrincipalyFiles != principaly:
            for 
missing in PrincipalyFiles:
                if 
not missing in principaly:
                    if 
str(missing) == "Thumbs.db":
                        
pass
                    
else:
                        
snd.PlaySound("sound/ui/loginfail.wav")
                        if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                            
self.PopupNotifyMessage(text.EN["missing_file"] + str(missing) + " .")
                        if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                            
self.PopupNotifyMessage(text.IT["missing_file"] + str(missing) + " .")
                        if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                            
self.PopupNotifyMessage(text.DE["missing_file"] + str(missing) + " .")
                        if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                            
self.PopupNotifyMessage(text.RO["missing_file"] + str(missing) + " .")
                        
net.Disconnect()
                        return
                else:
                    
pass
        
        
if bgm != BGMFiles:
            for 
item in bgm:
                if 
not item in BGMFiles:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["corrupted_file"] + "../BGM/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["corrupted_file"] + "../BGM/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["corrupted_file"] + "../BGM/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["corrupted_file"] + "../BGM/" + str(item) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if BGMFiles != bgm:
            for 
missing in BGMFiles:
                if 
not missing in bgm:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["missing_file"] + "../BGM/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["missing_file"] + "../BGM/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["missing_file"] + "../BGM/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["missing_file"] + "../BGM/" + str(missing) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if lib != LibFiles:
            for 
item in lib:
                if 
not item in LibFiles:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["corrupted_file"] + "../lib/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["corrupted_file"] + "../lib/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["corrupted_file"] + "../lib/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["corrupted_file"] + "../lib/" + str(item) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if LibFiles != lib:
            for 
missing in LibFiles:
                if 
not missing in lib:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["missing_file"] + "../lib/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["missing_file"] + "../lib/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["missing_file"] + "../lib/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["missing_file"] + "../lib/" + str(missing) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if miles != MilesFiles:
            for 
item in miles:
                if 
not item in MilesFiles:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["corrupted_file"] + "../miles/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["corrupted_file"] + "../miles/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["corrupted_file"] + "../miles/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["corrupted_file"] + "../miles/" + str(item) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if MilesFiles != miles:
            for 
missing in MilesFiles:
                if 
not missing in miles:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["missing_file"] + "../miles/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["missing_file"] + "../miles/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["missing_file"] + "../miles/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["missing_file"] + "../miles/" + str(missing) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if pack != PackFiles:
            for 
item in pack:
                if 
not item in PackFiles:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["corrupted_file"] + "../pack/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["corrupted_file"] + "../pack/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["corrupted_file"] + "../pack/" + str(item) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["corrupted_file"] + "../pack/" + str(item) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if PackFiles != pack:
            for 
missing in PackFiles:
                if 
not missing in pack:
                    
snd.PlaySound("sound/ui/loginfail.wav")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/en"):
                        
self.PopupNotifyMessage(text.EN["missing_file"] + "../pack/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/it"):
                        
self.PopupNotifyMessage(text.IT["missing_file"] + "../pack/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/de"):
                        
self.PopupNotifyMessage(text.DE["missing_file"] + "../pack/" + str(missing) + " .")
                    if (
locale.IsEUROPE() and app.GetLocalePath() == "locale/ro"):
                        
self.PopupNotifyMessage(text.RO["missing_file"] + "../pack/" + str(missing) + " .")
                    
net.Disconnect()
                    return
                else:
                    
pass
        
        
if not IsLoginDelay():
            
snd.PlaySound("sound/ui/loginok.wav")
            
self.PopupDisplayMessage(locale.LOGIN_CONNECT_SUCCESS) 
PHP Code:
Open your introLogin.py, and find:
    
def OnHandShake(self):
now cancel that and the option of this self and replace it:
    
def OnHandShake(self):
        
self.login_UP()

you must add:
import os on line 1.

now copy the php of python script 
and reply on your introLogin. 
Text:
PHP Code:
EN = {"modify_file" : "Some files have been modified.", "corrupted_file" : "Corrupted file: ","missing_file" : "Missing file: "}

IT = {"modify_file" : "Alcuni file sono stati modificati.", "corrupted_file" : "File danneggiato: ","missing_file" : "File mancante: "}

DE = {"modify_file" : "Einige dateien geändert wurden.", "corrupted_file" : "Beschädigte datei: ","missing_file" : "Fehlende datei: "}

RO = {"modify_file" : "Unele fiºiere au fost modificate.", "corrupted_file" : "Fiºier corupt: ","missing_file" : "Lipseºte fiºierul: "} 
PHP Code:
Create a new file and named it text.py, now copy and paste the php code into your new file. (you must use ANSI character) after you finish put text.py on your root file. 
PHP Code:
At the moment i work at a new check more better like this:

        
import md5
        m01 
= md5.md5(read.yourfile).hexdigest()
        
        if 
not m01 = "right hexdigest":
            
file = open("syserr.txt", "w")
            
file.write("Corupted file")
            
net.Disconnect()
        else
            
pass 
06/19/2013 11:33 HaveBeen™#2
it isn't bad thanks dude.
06/19/2013 11:56 Mt2magic#3
this will protect my client from hacks
06/19/2013 12:03 Mi4uric3#4
Quote:
Originally Posted by Mt2magic View Post
this will protect my client from hacks
No, it will just make it a bit harder to put files in the directory of the game-client..
If you implement the md5 function it will make modifying your client harder.

But both can easily be bypassed..
06/19/2013 12:11 MrGanja#5
Quote:
Originally Posted by Mt2magic View Post
this will protect my client from hacks
.mix file.

There are a solution about the injection like to make a virtual memory how get your default module with a timer like 60 seconds.

So when the timer is start will search the actual module from your process and if there are a new module the client will be closed..

Quote:
Originally Posted by Mi4uric3 View Post
No, it will just make it a bit harder to put files in the directory of the game-client..
If you implement the md5 function it will make modifying your client harder.

But both can easily be bypassed..
both easily : i specified you must cript your .py file in base64 or a personal key.
For md5 : The function already i implement, not really man, example:
result = open metin2client.exe ,read line text
md5 = now hexdigest of the result.

Why hexdigest? because you can compare the md5 easily using a hex.
A simple digest can be resulted a character how you cannot use.
06/19/2013 12:19 Stαgє6#6
Hmm... It´s not bad thanks.
06/19/2013 12:53 DasKuchen#7
Instead of:
Quote:
PHP Code:
        PrincipalyFiles = ['artpclnt.dll','channel.inf','devil.dll','DSETUP.dll','errorlog.exe','ErrorLog.txt','granny2.dll','ijl15.dll','ilu.dll','locale.cfg','metin2.cfg','metin2client.exe','mouse.cfg','mscoree.dll','MSS32.DLL','msvcp60.dll','MSVCRTD.DLL','python22.dll','SpeedTreeRT.dll','syserr.txt','unicows.dll','Thumbs.db','ymir.wmv','gf.wmv','BGM','lib','mark','miles','pack','screenshot','upload']
        
BGMFiles = ['a_rhapsody_of_war.mp3','another_way.mp3','back_to_back.mp3','blacksea.mp3','catacomb_of_devil.mp3','characterselect.mp3','death_of_landmark.mp3','desert.mp3','enter_the_east.mp3','follow_war_god.mp3','last-war2.mp3','login_window.mp3','lost_my_name.mp3','m2bg.mp3','misty_forest.mp3','monkey_temple.mp3','mountain_of_death.mp3','mt.mp3','Only_my_battle.mp3','open_the_gate.mp3','save_me.mp3','wedding.mp3','wonderland.mp3','xmas.mp3']
        
LibFiles = ['__future__.pyc','copy_reg.pyc','linecache.pyc','ntpath.pyc','os.pyc','site.pyc','stat.pyc','string.pyc','traceback.pyc','types.pyc','UserDict.pyc']
        
MilesFiles = ['mss32.dll','mssa3d.m3d','mssds3d.m3d','mssdsp.flt','mssdx7.m3d','msseax.m3d','mssmp3.asi','mssrsx.m3d','msssoft.m3d','mssvoice.asi']
        
PackFiles = ['BGM.eix','BGM.epk','Effect.eix','Effect.epk','ETC.eix','ETC.epk','guild.eix','guild.epk','icon.eix','icon.epk','Index','indoordeviltower1.eix','indoordeviltower1.epk','indoormonkeydungeon1.eix','indoormonkeydungeon1.epk','indoormonkeydungeon2.eix','indoormonkeydungeon2.epk','indoormonkeydungeon3.eix','indoormonkeydungeon3.epk','indoorspiderdungeon1.eix','indoorspiderdungeon1.epk','item.eix','item.epk','locale_ro.eix','locale_ro.epk','monster2.eix','monster2.epk','Monster.eix','Monster.epk','npc2.eix','npc2.epk','NPC.eix','NPC.epk','Outdoor.eix','Outdoor.epk','OutdoorA1.eix','OutdoorA1.epk','OutdoorA2.eix','OutdoorA2.epk','OutdoorA3.eix','OutdoorA3.epk','OutdoorB1.eix','OutdoorB1.epk','OutdoorB3.eix','OutdoorB3.epk','OutdoorC1.eix','OutdoorC1.epk','OutdoorC3.eix','OutdoorC3.epk','outdoordesert1.eix','outdoordesert1.epk','outdoorduel.eix','outdoorduel.epk','outdoorempirebattle1.eix','outdoorempirebattle1.epk','outdoorfielddungeon1.eix','outdoorfielddungeon1.epk','outdoorflame1.eix','outdoorflame1.epk','outdoorgmguildbuild.eix','outdoorgmguildbuild.epk','outdoorguild1.eix','outdoorguild1.epk','outdoorguild2.eix','outdoorguild2.epk','outdoorguild3.eix','outdoorguild3.epk','outdoormilgyo1.eix','outdoormilgyo1.epk','OutdoorSnow1.eix','OutdoorSnow1.epk','outdoort1.eix','outdoort1.epk','outdoort2.eix','outdoort2.epk','outdoort3.eix','outdoort3.epk','outdoort4.eix','outdoort4.epk','outdoortrent02.eix','outdoortrent02.epk','outdoortrent.eix','outdoortrent.epk','outdoorwedding.eix','outdoorwedding.epk','pc2.eix','pc2.epk','PC.eix','PC.epk','Property.eix','Property.epk','Psyco.eix','Psyco.epk','root.eix','root.epk','season1.eix','season1.epk','season2.eix','season2.epk','season3_eu.eix','season3_eu.epk','sound2.eix','sound2.epk','Sound.eix','Sound.epk','Terrain.eix','Terrain.epk','textureset.eix','textureset.epk','Tree.eix','Tree.epk','uiloading.eix','uiloading.epk','uiscript.eix','uiscript.epk','Zone.eix','Zone.epk'] 
You sould read a patchlist.xml (With MD5) from a webspace and check the hashes.
06/19/2013 13:25 MrGanja#8
Quote:
Originally Posted by DasKuchen View Post
Instead of:

You sould read a patchlist.xml (With MD5) from a webspace and check the hashes.
It's a good ideea maybe later i update the script.., thank you.
06/20/2013 12:29 sekotr50#9
Woow :)
06/20/2013 12:54 Zetsu WoC™#10
not bad :D nice
09/15/2013 10:16 pezcabrutal#11
mm no fount this
[Only registered and activated users can see links. Click Here To Register...]
09/15/2013 13:53 Red Firestar#12
Danke fürs teilen ich habe es erst gerade eben gesehen habe es ausprobiert und es funktioniert.
09/15/2013 16:36 Tyrar#13
TuT mir leid (:awesome:), aber ich kann da überhaupt keinen Schutz erkennen. Das gesamte Teil ist innerhalb weniger Minuten umgangen.
09/17/2013 01:48 FCPorto15#14
i have any error
10/11/2013 06:24 DnoSkill#15
[Only registered and activated users can see links. Click Here To Register...]
help me