TTT
TTT
/usr/bin/python3
import telebot,requests,sys,autopep8
from telebot import TeleBot
from re import findall
from typing import Optional
import sys,marshal,re
from typing import Union,Optional
from types import CodeType
from zipfile import ZipFile
from rich.console import Console
cons=Console()
console=cons
from subprocess import Popen, PIPE
import webbrowser,os,builtins
from multiprocessing import Process
from rich.syntax import Syntax
def bytos(so):
source=so
do={}
for i in source.split('bytes'):
try:
sb=str(i).split('(')[1]
sb=sb.split(').dec')[0]
enc='bytes('+sb+').decode()'
ev=(sb.replace(' ',''))
ls=[]
for e in ev.split('\n'):
e=e.replace(',','')
e=e.replace(']','')
e=e.replace('[','')
try:
en=(int(e))
ls.append(en)
except:
1
rel=(bytes(ls).decode())
enc=enc
do.update({enc:rel})
ls.clear
except IndexError:
pass
#print(rel)
def kill_none(source):
cod=open(source,'r').read()
non="""None(None((lambda .0 = None: for i in .0:
"""
rng='))(range('
qc='))))'
cod=cod.replace(non,"str(''.join(")
cod=cod.replace(rng,") for i in range(int(")
open(source,'w').write(cod)
#print(cod)
def kill_non(file):
rso=file
fin=open(file,'r')
#fri=0
if 'None(None((lambda' in fin.read():
fri=0
for jkk in open(file,'r').readlines():
if 'None(None((lambda' in jkk:
fri+=1
cho=first.split('choice(')[1].split(')')[0]
rang=first.split('range(')[1]
if '(' in rang:
rang=rang.split('int(')[1].split(')')[0]
else:
rsng=rang.split(')')[0]
#print(range)
rel="str(''.join(random.choice("+str(cho)+') for i in
range(int('+str(rang)+'))'
if none in file:
#print(none)
sourc=file.replace(none,rel)
open(rso,'w').write(sourc)
Copyright=['@C15CS']
def clear_un(source):
p="Thread(rann, ('target',)"
if p in source:
source=source.replace(p,'Thread(target=rann')
p='return None'
if p in source:
source=source.replace(p,'')
p='''finally:
continue'''
if p in source:
source=source.replace(p,'except:')
p='''finally:
pass'''
if p in source:
source=source.replace(p,'except:')
p='''finally:
pass'''
if p in source:
source=source.replace(p,'except:')
p='''finally:
pass'''
if p in source:
source=source.replace(p,'except:')
p='finally:'
if p in source:
source=source.replace(p,'except:')
p=" copyright = '@psh_team'"
if p in source:
source=source.replace(p,'')
p='continue'
if p in source:
source=source.replace(p,'')
p='''levi = False
if levi:
try:'''
ex=""" except:
1"""
if p in source:
source=source+ex
#header
h="(c, head1, data1, (headers, data))"
if h in source:
source=source.replace(h,"(url=c,headers=head1,data1)")
h="(url, headers, (headers))"
if h in source:
source=source.replace(h,'(url=url,headers=headers')
h="cookie: cok }, (cookies)"
if h in source:
source=source.replace(h,"'cookie': cookies=cok")
h="headers_, (headers)"
if h in source:
source=source.replace(h,'headera=headera_,')
if "os.system('pip install" in source:
source=source.replace("os.system('pip install"," os.system('pip
install")
h="\n')"
if h in source:
source =source.replace(h,"')")
h="head1, (headers)"
if h in source:
source =source.replace(h,'headers=head1')
h="headers, cookies, (headers, cookies)"
if h in source :
source =source.replace(h,'headers=headers,cookies=cookies')
h="head, (headers)"
if h in source :
source=source.replace(h,'headers=head')
h="headers, data, (headers, data)"
if h in source :
source =source.replace(h,'headers=headers,data=data')
h="headers, (headers)"
if h in source:
source =source.replace(h,'headers=headers')
open('decoded.py','w').write(source)
elif lo ==2:
print(lo)
source=source.replace('x02Z','x02z')
save(source,'w','ou')
decoder(la,lo)
elif lo ==3:
print(lo)
source=source.replace('x1e','x1z')
save(source,'w','ou')
decoder(la,lo)
elif lo ==4:
print(lo)
source=source.replace(r'x01d\x02d',r'x01z\x02d')
save(source,'w','ou')
decoder(la,lo)
#
else:
decoder(la,lo)
except UnicodeDecodeError:
decoder(la,lo)
if index == -1:
break
text = func_name
open_brakets = 1
for char in source[index + len(func_name):]:
text += char
if char == ")":
open_brakets -= 1
elif char == "(":
open_brakets += 1
if open_brakets == 0:
break
exceptions = 0
for eval_f in all_eval_functions:
try:
eval_body = re.findall(r"\((.+)\)", eval_f)[0]
bad_functions = ["eval", "exec"]
is_in = False
for function in bad_functions:
if function in eval_body:
is_in = True
if is_in:
root_search(list(set(list(search_func(eval_body, "eval")))),
source)
exceptions += 1
continue
except IndexError:
continue
try:
try:
eval_data = eval(f"b{eval_body}").decode()
except Exception:
eval_data = eval(eval_body)
source = source.replace(eval_f, eval_data)
except Exception:
exceptions += 1
return source
class DecompilePyc:
def __init__(self, filename: str):
self.filename = filename
class DecompileMarshal:
def __init__(self, bytecode: CodeType):
self._data: bytes = marshal.dumps(bytecode)
self._magic_number: bytes = b'a\r\r\n\x00\x00\x00\x00\xe2\xb6\xcea\r\x00\
x00\x00'
def get_source(self) -> bytes:
return self._magic_number + self._data
#source=source.replace("'))","'")
open('3737373737373','w').write(source)
get_bytecode(source)
return source
except SyntaxError:
# print(source)
except ValueError:
return source.encode()
try:
return source.decode("utf-8")
except UnicodeDecodeError :
return get_bytecode(source)
def open_file(filename) -> Union[str, bytes, CodeType]:
try:
with open(filename, "r") as r_file:
return clean_source(r_file.read())
except UnicodeDecodeError:
with open(filename, "rb") as rb_file:
return rb_file.read()
class FakeFunction:
def __init__(self, source: str, filename: str):
global __file__
#aa=marshal.loads(eval(source))
self.pyc_source = None
self.old_exec(source)
except ModuleNotFoundError as err:
print("#", err)
print("# install the Module first then try again.")
except SystemError:
print("# unknown opcode! try to use another python3 version to decode
this file.")
except NameError as err:
if self.pyc_source is not None:
pass
else:
print("#", err)
print("# there is a NameError in the file fix it first and try
again.")
except KeyboardInterrupt:
pass
return get_source_type(source)
def open_python_file(filename) -> Union[str, bytes, CodeType]:
source = open_file(filename)
if get_source_type(filename) == "zip":
archive = ZipFile(filename)
py_filename = archive.filelist[0].filename
source = archive.read(py_filename)
if get_source_type(source) == "py":
return clean_source(source)
return source
return source
class Pyprivet:
print('pyprivet')
def __init__(self,file):
self.file=file
file=self.file
cc=r'c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
xe3=r'\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x'
n=0
mod='>eludom<'
refile=file[::-1]
if xe3 in file:
print('xe3')
for i in file.split('\\'):
if 'x84!Z' in i:
n+=1
if n >0:
moufle=refile.split(mod)[0][::-1].split("'))")[0]
ns=[]
#module
for i in range(len(moufle)//2):
aa=(moufle[i])
ns.append(aa)
ns=("".join(ns))
file=(file.split((ns))[0]+moufle)
#xe3
#xe3=file.split('x84!Z')[0]+'x84!Z'
x84=file[::-1].split('Z!48x')[1].split('3ex')[0]
x84='\\xe3'+x84[::-1]+'x84!Z'
xe3=file.split(x84)[1]
xe3="import marshal\nexec(marshal.loads(b'"+x84+xe3+"'))"
#xe3=marsh93(xe3)
self.file=xe3
#print(xe3)
else:
print('error xe3')
elif cc in file:
print('ok')
for i in file.split('\\'):
if 'x84!Z' in i:
n+=1
if n >0:
moufle=refile.split(mod)[0][::-1].split("'))")[0]
ns=[]
#module
for i in range(len(moufle)//2):
aa=(moufle[i])
ns.append(aa)
ns=("".join(ns))
file=(file.split((ns))[0]+moufle)+"'))"
#b'c\x00'
try:
x84=file[::-1].split('Z!48x')[1]
cc=x84[::-1].split('x00c')[1]
file=file[::-1].split('Z!48x')[0][::-1]
file='c'+cc+'x84!Z'+file
file="import marshal\nexec(marshal.loads(b'"+file
self.file=file
except IndexError:
print(file)
open('jejeje.txt','w').write(file)
print('error pyprivet 1')
else:
print('error pyprivet 2')
else:
print('error1')
#self.file=self.file.replace('!Z\x01d','!z\x01z')
#self.file=self.file.replace('!Z','!z')
def source(self):
if r'x84!Z' in self.file:
self.file=self.file.replace(r'x84!Z',r'x84!1')
if r'x84!1\x01d\x02d\x03l' in self.file:
self.file=self.file.replace(r'x84!1\x01d\x02d\x03l',r'x84!1\
x011\x02d\x03l')
if r'x84!1\x01e\x02e\x03\xa0\x04d\x03\xa1\x01\x83\x01Z' in
self.file:
self.file=self.file.replace(r'x84!1\x01e\x02e\x03\xa0\x04d\
x03\xa1\x01\x83\x01Z',r'x84!1\x01e\x02e\x03\xa0\x04d\x03\xa1\x01\x83\x011')
#print(self.file)
open('dec_dbdbdbdhd.py','w').write(self.file)
save(self.file,'w','ou')
decoder(la)
#return #self.file
class Eval_conv:
def __init__(self,file):
self.file=file
file=self.file
def sorce(self):
ns={}
file=self.file
for i in file.split('eval'):
if '(marshal.loads(b' in i:
try:
if 'ruuesudjjdejejej' in i:
pass
#print(i)
else:
eve=i.split("(marshal.loads(")[1].split("'))")
[0]+"'"
#print(eve)
res='eval(marshal.loads('+eve+'))'
try:
try:
eve=eval(marshal.loads(eval(eve)))
ns.update({res:eve})
except EOFError:
pass
#print(eve)
except SyntaxError:
pass
#print(res)
except IndexError:
try:
if 'ruuesudjjdejejej' in i:
pass
try:
eve=i.split("eval(marshal.loads(")
[1].split('"))')[0]+'"'
res='eval(marshal.loads('+eve+'))'
eve=eval(marshal.loads(eval(eve)))
ns.update({res:eve})
except EOFError:
pass
except SyntaxError:
pass
#open('dec_dbdbdbdhd.py','w').write(my_str)
if i in file:
file=file
ss=file.replace(i,f'"{s}"')
file=ss
save(file,'w','ou')
def en_marsh(self):
file=self.file
try:
ma=file.split('exec(marshal.loads(')[1].split("'))\n")[0]+"'))"
ma='import marshal\nexec(marshal.loads('+ma
save(ma,'w','ou')
decoder(la,1)
return 'save'
except IndexError:
print('error')
class Byto:
def __init__(self,file):
self.file=file
def en_marsh(self):
file=self.file
print('marshal')
ma=file.split('exec(marshal.loads(')[1].split("'))")[0]
ok='import marshal\nexec(marshal.loads('+ma+"'))"
save(ok,'w','ou')
#Pyprivet(outo).source()
return 'ok en Byto'
def source(self):
file=self.file
#4print(file)
ls=[]
doce={}
try:
for ss in file.split('bytes(['):
if ']).decode()' in ss:
isa=ss.split(']).decode()')[0]
for sha in isa.split(","):
fin=findall("[0-9]",sha)
finz="".join(fin)
try:
if ' ' in finz:
pass
else:
aa=int(finz)#(str(int(finz))
+'jfdjjxdjdidirie')
ls.append(aa)
except Exception as E:
print('errorrrs integr')
rel=(bytes(ls).decode())
print('7t74ueuru3u3u')
save(file,'w','ou')
#pass
except Exception as E:
print(E)
print('okk')
def decoder(la,lo:Optional[int] =1 ):
la+=1
source = open_python_file(outo)
file_type = get_file_type(outo)
# print(source)
if file_type == "zip":
pass
elif type(source)==str:
if 'x84!Z' in source:
open('47474747474.txt','w').write(source)
print(7437373737)
Pyprivet(source).source()
source: Union[str, None, CodeType] = FakeFunction(source,
outo).get_source()
#print(source)
print(source)
print(lo)
marsh3()
#lo+=1
#decoder(la,lo)
else:
print('Is not python file')
if type(source) == str:
# if 'exec(marshal.loads(' in source:
# save(source,'w','ou')
cop='''(Python 3.9)'''
if cop in source:
source=source.split(cop)[1]
if 'Warning:' in source:
source=source.split('Warning:')[0]
save(source,'w','ou')
show_code(source, 0)
save(source,'w','ou')
if 'exec(base64' in source:
try:
source=source.split('exec(base64')[1].split("'))")[0]
source='import base64\nexec(base64'+source+"'))"
save(source,'w','ou')
decoder(la,lo)
except IndexError:
source=source.split('exec(base64')[1].split('"))')[0]
source='import base64\nexec(base64'+source+'"))'
save(source,'w','ou')
decoder(la,lo)
if 'exec(zlib' in source:
try:
source=source.split('exec(zlib')[1].split("'))")[0]
source='import zlib\nexec(zlib'+source+"'))"
save(source,'w','ou')
decoder(la,lo)
except IndexError:
source=source.split('exec(zlib')[1].split('"))')[0]
source='import zlib\nexec(zlib'+source+'"))'
save(source,'w','ou')
decoder(la,lo)
if 'exec(marshal.loads' in source:
if 'eval' in source:
if 'exec(marshal.loads' in source:
Eval_conv(source).en_marsh()
else:
Eval_conv(source).sorce()
else:
decoder(la,lo)
if 'eval(' in source:
if 'exec(marsh' in source:
Eval_conv(source).en_marsh()
else:
print('eval(')
Eval_conv(source).sorce()
if 'bytes([' in source:
if 'exec(marshal' in source:
Byto(source).en_marsh()
else:
bytos(source)
if len(source) > 5000:
print('38383838eueisisjskekwkdir8383883')
file=open('dec_'+na,'r').read()
if 'std::bad_cast' in file:
bot.reply_to(reb,' اذا الملف لم ينفك او لم ينفك
بالكامل ارسل الملف المشفر الى المطور:\n@@QE_MG\n)'😘وأنتضر التحديث
exit()
else:
fs=0
for cop in Copyright:
if cop in file:
fs+=1
if fs > 0:
bot.reply_to(reb,')'😊ال يمكن فك اداه صديقي
clear_un(file)
#bot.reply_to(reb,na)
#print('#######')
kill_non('decoded.py')
open(outo,'w').write(open('decoded.py','r').read())
bot.send_document(reb.chat.id,open(outo,'rb'))
bot.reply_to(reb,f'file decoded By @Y_3_YY\n\
nLayers `{la}`')
la=0
return 1
pass
pass
#bot.polling(none_stop=True)
'''
if '57]).decode():' in source:
pass
if 'exec(marshal.loads(' in source:
Byto(source).en_marsh()
else:
Byto(source).source()
'''
save(source,"wb",'ou')
else:
print(type(source))
print('error2')
if type(source) == bytes:
decoder(la,lo)
if type(source) == str:
if 'exec(marshal.loads(' in source:
decoder(la,lo)
#cons.print('[yellow]if not complet Enter ok:[/yellow] '+str(lay)+'\
n[blue][chos `try`to re declmpile[/blue]')
#inb=input('chose:')
def save(source,w,typ):
if typ=='ou':
open(outo,w).write(source)
elif typ=='ine':
open(into,w).write(source)
def main(na,m):
try:
file=open(into,'r').read()
#save(file,'w','ou')
open(outo,'w')
save(file,'w','ou')
file=open(outo,'r').read()
lay=0
while 1 > lay:
lay+=1
print(7447474747484747)
file=open(outo,'r').read()
decoder(la,lo='anything')
except UnicodeDecodeError:
file=open(into,'rb').read()
decoder(la,lo)
#if __name__ == "__main__":
# main()
#from telebot.async_telebot import AsyncTeleBot
Force_subsck=[]
tok='7808776749:AAEfDsv0fUxmchYRpr0BRsdq7O4L_dduzaQ'
bot=TeleBot(tok)
admin=['1998081728']
import sys,os
cu=(os.getcwd())
from time import sleep
layrs=0
channel=['https://t.me/decoder44']
groups=['decoder44']
def als(om,m):
xs=''قفل البوت
mx='open'
if xs in om:
bot.stop_polling()
if om:
try:
error_msg='@@ ال يعمل البوت فقط في هاذه القروبQE_MG \nارسل ملفك في
'القروب ليتم فك تشفيره
@bot.message_handler(content_types='document')
def ss(d):
chs=0
typ=(d.json['chat']['type'])
#user_grop=d.json['chat']['username']
if typ=='supergroup':
#if user_grop in groups:
if 1 in [1]:
for ch in channel:
api=f'https://api.telegram.org/bot{tok}/getchatmember?
chat_id=@{ch}&user_id={d.from_user.id}'
req=requests.get(api).text
if d.from_user.id==admin or
'member' in req or 'creator' in req or 'administartor' in req:
chs+=1
else:
bot.reply_to (d,f' اشترك
{@ يابرويch} ')
if chs==1:
print('fjjdudfueudufurur')
try:
#print(d)
global s, na
s=d.chat.id
#file_id=m.document.file_id
try:
file_id=d.document.file_id
file_info = bot.get_file(file_id).file_path
fil_name=(d.json['document']['file_name'])
na=fil_name#'file.py'#file_info.split('documents/')[1]
file =
requests.get('https://api.telegram.org/file/bot{0}/{1}'.format(tok, file_info))
open(na,'w').write(file.text)
print(file.status_code)
fil_name=(d.json['document']['file_name'])
main(na,d)
except:
pass
except:
pass
else:
bot.reply_to(d,error_msg)
na=fil_name#'file.py'#file_info.split('documents/')[1]
file =
requests.get('https://api.telegram.org/file/bot{0}/{1}'.format(tok, file_info))
open(na,'w').write(file.text)
fil_name=(d.json['document']
['file_name'])
main(na,d)
except:
pass
except Exception as e:
print(e)
@bot.message_handler(commands=['start'])
def start(m):
@bot.message_handler(func=lambda message: True)
def perm(m):
massge=m.text
my_id=admin
idd=m.from_user.id
print(m.text)
mx='open'
xs=''قفل البوت
if str(idd) in admin:
print(1)
print(m.text)
if m.chat.type =='supergroup':
if str(massge)==mx:
print(2)
bot.send_message(m.chat.id,')'تم تفعيل
als(massge,m)
elif str(massge)==xs:
bot.send_message(m.chat.id,')'تم قفل البوت
als(massge,m)
elif m.chat.type=='private' :
print('ok1')
bot.reply_to(m,')'تم التفعيل
als(massge,m)
bot.infinity_polling(none_stop=True)