Exemplo n.º 1
0
def main():
    global template_image_dir_name
    global target_images_dir_name

    source_path = None

    logo.banner()
    print("\n")

    try:
        import argparse
        import sys
    except ImportError:
        print("[-] Error importing argparse or sys module")
        exit(1)

    parser = argparse.ArgumentParser(description='A program which given a source image and a set of target images '
                                                 'will match the source image to the target images to find its matches')
    parser.add_argument('-p', '--path', help=' Path of source image')
    parser.add_argument('-v', '--version', action='version', version='%(prog)s 1.0.0(beta)', help='Prints the version '
                                                                                                  'of Photoroid')
    parser.add_argument('-t', '--target', help=' Path of target images directory',
                        default=target_images_dir_name_default)
    parser.add_argument('-o', '--output', help='Path of template images directory',
                        default=template_image_dir_name_default)

    if len(sys.argv) > 1:
        args = parser.parse_args()
        source_path = args.path
        template_image_dir_name = args.output
        target_images_dir_name = args.target

    if source_path is None:
        source_path = str(
            input("[ {}!{} ] Enter path of source image: {}".format(colors.white, colors.end, colors.lightgreen)))

    print("\n")  # Some serious end of line, for UI purpose LOL ...

    # Getting the image to be searched
    source = cv2.imread(source_path, cv2.IMREAD_COLOR)
    colors.process("Creating template sections of source image.")

    start_dir = os.getcwd()  # Saving the start directory

    # Creating template sections of source image.
    template_images(source)
    colors.success("12 template sections of source image created.")
    os.chdir(start_dir)
    colors.process("Setting 'Core' as current directory.")
    check_match()
    print("{}\nThank you for using my tool\n".format(colors.blue))
Exemplo n.º 2
0
	def bruteforce(self, mylist):	
		for i in mylist:
			if self.passwordexits == "True":
				break
			if i.split(":")[0] == self.password:
				self.passwordexits = "True"
				self.lastone = "Now"
				self.passinfo = "Password : %s" %  i.split(":")[1]
				self.timeinfo = "Finished %d lines in %s second .." %  (self.cacheinfo,str((datetime.now() - self.startime))[0:7])
				banner( "print")
				print self.timeinfo
				break	
		del mylist
		if self.lastone == "Now":		
			self.timeinfo = "Finished %d lines in %s second .." %  (self.cacheinfo,str((datetime.now() - self.startime))[0:7])
			logger( self.passwordexits, self.timeinfo, self.passinfo)
Exemplo n.º 3
0
def logger( passwordexits, time, password):
	if passwordexits == "True":
		name = "%s.txt" % str(randint(0, 999999999))
		if path.isfile(name):
			name = "%s.txt" % str(randint(0, 99999999))
		else:
			name = name	
		logs = open(name, "w")
		logs.write(banner( "")+"\n")
		logs.write("\n"+password)
		logs.write("\n"+time)
		logs.close()
		exit("LogFile : %s saved !" % (name))
	else:
		banner( "print")
		print time
		exit("Password not found in text !")	
Exemplo n.º 4
0
            thresh = 0.9
            loc = np.where(result > thresh)
            if str(loc[0]) == str(loc[1]):
                checked.append("False")
                break
            else:
                checked.append("True")
            pos+= 1

        if "False" not in checked:
            print("Image : {}".format(path))


if __name__ == '__main__':

    logo.banner()
    print("\n")

    try:
        import argparse
        import sys
    except:
        print("[-] Error importing module")

    parser = argparse.ArgumentParser()
    parser.add_argument('-p','--path',help =' Path of template image')
    if len(sys.argv)>1:
        args = parser.parse_args()
        template_path = args.path
    else:
        template_path = str(input("[ {}!{} ] Enter Template path : {}".format(colors.white,colors.end,colors.lightgreen)))