sta-c0000 / tpconf_bin_xml

Command line utility to convert TP-Link router backup config files
160 stars 40 forks source link

wrong input file #28

Open y0ush4 opened 2 years ago

y0ush4 commented 2 years ago

i have config.xml file which i want to convert into config.bin i have tried sevral options but always error my problem is my new router is in total chinese language i just want to the old modem backup to write to new chinese one please help [me

PS C:\Users\zen> python --version Python 3.7.9 PS C:\Users\zen> pip3 install pycryptodomex Collecting pycryptodomex Using cached pycryptodomex-3.15.0-cp35-abi3-win_amd64.whl (1.9 MB) Installing collected packages: pycryptodomex Successfully installed pycryptodomex-3.15.0 WARNING: You are using pip version 20.1.1; however, version 22.2.2 is available. You should consider upgrading via the 'C:\Users\zen\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.

PS C:\Users\zen> python3 tpconf_bin_xml.py config.xml conf_new.bin ERROR: Wrong input file type! PS C:\Users\zen> python3 tpconf_bin_xml.py config.xml conf_new.bin ERROR: Wrong input file type! PS C:\Users\zen> python3 tpconf_bin_xml.py config.xml conf_new.bin Traceback (most recent call last): File "tpconf_bin_xml.py", line 213, in if path.getsize(args.infile) > 0x20000: File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\genericpath.py", line 50, in getsize return os.stat(filename).st_size FileNotFoundError: [WinError 2] The system cannot find the file specified: 'config.xml' PS C:\Users\zen> python3 tpconf_bin_xml.py conf.xml conf_new.bin ERROR: Wrong input file type! PS C:\Users\zen> python3 tpconf_bin_xml.py conf.xml conf_new.bin ERROR: Wrong input file type!

y0ush4 commented 1 year ago

no one>??

MatthewTingum commented 1 year ago

Well, for one thing you're trying to pass the output file name config.xml as the input config file.

usage: tpconf_bin_xml.py [-h] [-l] [-n] [-o] infile outfile

TP-Link router config file processor.

positional arguments:
  infile              input file (e.g. conf.bin or conf.xml)
  outfile             output file (e.g. conf.bin or conf.xml)

optional arguments:
  -h, --help          show this help message and exit
  -l, --littleendian  Use little-endian (default: big-endian)
  -n, --newline       Replace EOF NULL with newline (after uncompress)
  -o, --overwrite     Overwrite output file

Even if you do switch the arguments around, it might not be a supported format.

sta-c0000 commented 1 year ago

y0ush4, ERROR: Wrong input file type! simply means your input file is invalid or not supported.

If your config.xml really was a valid XML file, it would begin with an XML declaration (e.g.: <?xml version=…). But your file does not, so it's not a valid XML file. Perhaps read the instructions (README.md) more carefully?... First download a conf.bin... and is your model even listed as supported?

Important: It's really NOT a good idea to upload a conf.bin that originates from a different router!

Also, it's possible your router's firmware only supports specific languages, if that's the case, then you would need to install firmware with support for the language(s) you want.