I think my program works but it can't compile the sources after that.
Source code of my tool :
Code: Select all
#coding=utf-8
# ___________.__.__ .__.__ .__
# \_ _____/|__| | ____ _______|__| | | | _____
# | __) | | | _/ __ \\___ / | | | | \__ \
# | \ | | |_\ ___/ / /| | |_| |__/ __ \_
# \___ / |__|____/\___ >_____ \__|____/____(____ /
# \/ \/ \/ \/
# __________ __ .__
# \______ \_____ _/ |_ ____ | |__ ___________
# | ___/\__ \\ __\/ ___\| | \_/ __ \_ __ \
# | | / __ \| | \ \___| Y \ ___/| | \/
# |____| (____ /__| \___ >___| /\___ >__|
# \/ \/ \/ \/
##############################################################
# #
# Ce programme protège vos informations sur Filezilla en #
# cryptant les fichiers contenant ces informations. #
# une clé de 8 caractères aléatoire est générée puis utilisée#
# Utilisation : #
# - Placez Filezillapatcher.py dans un dossier #
# - Lancez la commande : "python FilezillaPatcher.py" #
# Attendez la fin du téléchargement et de la compilation puis#
# profitez d'un version sécurisé de Filezilla. #
# Necromoine (hwc-crew.com) #
# Thank's to : Fr0g, Kallimero, Armel #
# #
#############################################################
import random
import tarfile
import urllib
import platform
import os
def generation():
''' Fonction qui génère une chaine à 8 caractères ''' # create a 8 length varariable
chaine = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789*ù!:$'
a = 0
final = ''
while a < 9: # nombre de caractères générés par la boucle
aleatoire = random.randint(0,65) # nombre de caractères de la chaine 'chaine'
final = final + chaine[aleatoire:aleatoire+1]
a = a+ 1
return final
def remplacement(fichier, numero, remplacement): # Remplace one line by an other one with the
''' Remplace une ligne dans un fichier donné '''
lignes = []
with open(fichier, 'r') as fichiers:
for ligne in fichiers:
lignes.append(ligne)
code = remplacement + '\n'
lignes[numero-1] = remplacement
with open(fichier, 'w') as fichiers:
for ligne in lignes:
fichiers.write(ligne)
''' Boucle principale du programme '''
# Prérequis pour la suite
try:
urllib.urlretrieve('http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.5.0/FileZilla_3.5.0_src.tar.bz2', 'Filezilla.tar.bz2')
except:
print 'Impossible de telecharger le programme, verifiez votre connexion internet'
quit()
else:
print 'Telechargement du programme...'
archive = tarfile.open('Filezilla.tar.bz2', 'r')
archive.extractall()
# Partie une : modification des scripts
code = generation()
phrase = 'Bind(insertServerQuery_, server_table_column_names::password, EncryptString(server.GetPass(), "' + code + '"));'
remplacement('filezilla-3.5.0/src/interface/queue_storage.cpp', 610, phrase)
phrase = 'pass = DecryptString(GetColumnText(selectServersQuery_, server_table_column_names::password), "' + code + '");'
remplacement('filezilla-3.5.0/src/interface/queue_storage.cpp', 878, phrase)
phrase = 'AddTextElement(node, "Pass", EncryptString(server.GetPass()), "' + code + '");'
remplacement('filezilla-3.5.0/src/interface/xmlfunctions.cpp', 690, phrase)
phrase = 'pass = DecryptString(GetTextElement(node, "Pass"), "' + code + '");'
remplacement('filezilla-3.5.0/src/interface/xmlfunctions.cpp', 585, phrase)
if platform.system() == 'Windows':
print 'Le script ne comprend pas la compilation sous Windows, compilez à la main (les instructions sont disponibles sur le site de filezilla)' # can't compile if windows
if platform.system() == 'Linux': # if linux, we compile this is here there are problems
dir = 'filezilla-3.5.0/compile'
os.makedirs(dir)
os.chdir(dir)
os.popen('chmod +x ../configure')
os.popen('../configure && make && make install')
print ('Filezilla Patcher a correctement effectue les modifications au logiciel') #
raw_input('Appuyez sur une touche pour quitter')
(Sorry for my english xD)
Necromoine