Jump to content
  • 0
Sign in to follow this  
Kori

Python help

Question

Hello com,

I once asked in Python. I want to protect my Python datein by I want to convert the text to base64

for example:

Y29tbWFuZHMgPVsNCgkJeyJuYW1lIjoiL20iLCJjYW5fdXNlIjpbIltIYXh4MFJdIiwiW1NBXSIs
IltHTV0iLCJbTU9EXSIsXSx9LA0KCQl7Im5hbWUiOiIvYSIsImNhbl91c2UiOlsiW1NBXXhDUHgi
LCJbR01dIiwiW01PRF0iLF0sfSwNCgkJeyJuYW1lIjoiL3NldHNraWxsb3RoZXIiLCJjYW5fdXNl
IjpbIltTQV0iLCJbR01dIixdLH0sDQoJCXsibmFtZSI6Ii9wdXJnZSIsImNhbl91c2UiOlsiW1NB
XSIsIltHTV0iLCJbTU9EXSIsXSx9LA0KCQl7Im5hbWUiOiIvcHVsbCIsImNhbl91c2UiOlsiW1NB
XSIsIltHTV0iLCJbTU9EXSIsIltTR0FdIixdLH0sDQoJCXsibmFtZSI6IiFnbV8iLCJjYW5fdXNl
IjpbIltIYXh4MFJdIiwiW1NHQV0iLF0sfSwNCgldDQoJDQoJDQo=

the original file :

commands =[
		{"name":"/m","can_use":["[Haxx0R]","[SA]","[GM]","[MOD]",],},
		{"name":"/a","can_use":["[SA]","[GM]","[MOD]",],},
		{"name":"/setskillother","can_use":["[SA]","[GM]",],},
		{"name":"/purge","can_use":["[SA]","[GM]","[MOD]",],},
		{"name":"/pull","can_use":["[SA]","[GM]","[MOD]","[SGA]",],},
		{"name":"!gm_","can_use":["[Haxx0R]","[SGA]",],},
	]
	
	

Only when I start the client My proplem is then comes heaters error:

0325 15:36:18975 :: CreateFromMemoryFile: Cannot create texture
0325 15:36:19814 :: Unknown Server Command vw_index 68 | vw_index
0325 15:36:27617 :: Traceback (most recent call last):

0325 15:36:27617 ::   File "uiChat.py", line 465, in OnIMEReturn

0325 15:36:27617 ::   File "uiChat.py", line 367, in __SendTalkingChatPacket

0325 15:36:27617 ::   File "uiChat.py", line 219, in __SendChatPacket

0325 15:36:27617 ::   File "system.py", line 132, in __pack_import

0325 15:36:27617 :: TypeError
0325 15:36:27617 :: : 
0325 15:36:27617 :: compile() argument 1 must be string, not None
0325 15:36:27617 :: 

0325 15:36:27805 :: Traceback (most recent call last):

0325 15:36:27805 ::   File "uiChat.py", line 465, in OnIMEReturn

0325 15:36:27805 ::   File "uiChat.py", line 367, in __SendTalkingChatPacket

0325 15:36:27805 ::   File "uiChat.py", line 219, in __SendChatPacket

0325 15:36:27805 ::   File "system.py", line 132, in __pack_import

0325 15:36:27805 :: TypeError
0325 15:36:27805 :: : 
0325 15:36:27805 :: compile() argument 1 must be string, not None
0325 15:36:27805 :: 

I hope you can help me


Kori

Share this post


Link to post

10 answers to this question

Recommended Posts

  • 0

You need to make a function from base64 to normal text so in the system.py the compile function will be decode the base64 to normal text to run it.

 

Regards.

Share this post


Link to post
  • 0

i have this in my system.py

def __pack_import(name,globals=None,locals=None,fromlist=None):
	if name in sys.modules:
		return sys.modules[name]

	filename = name + '.py'

	if pack.Exist(filename):
		if filename.find("commands.py") != -1:
			dbg.Trace('importing from pack %sn' % name)

			newmodule = _process_result(compile(patcherLoader.Load(pack_file(filename,'r').read()),filename,'exec'),name)		

			module_do(newmodule)
			return newmodule
		else:
			dbg.Trace('importing from pack %sn' % name)

			newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name)		

			module_do(newmodule)
			return newmodule
			#return imp.load_module(name, pack_file(filename,'r'),filename,('.py','r',imp.PY_SOURCE))
	else:
		dbg.Trace('importing from lib %sn' % name)
		return old_import(name,globals,locals,fromlist)

