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

Cannot encrypt due to UTF-8 error #15

Open
TimPeterson opened this issue Jul 22, 2023 · 1 comment
Open

Cannot encrypt due to UTF-8 error #15

TimPeterson opened this issue Jul 22, 2023 · 1 comment

Comments

@TimPeterson
Copy link

I have an IPC-T5442TM-AS running firmware V2.820.15OG001.0.R. I was able to extract and decrypt the configuration using key "IPC-HDW5442TP-AS", but I cannot re-encrypt that decrypted file due to this error:

[*] Dahua Config Backup Decrypt/Encrypt by bashis <mcw noemail eu> (2021) [*]

'utf-8' codec can't decode byte 0xb3 in position 87345: invalid start byte
[!] Input not valid JSON file

The problematic part of the config file is this:

"OSD":{"OSDCustomizeSort":[{"Element":[{"Name":"%09","NameType":0,"Postfix":"","Prefix":"³µÅÆ£º","SeperaterCount":1},{"Name":"%46","NameType":0,"Postfix":"","Prefix":"³µ±ê£º","SeperaterCount":1},{"Name":"%61","NameType":0,"Postfix":"","Prefix":"³µÁ¾ÀàÐÍ£º","SeperaterCount":1},{"Name":"%12","NameType":0,"Postfix":"","Prefix":"³µÉíÑÕÉ«£º","SeperaterCount":1}]}],"OSDOrder":"%09%46%61%12","Seperater":" "}

It is unclear to me what those fields are meant to represent, but I would have to guess that it's Chinese text that got mangled somewhere in the pipeline.

@mcw0
Copy link
Owner

mcw0 commented Jul 23, 2023

There is a check to see if the JSON is valid, if you want to risk you could comment out the following code (line 241-247):

try: json.loads(read_file(args.infile)) except ValueError as e: print(e) print('[!] Input not valid JSON file') return False

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

2 participants