當前位置: 首頁>>代碼示例>>Python>>正文


Python Fore.LIGHTRED_EX屬性代碼示例

本文整理匯總了Python中colorama.Fore.LIGHTRED_EX屬性的典型用法代碼示例。如果您正苦於以下問題:Python Fore.LIGHTRED_EX屬性的具體用法?Python Fore.LIGHTRED_EX怎麽用?Python Fore.LIGHTRED_EX使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在colorama.Fore的用法示例。


在下文中一共展示了Fore.LIGHTRED_EX屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: do_yara

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def do_yara(self, args):
        """Run YARA rules against the sample

Usage:          yara [<rules_path>]

If no rules file is specified, the default 'malwrsig.yar' is being used.
Those rules are then compiled and checked against the memory dump of the current emulator state (see 'dump' for further
details on this representation)"""
        if not args:
            if not self.rules:
                try:
                    self.rules = yara.compile(filepath=f"{os.path.dirname(unipacker.__file__)}/malwrsig.yar")
                    print("Default rules file used: malwrsig.yar")
                except:
                    print(f"{Fore.LIGHTRED_EX}Error: malwrsig.yar not found!{Fore.RESET}")
        else:
            self.rules = yara.compile(filepath=args)
        self.sample.unpacker.dump(self.engine.uc, self.engine.apicall_handler, self.sample)
        matches = self.rules.match("unpacked.exe")
        print(", ".join(map(str, matches))) 
開發者ID:unipacker,項目名稱:unipacker,代碼行數:22,代碼來源:shell.py

示例2: source_path

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def source_path(dir_name):
	for root in os.walk("/home"):
		if dir_name == root[0].split('/')[-1]: 
			all_paths.append(root[0])

	for i in range(len(all_paths)):
		print()
		print("{}. {}".format(i+1,all_paths[i]))

	if len(all_paths) == 0:
		print(Fore.LIGHTRED_EX + 'No directory found')
		exit()

	choice = int(input('\nEnter the option number: '))

	if choice < 1 or choice > len(all_paths):
		print(Fore.LIGHTRED_EX +'Wrong choice entered')
		exit()

	else:
		path = all_paths[choice-1]

	return path 
開發者ID:umangahuja1,項目名稱:Scripting-and-Web-Scraping,代碼行數:25,代碼來源:clean_folder.py

示例3: error

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def error(self, message: str) -> None:
        """Custom error override. Allows application to control the error being displayed by argparse"""
        if len(self._custom_error_message) > 0:
            message = self._custom_error_message
            self._custom_error_message = ''

        lines = message.split('\n')
        linum = 0
        formatted_message = ''
        for line in lines:
            if linum == 0:
                formatted_message = 'Error: ' + line
            else:
                formatted_message += '\n       ' + line
            linum += 1

        sys.stderr.write(Fore.LIGHTRED_EX + '{}\n\n'.format(formatted_message) + Fore.RESET)
        # sys.stderr.write('{}\n\n'.format(formatted_message))
        self.print_help()
        sys.exit(1) 
開發者ID:TuuuNya,項目名稱:WebPocket,代碼行數:22,代碼來源:argparse_completer.py

示例4: perror

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def perror(self, err: Union[str, Exception], traceback_war: bool=True, err_color: str=Fore.LIGHTRED_EX,
               war_color: str=Fore.LIGHTYELLOW_EX) -> None:
        """ Print error message to sys.stderr and if debug is true, print an exception Traceback if one exists.

        :param err: an Exception or error message to print out
        :param traceback_war: (optional) if True, print a message to let user know they can enable debug
        :param err_color: (optional) color escape to output error with
        :param war_color: (optional) color escape to output warning with
        """
        if self.debug:
            import traceback
            traceback.print_exc()

        if isinstance(err, Exception):
            err_msg = "EXCEPTION of type '{}' occurred with message: '{}'\n".format(type(err).__name__, err)
        else:
            err_msg = "{}\n".format(err)
        err_msg = err_color + err_msg + Fore.RESET
        self.decolorized_write(sys.stderr, err_msg)

        if traceback_war and not self.debug:
            war = "To enable full traceback, run the following command:  'set debug true'\n"
            war = war_color + war + Fore.RESET
            self.decolorized_write(sys.stderr, war) 
開發者ID:TuuuNya,項目名稱:WebPocket,代碼行數:26,代碼來源:cmd2.py

