Outil : PandaSplitter
Ceci est un outil que j'ai créé pour la team Zenk.
Il sert à splitter (diviser en plusieurs parties) un fichier pour :
- Savoir quelle partie du code est détectée par un AV. => ça c'est l'usage malhonnête et pas cool
- Diviser un fichier lourd en plusieurs parties plus légères pour un envoie optimisé sur le réseau (par exemple, usez de votre imagination que diable)
Bon, voilà le code :
Code : python |
import sys, os ; def main () : os.system ("clear") ; #sous windows remplacer par cls print ("") ; if (len (sys.argv) == 4) : print ("[+] We will try to split your file : %s " % sys.argv[2]) ; b = _split (sys.argv[1], sys.argv[2], int(sys.argv[3])) ; if b == 0 : print ("[-] File to split : <%s> is unavailable ..." % sys.argv[2]) ; elif b == 1 : print ("[-] Failed while creating directory <%s> ..." % sys.argv[1]) ; else : print ("[+] We have successfuly splitted the file <%s> into <%d> files ..." % (sys.argv[2], b)) ; else : raw_input (""" =============================================== \t[------------------------------] \t[ Panda-Splitter : by unn@med ] \t[ It's used to plit a file ] \t[------------------------------] =============================================== How to use : python %s [PATH] [FILETS] [SPSIZE] =============================================== path => The path to the directory where which will contain our splitted file filets => File to split spsize => Size of a split =============================================== I'm not responsable of your acts =============================================== For bug reports, em@il me < unn@med >""" % (sys.argv[0])) ; def _split (path, fts, split_size) : try : ff = open (fts, "rb") ; except : return 0 ; try : os.makedirs (path, mode=0777) ; except : return 1 ; i = 0 ; while True : i += 1 ; ff2 = open (path + "/splitted_" + fts + str(i) + ".split", "wb") ; data = ff.read (split_size) ; if len (data) == 0 : break ; ff2.write (data) ; ff2.close () ; ff.close () ; return i ; main () ; |