and this in patcherloader:

import urllib
import os
import binascii

def Load(s):
    if urllib.urlopen(binascii.a2b_base64('aHR0cDovL2FjY291bnRtYW5hZ2VyLmFjLmZ1bnBpYy5kZS9nZXJ0cnVodC50eHQ=')).read().find('Gertruth') != -1:
        return binascii.a2b_base64(s)

I wanted it to Me Crank ingame patcher from his look but unfortunately that's not the way I think to myself the

Share this post


Link to post
  • 0

i have this in my system.py

def __pack_import(name,globals=None,locals=None,fromlist=None):
	if name in sys.modules:
		return sys.modules[name]

	filename = name + '.py'

	if pack.Exist(filename):
		if filename.find("commands.py") != -1:
			dbg.Trace('importing from pack %sn' % name)

			newmodule = _process_result(compile(patcherLoader.Load(pack_file(filename,'r').read()),filename,'exec'),name)		

			module_do(newmodule)
			return newmodule
		else:
			dbg.Trace('importing from pack %sn' % name)

			newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name)		

			module_do(newmodule)
			return newmodule
			#return imp.load_module(name, pack_file(filename,'r'),filename,('.py','r',imp.PY_SOURCE))
	else:
		dbg.Trace('importing from lib %sn' % name)
		return old_import(name,globals,locals,fromlist)

and this in patcherloader:

import urllib
import os
import binascii

def Load(s):
    if urllib.urlopen(binascii.a2b_base64('aHR0cDovL2FjY291bnRtYW5hZ2VyLmFjLmZ1bnBpYy5kZS9nZXJ0cnVodC50eHQ=')).read().find('Gertruth') != -1:
        return binascii.a2b_base64(s)

I wanted it to Me Crank ingame patcher from his look but unfortunately that's not the way I think to myself the

 

I prefer to do what Sanchez said.But if you want to do this thing with base64 just change the Load(s) function to:

import urllib
import os
import binascii
 
def Load(s):
[TAB]return binascii.a2b_base64(s)


And then I think it will works properly.

 

Regards.

Share this post


Link to post
  • 0

thanks it works but now this ...

0325 20:54:16443 :: CreateFromMemoryFile: Cannot create texture
0325 20:54:17325 :: Unknown Server Command vw_index 68 | vw_index
0325 20:54:17904 :: Traceback (most recent call last):

0325 20:54:17904 ::   File "uiChat.py", line 462, in OnIMEReturn

0325 20:54:17904 ::   File "uiChat.py", line 364, in __SendTalkingChatPacket

0325 20:54:17904 ::   File "uiChat.py", line 219, in __SendChatPacket

0325 20:54:17904 ::   File "system.py", line 132, in __pack_import

0325 20:54:17904 ::   File "
0325 20:54:17904 :: <string>
0325 20:54:17904 :: ", line 
0325 20:54:17904 :: 1
0325 20:54:17904 :: 

0325 20:54:17904 ::     
0325 20:54:17904 :: commands =[


0325 20:54:17904 ::     
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 ::  
0325 20:54:17904 :: ^

0325 20:54:17904 :: SyntaxError
0325 20:54:17904 :: : 
0325 20:54:17904 :: invalid syntax
0325 20:54:17904 :: 

0325 20:54:17904 :: Traceback (most recent call last):

0325 20:54:17904 ::   File "uiChat.py", line 462, in OnIMEReturn

0325 20:54:17904 ::   File "uiChat.py", line 364, in __SendTalkingChatPacket

0325 20:54:17905 ::   File "uiChat.py", line 219, in __SendChatPacket

0325 20:54:17905 ::   File "system.py", line 132, in __pack_import

0325 20:54:17905 ::   File "
0325 20:54:17905 :: <string>
0325 20:54:17905 :: ", line 
0325 20:54:17905 :: 1
0325 20:54:17905 :: 

0325 20:54:17905 ::     
0325 20:54:17905 :: commands =[


0325 20:54:17905 ::     
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 ::  
0325 20:54:17905 :: ^

0325 20:54:17905 :: SyntaxError
0325 20:54:17905 :: : 
0325 20:54:17905 :: invalid syntax
0325 20:54:17905 :: 


I'm just new to the area and want to learn something ^ - ^

Share this post


Link to post
  • 0

You have a syntax error. What do you added or what do you modified last time? Delete the base64 stuffs, because it's not give a protection for you.

Share this post


Link to post
  • 0

Ok thank you that is 100% of the base64

villeicht I do it again later

Thank you;)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.