示例5: test_integrity

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def test_integrity(self):
        curr_path = os.getcwd()
        if "Tests" in curr_path:
            os.chdir(curr_path.split("Tests")[0])
        for rt, dir, _ in os.walk(os.getcwd() + "/Sample/"):
            for d in dir:
                for rt2, dir2, f2 in os.walk(rt + d):
                    for f in f2:
                        test_path = os.path.join(rt2, f)
                        relative_test_path = test_path.split(f"Sample{os.path.sep}")[1]
                        if relative_test_path not in self.hashes:
                            print(
                                f"{Fore.LIGHTRED_EX}Warning: Unknown file {relative_test_path} found in sample directory{Fore.RESET}")
                            continue
                        self.assertTrue(calc_md5(test_path).hexdigest() == self.hashes[relative_test_path],
                                        f"Tested file: {relative_test_path}. Expected: {self.hashes[relative_test_path]}, got: {calc_md5(test_path).hexdigest()}")
                        print(f"Tested:{relative_test_path}, MD5: {calc_md5(test_path).hexdigest()}") 
開發者ID:unipacker,項目名稱:unipacker,代碼行數:19,代碼來源:test_unpacker.py

示例6: sample_loop

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def sample_loop(self, samples=None):
        known_samples = self.init_banner_and_history()
        if not samples:
            sample_path = self.get_path_from_user(known_samples)
            samples = Sample.get_samples(sample_path)
        for self.sample in samples:
            print(f"\nNext up: {self.sample}")
            with open(".unpacker_history", "w") as f:
                f.writelines(
                    "\n".join(sorted(set([f"{self.sample.unpacker.name};{self.sample.path}"] + known_samples[:-1]))))

            self.init_engine()

            with open(f"{os.path.dirname(unipacker.__file__)}/fortunes") as f:
                fortunes = f.read().splitlines()
            print(f"\n{Fore.LIGHTRED_EX}{choice(fortunes)}{Fore.RESET}\n")
            self.cmdloop()
            if self.clear_queue:
                break 
開發者ID:unipacker,項目名稱:unipacker,代碼行數:21,代碼來源:shell.py

示例7: print_imports

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def print_imports(self, args):
        lines_static = []
        lines_dynamic = []

        for addr, name in self.engine.apicall_handler.hooks.items():
            try:
                module = self.engine.apicall_handler.module_for_function[name]
            except KeyError:
                module = "?"
            if name in self.sample.imports:
                lines_static += [(f"0x{addr:02x}", name, module)]
            else:
                lines_dynamic += [(f"0x{addr:02x}", name, module)]

        print(f"\n{Fore.LIGHTRED_EX}Static imports:{Fore.RESET}")
        print_cols(lines_static)
        print(f"\n{Fore.LIGHTRED_EX}Dynamic imports:{Fore.RESET}")
        print_cols(lines_dynamic) 
開發者ID:unipacker,項目名稱:unipacker,代碼行數:20,代碼來源:shell.py

示例8: do_aaa

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def do_aaa(self, args):
        """Analyze absolutely all: Show a collection of stats about the current sample"""
        print(f"{Fore.LIGHTRED_EX}File analysis:{Fore.RESET}")
        print_cols([
            ("YARA:", ", ".join(map(str, self.sample.yara_matches))),
            ("Chosen unpacker:", self.sample.unpacker.__class__.__name__),
            ("Allowed sections:", ', '.join(self.sample.unpacker.allowed_sections)),
            ("End of unpacking stub:",
             f"0x{self.sample.unpacker.endaddr:02x}" if self.sample.unpacker.endaddr != sys.maxsize else "unknown"),
            ("Section hopping detection:", "active" if self.sample.unpacker.section_hopping_control else "inactive"),
            ("Write+Exec detection:", "active" if self.sample.unpacker.write_execute_control else "inactive")
        ])
        print(f"\n{Fore.LIGHTRED_EX}PE stats:{Fore.RESET}")
        print_cols([
            ("Declared virtual memory size:", f"0x{self.sample.virtualmemorysize:02x}", "", ""),
            ("Actual loaded image size:", f"0x{len(self.sample.loaded_image):02x}", "", ""),
            ("Image base address:", f"0x{self.sample.BASE_ADDR:02x}", "", ""),
            ("Mapped stack space:", f"0x{self.engine.STACK_ADDR:02x}", "-",
             f"0x{self.engine.STACK_ADDR + self.engine.STACK_SIZE:02x}"),
            ("Mapped hook space:", f"0x{self.engine.HOOK_ADDR:02x}", "-", f"0x{self.engine.HOOK_ADDR + 0x1000:02x}")
        ])
        self.do_i("i")
        print(f"\n{Fore.LIGHTRED_EX}Register status:{Fore.RESET}")
        self.do_i("r") 
開發者ID:unipacker,項目名稱:unipacker,代碼行數:26,代碼來源:shell.py

示例9: PREPEND

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def PREPEND(state):
    """PREPEND is used to print ==> in front of the lines.

    They are colorised according to their status.
    If everything is good then green else red.
    """
    # State 1 is for ok
    # State 2 is for notok

    print(Style.BRIGHT, end='')
    if state == 1:
        print(Fore.LIGHTGREEN_EX, end='')
    elif state == 2:
        print(Fore.LIGHTRED_EX, end='')
    else:
        pass

    print(' ==> ', end='')
    print(Style.RESET_ALL, end='') 
開發者ID:deepjyoti30,項目名稱:ytmdl,代碼行數:21,代碼來源:prepend.py

示例10: labymod

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def labymod(self, uuid, combo, user):
        cape = False
        if OxygenX.Cape.labymod:
            link = f'http://capes.labymod.net/capes/{uuid[:8]}-{uuid[8:12]}-{uuid[12:16]}-{uuid[16:20]}-{uuid[20:]}'
            try:
                laby = get(url=link).text
                if not str(laby).__contains__('Not Found'):
                    cape = True
            except Exception as e:
                if self.debug:
                    self.printing.put(f'{Fore.LIGHTRED_EX}Error Labymod:\n{e}{Fore.WHITE}')
            if cape:
                Counter.labymod += 1
                open(f'{self.folder}/LabymodCape.txt', 'a', encoding='u8').write(
                    f'{combo} | Username: {user}\n')
        return cape 
開發者ID:ShadowOxygen,項目名稱:OxygenX,代碼行數:18,代碼來源:OxygenX-0.4.py

示例11: hivemc

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def hivemc(self, uuid, combo):
        rank = False
        if OxygenX.Rank.hivemc_rank:
            try:
                response = get(url=f'https://www.hivemc.com/player/{uuid}').text
                match = self.rankhv.search(response).group(1)
                if match != 'Regular':
                    rank = match
            except AttributeError:
                rank = False
            except Exception as e:
                if self.debug:
                    self.printing.put(f'{Fore.LIGHTRED_EX}Error HiveMC:\n{e}{Fore.WHITE}')
            if rank:
                open(f'{self.folder}/HiveRanked.txt', 'a', encoding='u8').write(
                    f'{combo} | Rank: {str(rank)}\n')
                Counter.hivemcrank += 1
            return rank 
開發者ID:ShadowOxygen,項目名稱:OxygenX,代碼行數:20,代碼來源:OxygenX-0.4.py

示例12: veltpvp

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def veltpvp(self, username, combo):
        rank = False
        if OxygenX.Rank.veltpvp_rank:
            try:
                link = get(url=f'https://www.veltpvp.com/u/{username}', headers=self.mailheaders).text
                if '<h1>Not Found</h1><p>The requested URL' not in link:
                    rank = self.veltrank.search(link).group(1)
                    if rank == 'Standard' or rank == 'Default':
                        rank = False
                    else:
                        rank = rank
            except AttributeError:
                rank = False
            except Exception as e:
                if self.debug:
                    self.printing.put(f'{Fore.LIGHTRED_EX}Error Veltpvp:\n{e}{Fore.WHITE}')
            if rank:
                open(f'{self.folder}/VeltRanked.txt', 'a', encoding='u8').write(f'{combo} | Rank: {rank}\n')
                Counter.veltrank += 1
        return rank 
開發者ID:ShadowOxygen,項目名稱:OxygenX,代碼行數:22,代碼來源:OxygenX-0.4.py

示例13: lunar

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def lunar(self, uuid, combo):
        both = [False, False]
        if OxygenX.Rank.lunar_rank:
            try:
                check = get(url=f'http://www.lunar.gg/u/{uuid}', headers=self.mailheaders).text
                if '404: Page Not Found' not in check:
                    if '>Banned<' in check:
                        both[1] = True
                    both[0] = self.lunarr.search(check).group(1)
                    if both[0] == 'Default':
                        both[0] = False
                    else:
                        both[0] = both[0]
            except Exception as e:
                if self.debug:
                    self.printing.put(f'{Fore.LIGHTRED_EX}Error Lunar: \n{e}{Fore.WHITE}')
            if both[0]:
                open(f'{self.folder}/LunarRanked.txt', 'a', encoding='u8').write(f'{combo} | Rank: {both[0]}\n')
                Counter.lunarrank += 1
        return both 
開發者ID:ShadowOxygen,項目名稱:OxygenX,代碼行數:22,代碼來源:OxygenX-0.4.py

示例14: mailaccess

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def mailaccess(self, email, password):
        mailaccesz = False
        if OxygenX.emailaccess:
            try:
                link = f'http://aj-https.my.com/cgi-bin/auth?timezone=GMT%2B2&reqmode=fg&ajax_call=1&udid=16cbef29939532331560e4eafea6b95790a743e9&device_type=Tablet&mp=iOS¤t=MyCom&mmp=mail&os=iOS&md5_signature=6ae1accb78a8b268728443cba650708e&os_version=9.2&model=iPad%202%3B%28WiFi%29&simple=1&Login={email}&ver=4.2.0.12436&DeviceID=D3E34155-21B4-49C6-ABCD-FD48BB02560D&country=GB&language=fr_FR&LoginType=Direct&Lang=fr_FR&Password={password}&device_vendor=Apple&mob_json=1&DeviceInfo=%7B%22Timezone%22%3A%22GMT%2B2%22%2C%22OS%22%3A%22iOS%209.2%22%2C?%22AppVersion%22%3A%224.2.0.12436%22%2C%22DeviceName%22%3A%22iPad%22%2C%22Device?%22%3A%22Apple%20iPad%202%3B%28WiFi%29%22%7D&device_name=iPad&'
                ans = get(url=link, headers=self.mailheaders).text
            except Exception as e:
                if self.debug:
                    self.printing.put(f'{Fore.LIGHTRED_EX}Error Mail Access: \n{e}{Fore.WHITE}')
                ans = 'bad'
            if 'Ok=1' in ans:
                mailaccesz = True
            if mailaccesz:
                Counter.emailaccess += 1
                open(f'{self.folder}/EmailAccess.txt', 'a', encoding='u8').write(f'{email}:{password}\n')
            return mailaccesz 
開發者ID:ShadowOxygen,項目名稱:OxygenX,代碼行數:18,代碼來源:OxygenX-0.4.py

示例15: get_roll

# 需要導入模塊: from colorama import Fore [as 別名]
# 或者: from colorama.Fore import LIGHTRED_EX [as 別名]
def get_roll(player_name, roll_names):
    if os.environ.get('PYCHARM_HOSTED') == "1":
        print(Fore.LIGHTRED_EX + "Warning: Cannot use fancy prompt dialog in PyCharm.")
        print(Fore.LIGHTRED_EX + "Run this app outside of PyCharm to see it in action.")
        val = input(Fore.LIGHTYELLOW_EX + "What is your roll: ")
        print(Fore.WHITE)
        return val

    print(f"Available rolls: {', '.join(roll_names)}.")

    # word_comp = WordCompleter(roll_names)
    word_comp = PlayComplete()

    roll = prompt(f"{player_name}, what is your roll: ", completer=word_comp)

    if not roll or roll not in roll_names:
        print(f"Sorry {player_name}, {roll} not valid!")
        return None

    return roll


# def get_roll(player_name, roll_names):
#     print("Available rolls:")
#     for index, r in enumerate(roll_names, start=1):
#         print(f"{index}. {r}")
#
#     text = input(f"{player_name}, what is your roll? ")
#     selected_index = int(text) - 1
#
#     if selected_index < 0 or selected_index >= len(rolls):
#         print(f"Sorry {player_name}, {text} is out of bounds!")
#         return None
#
#     return roll_names[selected_index]
# 
開發者ID:talkpython,項目名稱:python-for-absolute-beginners-course,代碼行數:38,代碼來源:rpsgame.py


注:本文中的colorama.Fore.LIGHTRED_EX屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。