Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing error when using: *.dm #10

Open
seghier opened this issue Dec 17, 2024 · 0 comments
Open

Fixing error when using: *.dm #10

seghier opened this issue Dec 17, 2024 · 0 comments

Comments

@seghier
Copy link

seghier commented Dec 17, 2024

Updated Main

def main(argv=None):
    import glob  # Add this import here
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-o", "--output-dir", default=os.getcwd(), help="change output directory for decrypted files [%(default)s]"
    )
    parser.add_argument(
        "gmail", help="The gmail address on your phone when the files were encrypted"
    )
    parser.add_argument("files", nargs="+", help="File(s) to decrypt")

    if argv is None:
        args = parser.parse_args()
    else:
        args = parser.parse_args(argv)

    # Expand wildcard patterns
    args.files = [f for pattern in args.files for f in glob.glob(pattern)]

    ext = ".dm"
    failed = []
    for file in args.files:
        if not os.path.isfile(file):
            print(f"File not found: '{file}'. Skipping...")
            failed.append(file)
            continue
        # Strip ".dm"
        if file.endswith(ext):
            out_filename = file[:-len(ext)]
        else:
            out_filename = file
        # make output path
        outfile = os.path.abspath(os.path.join(args.output_dir, out_filename))
        try:
            decrypt_file(file, outfile, bytes(args.gmail, "utf-8"))
        except Exception as e:
            print(f"Error decrypting '{file}': {e}")
            failed.append(file)
    if failed:
        print(
            "Failed to decrypt file{}: {}".format(
                "s" if len(failed) else "", ", ".join(f"'{i}'" for i in failed)
            )
        )

To fix this error:

 lgdecryptor.py:131: SyntaxWarning: invalid escape sequence '\-'
  lgeflock_searchstring = b'lge/flock(L[0-9\-_][email protected])'
File not found: '*.dm'. Skipping...
Failed to decrypt files: '*.dm'

Then use:
python lgdecryptor.py [email protected] "*.dm"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant