Created
December 29, 2024 04:08
-
-
Save raylax/2e26cc8228f8dcbfbea3a0393f3d47f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import tarfile | |
def check(path: str): | |
no_asciis: list[str] = [] | |
with tarfile.open(path) as tar: | |
for item in tar.getmembers(): | |
if item.name.isascii(): | |
continue | |
no_asciis.append(item.name) | |
if no_asciis: | |
print(f"[!] 内容包含非ascii字符 - [{','.join(no_asciis)}]") | |
return | |
print("[*] OK") | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print("[-] Usage check-of.py [PATH]") | |
check(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment