Tools
Tools copied to clipboard
Cannot encrypt due to UTF-8 error
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.
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