Huawei firmware scanner & ramdisk direct download [python3][script]

Search This thread

emiliewgnr

Member
Jul 1, 2018
16
9
Download directly the recovery_ramdisk image needed for Magisk, the system or any other image from the Huawei official website with proper CRC checking.
Scan and show details about latest firmwares for your device.

Usage examples :
-> To download only the recovery_ramdisk for magisk and the kernel images on the Mediapad M5 Pro's current firmware (update.hicloud.com/TDS/data/files/p3/s15/G3776/g1699/v252687/f1/full/filelist.xml) :
python3 script.py 3776 1699 252687 1 recovery_ramdisk kernel

-> To scan or check for latest Huawei Firmwares in the ranges /G3776/ ; /g1699/ ; /v260000/ to /v280000/ ; /f1/ :
replace first lines 1-10 with :
Code:
# mgg is the scan range for G : /G3776/
mgg = [3776, 3776]
# mg is the scan range for g : /g1699/
mg = [1699, 1699]
# mv is the scan range for v : /v252687/
mv = [260000, 280000]
# mf is the scan range for f : /f1/
mf = [1, 1]

Install :
install python3
pip3 install requests crcmod

Script :
Code:
# e.g. : http://update.hicloud.com:8180/TDS/data/files/p3/s15/G3776/g1699/v252687/f1/full/filelist.xml
# mgg is the scan range for G : /G3776/
mgg = [3776, 3776]
# mg is the scan range for g : /g1699/
mg = [1699, 1699]
# mv is the scan range for v : /v252687/
mv = [200000, 300000]
# mf is the scan range for f : /f1/
mf = [1, 1]

# the more threads the heavier the upload
NumberOfThreads=20
# dig +short update.hicloud.com
updatehost="update.hicloud.com"
updateServerAddressList=[
"211.152.136.73",
"211.152.136.75",
"211.152.136.30",
"211.152.137.18",
"211.152.137.14",
"211.152.137.16",
"211.152.136.11",
"211.152.136.74",
"211.152.137.15",
"211.152.136.76",
"211.152.136.29",
"211.152.136.41",
"211.152.137.17",
]
#updatehost="update.dbankcdn.com"
# dig +short update.dbankcdn.com
#updateServerAddressList=[
#"152.195.132.192",
#]
directDownloadHost = "update.dbankcdn.com"
# dig +short query.hicloud.com
queryServerAddress="80.158.19.121"
# RSA : IMEI
myIMEI=""
# look for the image inside following *.APP (UPDATE.APP, USERDATA.APP, PTABLE.APP)
LookForFirmwareInsideAPP = "UPDATE.APP"

'''

sort -r scanfound.html > result.tmp ; echo "<html><head><style>table { font-family: Sans-Serif; white-space: nowrap; font-size:9px; border-collapse: separate; border-spacing: 10px 0px;}</style></head><body><table>`cat result.tmp`</table></body></html>" > result.html ; rm result.tmp ; firefox result.html

'''

import time
import requests
import sys
import threading
import queue
import random
import json
import re
import os
import base64
import io
import struct
import datetime
import zlib
import crcmod

'''

latest valid version for device                       http://query.hicloud.com:80/sp_ard_common/v1/onestopCheck.action?verType=true
QueryServerURL         http://query.hicloud.com:80/sp_ard_common/v2/Check.action?latest=true
RetrieveAuthInfoURL   http://query.hicloud.com:80/sp_ard_common/v1/authorize.action
ReportStatusURL         http://query.hicloud.com:80/sp_ard_common/v2/UpdateReport.action

'''

def getauthorizeaction(s, versionId):
    headers1 = {
        'User-Agent': useragent,
        'Host' : "query.hicloud.com",
        'Accept': 'application/json; charset=UTF-8',
        'X-Requested-With': 'XMLHttpRequest',
        'Connection': 'keep-alive'
    }
    url1="http://"+queryServerAddress+"/sp_ard_common/v1/authorize.action"
    data1={
        "deviceId" : "null",
        "imei" : myIMEI,
        "updateToken" : "null",
        "vendor" : "null",
        "ver" : "1",
        "version" : [
          {
            "versionId" : versionId,
           }
          ]
      }
    payload = json.dumps(data1)
    while True :
      try:
          r = s.post(url=url1, data=payload, headers=headers1, allow_redirects=False, timeout=6)
          if r.status_code == 200 :
            reponse=str(r.content, encoding="utf-8")
            rep=re.fullmatch(r'data=(.*?)&sign=(.*?)&cert=(.*?)', reponse)
            if rep is not None :
              dataout={
                "data" : json.loads(base64.b64decode(rep.group(1))),
                "sign" : base64.b64decode(rep.group(2)),
                "cert" : base64.b64decode(rep.group(3))
                }
              return dataout
      except Exception as e:
          print("getauthorizeaction error : "+str(e))
      time.sleep(1)

mystartbytes = 187
mymagicnum = "187"
myunknown = "187"
myunlockcode = "187"
def extractimg(source, outdir) :
    global mymagicnum, myunknown, myunlockcode, downloadramdisk, mystartbytes
    sourcel = source.tell()
    source.seek(0)
    i = 0
    if sourcel < 20 :
      return None, 0, 20
    startbytes = source.read(4)
    i += 4
    hasstartbytes = False
    while startbytes == b'\x00\x00\x00\x00' :
      hasstartbytes = True
      startbytes = source.read(4)
      i += 4
    if hasstartbytes and mystartbytes != int(i/4) :
      mystartbytes = int(i/4)
      print("Start Bytes  : " + str(b'\x00\x00\x00\x00') + " * " + str(int(i/4)))
    magicnum = startbytes
    while True :
      if not magicnum :
        break

      if magicnum != mymagicnum :
        mymagicnum = magicnum
        print("Magic Number : " + str(magicnum))
      j = i-4
      headersize = list(struct.unpack('<L', source.read(4)))[0]
      if j + headersize > sourcel :
        return None, j, j + headersize + 20
      i += 4
      unknown = source.read(4)
      if unknown != myunknown :
        myunknown = unknown
        print("Unkown       : " + str(unknown))
      i += 4
      unlockcode = source.read(8)
      if unlockcode != myunlockcode :
        myunlockcode = unlockcode
        print("Unlockcode   : " + str(unlockcode))
      i += 8
      moduleid = list(struct.unpack('<L', source.read(4)))[0]
      i += 4
      filesize = list(struct.unpack('<L', source.read(4)))[0]
      if j + headersize + filesize > sourcel :
        return None, j, j + headersize + filesize + 20
      i += 4
      date = str(source.read(16), encoding='utf-8').rstrip('\x00')
      date = re.sub(r'(\d\d\d\d)\.(\d\d)\.(\d\d)', r'\3/\2/\1', date)
      i += 16
      time = str(source.read(16), encoding='utf-8').rstrip('\x00')
      time = re.sub(r'(\d\d)\.(\d\d)\.(\d\d)', r'\1:\2:\3', time)
      i += 16
      filename = str(source.read(32), encoding='utf-8').rstrip('\x00').lower()
      i += 32
      headercsum = source.read(2)
      i += 2
      blocksize = list(struct.unpack('<H', source.read(2)))[0]
      i += 2
      blank2 = source.read(2)
      if blank2 != b'\x00\x00' :
        print("blank2 = " % (blank2))
      i += 2

      crcdatasize = headersize - (i-j)
      crcdata = source.read(crcdatasize)
      i+=crcdatasize

      if len(downloadramdisk) == 0 :
        if filename == "sha256rsa" :
          return date, j, 0
      else :
        crcgood = "success : calculated CRC does match Huawei's"
        with open(outdir+os.sep+filename+'.img', 'wb') as out :
          s = 0
          c = 0
          readl = 4096
          while s < filesize :
            if s + readl > filesize :
              readl = filesize - s
            readdata = source.read(readl)
            i += readl
            crcv = crc(readdata)
            if crcdata[c] != (crcv & 0xff) or crcdata[c+1] != ((crcv>>8) & 0xff) :
              crcgood = "ERROR : calculated CRC does not match Huawei's"
            out.write(readdata)
            c += 2
            s += 4096
        print("%12d header %12d  file %12d %32s %12s %8s %8x %4d     %s" % (i-filesize-headersize, headersize, filesize, filename, date, time, moduleid, blocksize, crcgood))
      if len(downloadramdisk) > 0 :
        if filename in downloadramdisk :
          downloadramdisk.remove(filename)
          print(filename + " checked and saved as "+outdir+os.sep+filename+'.img')
          if len(downloadramdisk) == 0 :
            return date, j, 0

      alignment_padding = (4 - i % 4) % 4
      if alignment_padding :
        source.seek(alignment_padding, 1)
        i += alignment_padding

      if i+4 > sourcel :
        return date, i, 0

      magicnum = source.read(4)
      i += 4
    return "2015", 0, 0

def downloadonlypartofzip(s, page, fich, debut, fin, appname) :
  url1="http://"+directDownloadHost+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  headers1 = {
          'Host' : directDownloadHost,
          'User-Agent': useragent,
          'Connection': 'keep-alive',
          'Range': 'bytes='+str(debut)+'-'+str(fin),
  }
  outdir = ""
  if len(downloadramdisk) > 0 :
    outdir = "G"+str(page[0])+"_g"+str(page[1])+"_v"+str(page[2])+"_f"+str(page[3])+os.sep+fich.replace("/", " ")+os.sep+appname
    os.makedirs(outdir, exist_ok=True)
  status = -1
  while True :
    status=0
    filebytesl=0
    r = None
    try :
        r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=60)
        status = r.status_code
    except Exception as e :
      print("\n     downloadonlypartofzip erreur : "+str(e)+" : "+url1)
    if status == 206 :
      needminimum = 8192
      r.raw.decode_content = True
      z = zlib.decompressobj(wbits=-zlib.MAX_WBITS)
      cherchencore = True
      oltime = time.time()
      fout = None
      if len(downloadramdisk) > 0 :
        fout = open("removethis.tmp", "w+b")
      else :
        fout = io.BytesIO(b'')
      while cherchencore :
        buf = z.unconsumed_tail
        if buf == b'' :
            buf = r.raw.read(8192)
            if buf == b'' :
              cherchencore = False
        extr = z.decompress(buf)
        if extr == b'':
          cherchencore = False
        fout.write(extr)
        currentpos = fout.tell()
        if  time.time() - oltime > 1 :
          oltime = time.time()
          print("%10.1f MB < %.1f MB needed" % (currentpos/1000000.0, needminimum/1000000.0), end="\r")
        if currentpos >= needminimum or not cherchencore :
          foundit, stripuntil, needminimum = extractimg(fout, outdir)
          if foundit is not None :
            if len(downloadramdisk) == 0 :
              fout.close()
              return foundit
            else :
              fout.close()
              return foundit

          fout.seek(stripuntil)
          if len(downloadramdisk) > 0 :
            fout2 = open("removethis2.tmp", "w+b")
          else :
            fout2 = io.BytesIO(b'')
          fout2.write(fout.read())
          fout.close()
          fout2.seek(0)
          if len(downloadramdisk) > 0 :
            fout = open("removethis.tmp", "w+b")
          else :
            fout = io.BytesIO(b'')
          fout.write(fout2.read())
          fout2.close()

      fout.close()
    time.sleep(1)

def getzipfilelist(s, page, fich, debut, fin):
  updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
  url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  headers1 = {
          'Host' : updatehost,
          'User-Agent': useragent,
          'Connection': 'keep-alive',
          'Range': 'bytes='+str(debut)+'-'+str(fin),
  }
  status = -1
  while True :
    status=0
    filebytes=b''
    filebytesl=0
    try :
        r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=6)
        status = r.status_code
        if status == 206 :
          for chunk in r.iter_content(chunk_size=8192) :
            if chunk :  # filter out keep-alive new chunks
              filebytes += chunk
    except Exception as e :
      print("\n     getzipfilelist erreur : "+str(e)+" : "+url1)
    if status == 206 :
      filezipdata={
        "realdate" : "",
        "version" : "",
        "tag" : ""
        }
      i = 0
      filebytesl = len(filebytes) - 1
      while i < filebytesl :
        compressionmethod = list(struct.unpack('<H', filebytes[i+10:i+10+2]))[0]
        lastmodifdate = list(struct.unpack('<H', filebytes[i+14:i+14+2]))[0]
        lastmodifdate = "%02d/%02d/%04d" % ((lastmodifdate>>11), (lastmodifdate>>7)&0b1111, 6+1980+(lastmodifdate&0b1111111))
        compressedsize = list(struct.unpack('<L', filebytes[i+20:i+20+4]))[0]
        uncompressedsize = list(struct.unpack('<L', filebytes[i+24:i+24+4]))[0]
        filenamelength = list(struct.unpack('<H', filebytes[i+28:i+28+2]))[0]
        extrafieldlength = list(struct.unpack('<H', filebytes[i+30:i+30+2]))[0]
        filecommentlength = list(struct.unpack('<H', filebytes[i+32:i+32+2]))[0]
        relativeoffset = list(struct.unpack('<L', filebytes[i+42:i+42+4]))[0]
        filename = str(filebytes[i+46:i+46+filenamelength], encoding="utf-8").rstrip('\x00')
        extrafield = filebytes[i+46+filenamelength:i+46+filenamelength+extrafieldlength]
        filecomment = filebytes[i+46+filenamelength+extrafieldlength:i+46+filenamelength+extrafieldlength+filecommentlength]
        #print("%s : %s ; uncompressed %d ; compressed %d ; offset %d" % (str(filename), lastmodifdate, uncompressedsize, compressedsize, relativeoffset))
        if compressionmethod == 0 :
          if uncompressedsize > 0 :
            if filename == "VERSION.mbn" :
              myversion = getfilecontent(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+uncompressedsize-1)
              myversion = str(myversion, encoding="utf-8").rstrip('\x00')
              if len(myversion) > 0 :
                if myversion[-1]=='\n' :
                  myversion = myversion[:-1]
              filezipdata["version"] = myversion
            elif filename == "UPT_VER.tag" :
              prg=0
            elif filename.endswith(".tag") :
              mytag = getfilecontent(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+uncompressedsize-1)
              mytag = str(mytag, encoding="utf-8").rstrip('\x00')
              if len(mytag) > 0 :
                if mytag[-1]=='\n' :
                  mytag = mytag[:-1]
              filezipdata["tag"] +=  mytag.lower() + " "
        elif compressionmethod == 8 :
          if filename == LookForFirmwareInsideAPP :
            filezipdata["realdate"] = downloadonlypartofzip(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+compressedsize-1, filename)
          elif downloadeverything and filename.endswith(".APP") :
            downloadonlypartofzip(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+compressedsize-1, filename)
        else :
          print("new compression method : %d" % ())
        i +=46+filenamelength+extrafieldlength+filecommentlength
      return filezipdata
    time.sleep(1)

def getfilecontent(s, page, fich, debut, fin):
  updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
  url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  headers1 = {
          'Host' : updatehost,
          'User-Agent': useragent,
          'Connection': 'keep-alive',
          'Range': 'bytes='+str(debut)+'-'+str(fin),
  }
  status = -1
  while True :
    status=0
    filebytes=b''
    filebytesl=0
    try :
        r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=6)
        status = r.status_code
        if status == 206 :
          for chunk in r.iter_content(chunk_size=8192) :
            if chunk :
              filebytes += chunk
    except Exception as e :
      print("\n     getfilecontent erreur : "+str(e)+" : "+url1)
    if status == 206 :
      return filebytes
    time.sleep(1)

def getzipinfo(s, page, fich, fichtaille):
  updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
  url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  fin = int(fichtaille)
  debut = fin - 8192
  headers1 = {
          'Host' : updatehost,
          'User-Agent': useragent,
          'Connection': 'keep-alive',
          'Range': 'bytes='+str(debut)+'-'+str(fin),
  }
  status = -1
  while True :
    status=0
    filebytes=b''
    filebytesl=0
    texte=""
    try :
        r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=6)
        status = r.status_code
        if status == 206 :
          for chunk in r.iter_content(chunk_size=8192) :
            if chunk :
              filebytes += chunk
    except Exception as e :
      print("\n     getzipinfo erreur : "+str(e)+" : "+url1)
    if status == 206 :
      filebytesl = len(filebytes) - 4
      eocd = -1
      i = 0
      while i < filebytesl :
        if filebytes[i:i+4] == b'PK\05\06' :
          eocd = i
          i += 4
        i += 1
      if eocd != -1 :
        cdfh = list(struct.unpack('<L', filebytes[eocd+16:eocd+16+4]))[0]
        cdfhl = list(struct.unpack('<L', filebytes[eocd+12:eocd+12+4]))[0]
        return getzipfilelist(s, page, fich, cdfh, cdfh+cdfhl)
      return []
    time.sleep(1)

def getsechtml(s, page, fich):
  updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
  url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  headers1 = {
          'Host' : updatehost,
          'User-Agent': useragent,
          'Connection': 'keep-alive'
  }
  status = -1
  while True :
    status=0
    texte=""
    try :
        r = s.get(url=url1, headers=headers1, allow_redirects=False, timeout=6)
        status = r.status_code
        if status == 200 :
          texte = str(r.content, encoding="utf-8")
    except Exception as e :
      print("\n     getsechtml erreur : "+str(e)+" : "+url1)
    if status == 200 :
      version=re.search(r'<component .*?version=\"(.*?)\"/>', texte)
      if version is not None :
        version=version.group(1)
      else :
        version=""
      language=re.search(r'<default-language name="(.*?)\"', texte)
      if language is not None :
        language=language.group(1)
      else :
        print(texte[:200])
        language=""
      return version, language
    time.sleep(1)

def gethtml(s, page, fich):
  updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
  url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  headers1 = {
          'Host' : updatehost,
          'User-Agent': useragent,
          'Connection': 'keep-alive'
  }
  status = -1
  while True :
    status=0
    texte=""
    try:
        r = s.get(url=url1, headers=headers1, allow_redirects=False, timeout=6)
        status = r.status_code
        if status == 200 :
          texte = str(r.content, encoding="utf-8")
    except Exception as e :
      print("\n     gethtml erreur : "+str(e)+" : "+url1)
    if status == 200 :
      maxStashInfo=re.search(r'<maxStashInfo>(.*?)</maxStashInfo>', texte)
      if maxStashInfo is not None :
        maxStashInfo=maxStashInfo.group(1)
      else :
        maxStashInfo = ""
      partitionName=re.search(r'<partitionName>(.*?)</partitionName>', texte)
      if partitionName is not None :
        partitionName=partitionName.group(1)
      else :
        partitionName = ""
      value = re.search(r'<value>(.*?)</value>', texte)
      if value is not None :
        value = value.group(1)
      else :
        value = ""
      packagetype=re.search(r'<packagetype>(.*?)</packagetype>', texte)
      if packagetype is not None :
        packagetype=packagetype.group(1)
      else :
        packagetype = ""
      fileinfo=re.finditer(r'<file>.*?<spath>(.*?)</spath>.*?<md5>(.*?)</md5>.*?<size>(.*?)</size>.*?</file>', texte, re.S)
      listefichier={}
      for info in fileinfo :
        zipname=info.group(1)
        if zipname.endswith(".zip") :
          listefichier[zipname]={"md5" : info.group(2) , "size" : info.group(3)}
      vendorinfo=re.finditer(r'<vendorInfo (.*?)>', texte)
      version=""
      language=""
      for info in vendorinfo :
        info = info.group(1)
        vendoritem=re.finditer(r'([^ =]+)=\"(.*?)\"', info)
        listevendorinfodata={"logfile":"", "name":"", "newData":"", "package":""}
        for vendordata in vendoritem :
          listevendorinfodata[vendordata.group(1)]=vendordata.group(2)
        logfilelen=len(listevendorinfodata["logfile"])
        logfile=listevendorinfodata["logfile"]
        subpath=listevendorinfodata["subpath"]
        if len(subpath) > 0 :
          logfile = subpath+"/"+logfile
          listevendorinfodata["logfile"] = logfile
        if listevendorinfodata["package"] in listefichier :
          for vendordata in listevendorinfodata :
            listefichier[listevendorinfodata["package"]][vendordata] = listevendorinfodata[vendordata]
            if vendordata == "package" :
               if len(subpath) > 0 :
                listefichier[listevendorinfodata["package"]][vendordata] = subpath+"/"+listevendorinfodata[vendordata]
        if logfilelen > 0 :
          version, language = getsechtml(s, page, logfile)
      authorized = getauthorizeaction(s, str(page[2]))
      approvedstatus=""
      versionNumber=""
      if authorized["data"]["approvedVersionList"][0]["status"] == "0" :
        versionNumber=authorized["data"]["approvedVersionList"][0]["versionNumber"]
        approvedstatus="approved"
      else :
        versionNumber=""
        approvedstatus=""
      zipinfo = {}
      for fichier in listefichier :
        zipinfo[fichier] = getzipinfo(s, page, listefichier[fichier]["package"], listefichier[fichier]["size"])
      with lock :
        with open("scanfound.html", "a") as hout :
          with open("scanfound.txt", "a") as fout :
            mybaseaddress = "http://update.hicloud.com/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"
            strung = "%83s " % (mybaseaddress)
            strong = "<tr><td><a href='"+mybaseaddress+"filelist.xml'>G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/"+"</a></td>"
            print(strung)
            fout.write(strung)
            hout.write(strong)
            strung = "%65s %45s %15s %15s %15s %20s " % (
              version,
              versionNumber,
              packagetype,
              partitionName,
              approvedstatus,
              "size "+value
            )
            strong = "<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>" % (
              version,
              versionNumber,
              packagetype,
              partitionName,
              approvedstatus,
              "size "+value
            )
            print(strung)
            fout.write(strung)
            hout.write(strong)
            premier=True
            for fichier in listefichier :
              if premier :
                strung = "%16s %45s " % (zipinfo[fichier]["realdate"], zipinfo[fichier]["version"])
                strong = "<td>%s</td><td>%s</td>" % (zipinfo[fichier]["realdate"], zipinfo[fichier]["version"])
                print(strung)
                fout.write(strung)
                hout.write(strong)
              strung = "( %30s %65s %20s %40s %55s %20s %62s ) " % (
                listefichier[fichier]["name"],
                listefichier[fichier]["package"],
                "size "+listefichier[fichier]["size"],
                "md5 "+listefichier[fichier]["md5"],
                listefichier[fichier]["logfile"],
                "newData "+listefichier[fichier]["newData"],
                zipinfo[fichier]["tag"]
              )
              strong = "<td>(</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>)</td>" % (
                listefichier[fichier]["name"],
                "<a href='"+mybaseaddress+listefichier[fichier]["package"]+"'>"+listefichier[fichier]["package"]+"</a>",
                "size "+listefichier[fichier]["size"],
                "md5 "+listefichier[fichier]["md5"],
                "<a href='"+mybaseaddress+listefichier[fichier]["logfile"]+"'>"+listefichier[fichier]["logfile"]+"</a>",
                "newData "+listefichier[fichier]["newData"],
                zipinfo[fichier]["tag"]
              )
              print(strung)
              fout.write(strung)
              hout.write(strong)
              if premier :
                strung = " %10s %35s " % (language, "maxStashInfo "+maxStashInfo)
                strong = "<td>%10s</td><td>%s</td>" % (language, "maxStashInfo "+maxStashInfo)
                print(strung)
                fout.write(strung)
                hout.write(strong)
              if premier :
                premier=False
            fout.write("\n")
            hout.write("</tr>\n")
      return status
    time.sleep(1)

def gethtmlcode(s, page, fich) :
  updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
  url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
  headers1 = {
          'Host' : updatehost,
          'User-Agent': useragent,
          'Connection': 'keep-alive'
  }
  while True :
    status = 0
    try :
      r = s.get(url=url1, headers=headers1, allow_redirects=False, timeout=6)
      status = r.status_code
    except Exception as e :
      with lock :
        print(".", end="")
    if status == 200 :
      gethtml(s, page, fich)
      return status
    elif status == 404 :
      return status
    time.sleep(1)

def worker() :
  global cpt, lastcheck
  while True :
    page=q.get()
    cpt+=1
    result = 0
    s = requests.Session()
    result = gethtmlcode(s, page, "filelist.xml")
    s.close()
    if result is None :
      with lock :
        print("\nerreur avec : "+url)
    elif result == 200 :
      with lock :
        print("\nfound : %8d %8d %8d %8d                                     " % (page[0], page[1], page[2], page[3]))
    if time.time() - lastcheck > 2 :
      lastcheck = time.time()
      with lock :
        print("%6d : %8d %8d %8d %8d                                     " % (cpt, page[0], page[1], page[2], page[3]), end="\r")
    q.task_done()
  s.close()

downloadeverything = False
downloadramdisk = []
sysargvl = len(sys.argv)
if sysargvl >= 5 :
  NumberOfThreads = 1
  mgg[0] = int(sys.argv[1])
  mgg[1] = mgg[0]
  mg[0] = int(sys.argv[2])
  mg[1] = mg[0]
  mv[0] = int(sys.argv[3])
  mv[1] = mv[0]
  mf[0] = int(sys.argv[4])
  mf[1] = mf[0]
  if sysargvl > 5 :
    for k in range(5, sysargvl, 1) :
      downloadramdisk.append(sys.argv[k])
    print("download image : "+str(downloadramdisk))
  else :
    downloadeverything = True
    downloadramdisk = ["thisfirmwaredoesntexist"]
    print("download and extract everything")

cpt = 0
lastcheck=time.time()
useragent="HwOUCDownloadManager"
lock = threading.Lock()
crc = crcmod.mkCrcFun(0x11021, initCrc=0x0000, xorOut=0xFFFF)

q = queue.Queue()
for i in range(NumberOfThreads) :
    t = threading.Thread(target=worker)
    t.daemon = True
    t.start()

moncpt=0
for ngg in range(mgg[0], 1+mgg[1], 1) :
  for ng in range(mg[0], 1+mg[1], 1) :
    for nv in range(mv[0], 1+mv[1], 1) :
      for nf in range(mf[0], 1+mf[1], 1) :
        moncpt+=1
        q.put([ngg, ng, nv, nf])
        while moncpt > cpt+NumberOfThreads*2 :
          # speed & ram limit
          time.sleep(0.2)

q.join()

if os.path.exists('removethis.tmp') :
  os.remove('removethis.tmp')
if os.path.exists('removethis2.tmp') :
  os.remove('removethis2.tmp')
 
Last edited:
  • Like
Reactions: oslo83

emiliewgnr

Member
Jul 1, 2018
16
9
scan output examples

Code:
G3776/g1699/v269667/f1/full/                                            CMR-LGRP2-OVS 9.0.1.190                                                          full          system                      size 7289700352       31/05/2019                       CMR-LGRP2-OVS 9.0.1.190            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3461734912     md5 D077E081963D2468EEA15A9F2F815FFE                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v269666/f1/full/                                            CMR-LGRP2-OVS 9.0.1.190                                                     increment          system                      size 7289700352       31/05/2019                       CMR-LGRP2-OVS 9.0.1.190        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 221550478     md5 F795354A07AFDAF4CA3B40E5FF759735                                      changelog_base.xml             newData  )       en-us              maxStashInfo 614690816
G3776/g1699/v267133/f1/full/                                            CMR-LGRP3-CHN 9.0.1.180                                                          full          system                      size 6098518016       27/05/2019                       CMR-LGRP3-CHN 9.0.1.180            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3152883595     md5 6589C91649EE087AA2F8904B955E794C                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v267132/f1/full/                                            CMR-LGRP3-CHN 9.0.1.180                                                     increment          system                      size 6098518016       27/05/2019                       CMR-LGRP3-CHN 9.0.1.180        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 183785754     md5 37EA74F09026CFD0DF8E0D4DC90BBD75                                      changelog_base.xml             newData  )       en-us              maxStashInfo 554369024
G3776/g1699/v264701/f1/full/                                            CMR-LGRP3-OVS 9.0.1.188                                                     increment          system                      size 7289700352       20/05/2019                       CMR-LGRP3-OVS 9.0.1.188        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 184531256     md5 7C419C83A173511C79B6773B4229E991                                      changelog_base.xml             newData  )       en-us              maxStashInfo 647573504
G3776/g1699/v264700/f1/full/                                            CMR-LGRP3-OVS 9.0.1.188                                                          full          system                      size 7289700352       20/05/2019                       CMR-LGRP3-OVS 9.0.1.188            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3431797280     md5 EB4ECBC46DAD5AAE59C96DC92AEA65BD                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v262696/f1/full/                                            CMR-LGRP3-OVS 9.0.1.189                                                          full          system                      size 7289700352       14/05/2019                       CMR-LGRP3-OVS 9.0.1.189            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3439255881     md5 3134BEC7D2F571D6C4AF9045A2EC6E47                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v262695/f1/full/                                            CMR-LGRP3-OVS 9.0.1.189                                                     increment          system                      size 7289700352       14/05/2019                       CMR-LGRP3-OVS 9.0.1.189        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 184440533     md5 94F6496DC6A89426C44CD9007A3EAE97                                      changelog_base.xml             newData  )       en-us              maxStashInfo 622870528
G3776/g1699/v261844/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                CMR-W09-PRELOAD 9.0.1.2(C10R1)            full         preload        approved         size 8388608       30/04/2019                CMR-W09-PRELOAD 9.0.1.2(C10R1)       ota_package_preloadpkg full_preloadpkg  (                        preload                      update_full_preload_CMR-W09_hw_ru_R1-C10.zip       size 381856112     md5 EF5C9B3ABEE926F87A110FAB13080154                      changelog_preload_hw_ru_R1-C10.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v261843/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                     CMR-W09-CUST 9.0.1.2(C10)            full         version        approved        size 33554432       30/04/2019                     CMR-W09-CUST 9.0.1.2(C10)             ota_package_custpkg full_custpkg  (                           cust                                update_full_cust_CMR-W09_hw_ru.zip           size 24912     md5 C0A44C57F6BE39BD50DD83776CB5C0C9                                changelog_cust_hw_ru.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v261842/f1/full/                                       CMR-W09 9.0.1.185(C10E2R1P2)                       CMR-LGRP3-OVS 9.0.1.185            full          system        approved      size 7289700352       30/04/2019                       CMR-LGRP3-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3444645597     md5 422C68D20C7918327D40CA2150167F03                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v259645/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                       CMR-LGRP2-OVS 9.0.1.186            full          system        approved      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3482862642     md5 F2D87E658FE1A3D2FAE245C299318CF0                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v259644/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                                                     increment          system                      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 565082075     md5 555F408120003B37919FE74095674BC8                                      changelog_base.xml             newData  )       en-us              maxStashInfo 605782016
G3776/g1699/v259643/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                       CMR-LGRP2-OVS 9.0.1.186       increment          system        approved      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 552410532     md5 081ACADB73A1DB56568BEA2C9D5DDBE3                                      changelog_base.xml             newData  )       en-us              maxStashInfo 722653184
G3776/g1699/v259642/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                                                          full          system                      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3482862597     md5 F2D7BA02E1271ECC0856259408AA0052                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v259594/f1/full/                                     CMR-AL19 9.0.1.186(C636E2R1P2)                                                          full          system                      size 7289700352       07/05/2019                CMR-AL19 9.0.1.186(C636E2R1P2)                                      fullpkg  (                         common                                                        update.zip      size 2753943139     md5 0463C8C300CDB3EFFA671F969FE44DC9                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(            CMR-AL19-hw-spcseas           CMR-AL19_hw_spcseas/update_full_CMR-AL19_hw_spcseas.zip      size 1225528937     md5 D0E820CD78006EABB109FA8284822EC7            CMR-AL19_hw_spcseas/changelog_hw_spcseas.xml   newData 1521486785 ) 
G3776/g1699/v258594/f1/full/                                            CMR-LGRP1-CHN 9.0.1.180                       CMR-LGRP1-CHN 9.0.1.180       increment          system        approved      size 6098518016       05/05/2019                       CMR-LGRP1-CHN 9.0.1.180        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 213779821     md5 BCE4E33A6E71BD5B2BB595A5A6D4E9F7                                      changelog_base.xml             newData  )       en-us              maxStashInfo 653479936
G3776/g1699/v258593/f1/full/                                            CMR-LGRP1-CHN 9.0.1.180                       CMR-LGRP1-CHN 9.0.1.180            full          system        approved      size 6098518016       05/05/2019                       CMR-LGRP1-CHN 9.0.1.180            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3182852207     md5 A99A3C22EEE5507C1AA8E473870083D5                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v257477/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                                                     increment         preload                         size 8388608       30/04/2019                CMR-W09-PRELOAD 9.0.1.2(C10R1)                       ota_package_preloadpkg  (                        preload                           update_preload_CMR-W09_hw_ru_R1-C10.zip           size 17596     md5 063B53F0D249347F9457ED41A72E36B3                      changelog_preload_hw_ru_R1-C10.xml             newData  )       en-us               maxStashInfo 52670464
G3776/g1699/v257476/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                                                     increment         version                        size 33554432       30/04/2019                     CMR-W09-CUST 9.0.1.2(C10)                          ota_package_custpkg  (                           cust                                     update_cust_CMR-W09_hw_ru.zip           size 17690     md5 2CC2D7DC8A0C1AECE313F8C185AA42C6                                changelog_cust_hw_ru.xml             newData  )       en-us               maxStashInfo 53043200
G3776/g1699/v257475/f1/full/                                       CMR-W09 9.0.1.185(C10E2R1P2)                                                     increment          system                      size 7289700352       30/04/2019                       CMR-LGRP3-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 513295880     md5 5319331E5EF45B76508A4E299631E69A                                      changelog_base.xml             newData  )       en-us              maxStashInfo 673046528
G3776/g1699/v257464/f1/full/                                       CMR-W09 9.0.1.185(C10E2R1P2)                  CMR-W09 9.0.1.185(C10E2R1P2)            full          system        approved      size 7289700352       30/04/2019                  CMR-W09 9.0.1.185(C10E2R1P2)                                      fullpkg  (                         common                                                        update.zip      size 2715739139     md5 FC70F533EEEEEDB8732587D9B431BF1B                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                  CMR-W09-hw-ru                       CMR-W09_hw_ru/update_full_CMR-W09_hw_ru.zip      size 1110139200     md5 160C05B56611FD6ADDD0BD7A248AE700                       CMR-W09_hw_ru/changelog_hw_ru.xml   newData 1381223414 ) 
G3776/g1699/v253990/f1/full/                                     CMR-AL19 9.0.1.185(C185E2R1P2)                CMR-AL19 9.0.1.185(C185E2R1P2)            full          system        approved      size 7289700352       19/04/2019                CMR-AL19 9.0.1.185(C185E2R1P2)                                      fullpkg  (                         common                                                        update.zip      size 2745770445     md5 02D15D77737C4C04407483FF351B0B9A                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(            CMR-AL19-hw-meafnaf           CMR-AL19_hw_meafnaf/update_full_CMR-AL19_hw_meafnaf.zip      size 1217211834     md5 FBA14B935C7A7E2048C2A6C5048FF200            CMR-AL19_hw_meafnaf/changelog_hw_meafnaf.xml   newData 1504457092 ) 
G3776/g1699/v253965/f1/full/                                     CMR-AL19 9.0.1.185(C185E2R1P2)                                                     increment          system                      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 543244660     md5 EBB77C6A48B69D3667FBD89D21738C7D                                      changelog_base.xml             newData  )       en-us              maxStashInfo 687845376
G3776/g1699/v253964/f1/full/                                     CMR-AL19 9.0.1.185(C185E2R1P2)                       CMR-LGRP2-OVS 9.0.1.185            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3474587207     md5 B7C2645CC9A600323239DAD9A05643D7                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v253701/f1/full/                                     CMR-AL09 9.0.1.185(C185E3R1P3)                CMR-AL09 9.0.1.185(C185E3R1P3)            full          system        approved      size 7289700352       19/04/2019                CMR-AL09 9.0.1.185(C185E3R1P3)                                      fullpkg  (                         common                                                        update.zip      size 2745770483     md5 99D5CBB3C87677ABE907A4B5480538EA                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(            CMR-AL09-hw-meafnaf           CMR-AL09_hw_meafnaf/update_full_CMR-AL09_hw_meafnaf.zip       size 895131283     md5 7597362653500702158609C3C6501648            CMR-AL09_hw_meafnaf/changelog_hw_meafnaf.xml   newData 1037712644 ) 
G3776/g1699/v253700/f1/full/                                     CMR-AL09 9.0.1.185(C185E3R1P3)                       CMR-LGRP2-OVS 9.0.1.185            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3474586642     md5 D7E7A22375655A28E6A868B281993DA3                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v253699/f1/full/                                     CMR-AL09 9.0.1.185(C185E3R1P3)                                                     increment          system                      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 543244571     md5 726099A636E761F802A189FA326A5895                                      changelog_base.xml             newData  )       en-us              maxStashInfo 687845376
G3776/g1699/v253283/f1/full/                                            CMR-LGRP3-OVS 9.0.1.183                       CMR-LGRP3-OVS 9.0.1.183       increment          system        approved      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.183        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 204052001     md5 4EAA1DE94BB165B159A1296CCE02CF6E                                      changelog_base.xml             newData  )       en-gb              maxStashInfo 628301824
G3776/g1699/v253282/f1/full/                                            CMR-LGRP3-OVS 9.0.1.183                       CMR-LGRP3-OVS 9.0.1.183            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.183            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3439290465     md5 3C600C259D59B82EC0FE255FF18E468A                                      changelog_base.xml             newData  )       en-gb               maxStashInfo 52428800
G3776/g1699/v253215/f1/full/                                                           请自行修改             CMR-AL19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290029309     md5 8F074AA9FE2D03A22FDB2228E55E23DD                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL19-all-cn                   CMR-AL19_all_cn/update_full_CMR-AL19_all_cn.zip      size 1474795447     md5 E9B787AD28B8BE4E8A5413AAD2A28BD2                    CMR-AL19_all_cn/changelog_all_cn.xml   newData 1900498683 ) 
G3776/g1699/v253214/f1/full/                                                           请自行修改             CMR-AL19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290028891     md5 F115BA529F577658E8C2D1724307D856                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL19-all-cn                   CMR-AL19_all_cn/update_full_CMR-AL19_all_cn.zip      size 1474795483     md5 84DD6939681A71253F054DD6C5A98B2D                    CMR-AL19_all_cn/changelog_all_cn.xml   newData 1900498683 ) 
G3776/g1699/v253213/f1/full/                                                           请自行修改             CMR-AL09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290029074     md5 182D5D32D9176DC46393A23D031DE21D                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL09-all-cn                   CMR-AL09_all_cn/update_full_CMR-AL09_all_cn.zip      size 1151605928     md5 55698FC45CEC34D4E1CD7957DA50C069                    CMR-AL09_all_cn/changelog_all_cn.xml   newData 1432107436 ) 
G3776/g1699/v253212/f1/full/                                                           请自行修改             CMR-AL09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290029258     md5 75E1E60E3317D80AE1488FDE20D2D7A0                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL09-all-cn                   CMR-AL09_all_cn/update_full_CMR-AL09_all_cn.zip      size 1151605893     md5 0D02769A3BBD0E268095553225FBC259                    CMR-AL09_all_cn/changelog_all_cn.xml   newData 1432107436 ) 
G3776/g1699/v253211/f1/full/                                                           请自行修改              CMR-W19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227664     md5 346FB91B7165E746F3FEB0538FA96ECC                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W19-all-cn                     CMR-W19_all_cn/update_full_CMR-W19_all_cn.zip      size 1474888974     md5 C164676F7E7FB8F34BA0660D3A737356                     CMR-W19_all_cn/changelog_all_cn.xml   newData 1900594503 ) 
G3776/g1699/v253210/f1/full/                                                           请自行修改              CMR-W09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227576     md5 3F8289C11352DA8802960BC04496F618                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W09-all-cn                     CMR-W09_all_cn/update_full_CMR-W09_all_cn.zip      size 1151698618     md5 01BE45B08C581762D419CACF7EED42C4                     CMR-W09_all_cn/changelog_all_cn.xml   newData 1432203256 ) 
G3776/g1699/v253209/f1/full/                                                           请自行修改              CMR-W09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227546     md5 6130D558753CA58479C32D5A3D910177                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W09-all-cn                     CMR-W09_all_cn/update_full_CMR-W09_all_cn.zip      size 1151698584     md5 C9A164F3D9B5325BE761919417860284                     CMR-W09_all_cn/changelog_all_cn.xml   newData 1432203256 ) 
G3776/g1699/v253208/f1/full/                                                           请自行修改              CMR-W19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227636     md5 F1C1CA7AEC41FF821D546AD946600585                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W19-all-cn                     CMR-W19_all_cn/update_full_CMR-W19_all_cn.zip      size 1474889010     md5 87A0DD7F500C34F94713442BEC3C166F                     CMR-W19_all_cn/changelog_all_cn.xml   newData 1900594503 ) 
G3776/g1699/v252998/f1/full/                                      CMR-W19 9.0.1.185(C636E2R1P2)                       CMR-LGRP3-OVS 9.0.1.185            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3444645101     md5 B6181B91745E146073A0E1C35E9C0C42                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v252997/f1/full/                                      CMR-W19 9.0.1.185(C636E2R1P2)                                                     increment          system                      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 513295857     md5 B4735E994B7023CF60A5620CE831C2E0                                      changelog_base.xml             newData  )       en-us              maxStashInfo 673046528
G3776/g1699/v252994/f1/full/                                         CMR-W19-CUST 9.0.1.2(C636)                    CMR-W19-CUST 9.0.1.2(C636)            full         version        approved        size 33554432       11/03/2019                    CMR-W19-CUST 9.0.1.2(C636)             ota_package_custpkg full_custpkg  (                           cust                           update_full_cust_CMR-W19_hw_spcseas.zip       size 323453826     md5 A000F89CBB403EFB90BB881A6FA35A88                           changelog_cust_hw_spcseas.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v252991/f1/full/                                    CMR-W19-PRELOAD 9.0.1.2(C636R1)               CMR-W19-PRELOAD 9.0.1.2(C636R1)            full         preload        approved         size 8388608       11/03/2019               CMR-W19-PRELOAD 9.0.1.2(C636R1)       ota_package_preloadpkg full_preloadpkg  (                        preload                update_full_preload_CMR-W19_hw_spcseas_R1-C636.zip       size 143544125     md5 81CED48D114A3951FE1DCDB2B6EFBC98                changelog_preload_hw_spcseas_R1-C636.xml             newData  )       en-us               maxStashInfo 52428800
G3776/g1699/v252938/f1/full/                                      CMR-AL19 9.0.1.185(C10E3R1P3)                 CMR-AL19 9.0.1.185(C10E3R1P3)            full          system        approved      size 7289700352       18/04/2019                 CMR-AL19 9.0.1.185(C10E3R1P3)                                      fullpkg  (                         common                                                        update.zip      size 2745770509     md5 1BC29EBDEBBCCA1A9A878F1FC53170F4                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-AL19-hw-ru                     CMR-AL19_hw_ru/update_full_CMR-AL19_hw_ru.zip      size 1433382839     md5 2CFD3642551915E30C8FA8C7547ABA65                      CMR-AL19_hw_ru/changelog_hw_ru.xml   newData 1849601500 )
 
  • Like
Reactions: oslo83

emiliewgnr

Member
Jul 1, 2018
16
9
Notes

- firmware image CRC checksums are verified and printed out directly while downloading
- all details about the current firmware are appended in an scanfound.txt document
 
  • Like
Reactions: oslo83

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Download directly the recovery_ramdisk image needed for Magisk, the system or any other image from the Huawei official website with proper CRC checking.
    Scan and show details about latest firmwares for your device.

    Usage examples :
    -> To download only the recovery_ramdisk for magisk and the kernel images on the Mediapad M5 Pro's current firmware (update.hicloud.com/TDS/data/files/p3/s15/G3776/g1699/v252687/f1/full/filelist.xml) :
    python3 script.py 3776 1699 252687 1 recovery_ramdisk kernel

    -> To scan or check for latest Huawei Firmwares in the ranges /G3776/ ; /g1699/ ; /v260000/ to /v280000/ ; /f1/ :
    replace first lines 1-10 with :
    Code:
    # mgg is the scan range for G : /G3776/
    mgg = [3776, 3776]
    # mg is the scan range for g : /g1699/
    mg = [1699, 1699]
    # mv is the scan range for v : /v252687/
    mv = [260000, 280000]
    # mf is the scan range for f : /f1/
    mf = [1, 1]

    Install :
    install python3
    pip3 install requests crcmod

    Script :
    Code:
    # e.g. : http://update.hicloud.com:8180/TDS/data/files/p3/s15/G3776/g1699/v252687/f1/full/filelist.xml
    # mgg is the scan range for G : /G3776/
    mgg = [3776, 3776]
    # mg is the scan range for g : /g1699/
    mg = [1699, 1699]
    # mv is the scan range for v : /v252687/
    mv = [200000, 300000]
    # mf is the scan range for f : /f1/
    mf = [1, 1]
    
    # the more threads the heavier the upload
    NumberOfThreads=20
    # dig +short update.hicloud.com
    updatehost="update.hicloud.com"
    updateServerAddressList=[
    "211.152.136.73",
    "211.152.136.75",
    "211.152.136.30",
    "211.152.137.18",
    "211.152.137.14",
    "211.152.137.16",
    "211.152.136.11",
    "211.152.136.74",
    "211.152.137.15",
    "211.152.136.76",
    "211.152.136.29",
    "211.152.136.41",
    "211.152.137.17",
    ]
    #updatehost="update.dbankcdn.com"
    # dig +short update.dbankcdn.com
    #updateServerAddressList=[
    #"152.195.132.192",
    #]
    directDownloadHost = "update.dbankcdn.com"
    # dig +short query.hicloud.com
    queryServerAddress="80.158.19.121"
    # RSA : IMEI
    myIMEI=""
    # look for the image inside following *.APP (UPDATE.APP, USERDATA.APP, PTABLE.APP)
    LookForFirmwareInsideAPP = "UPDATE.APP"
    
    '''
    
    sort -r scanfound.html > result.tmp ; echo "<html><head><style>table { font-family: Sans-Serif; white-space: nowrap; font-size:9px; border-collapse: separate; border-spacing: 10px 0px;}</style></head><body><table>`cat result.tmp`</table></body></html>" > result.html ; rm result.tmp ; firefox result.html
    
    '''
    
    import time
    import requests
    import sys
    import threading
    import queue
    import random
    import json
    import re
    import os
    import base64
    import io
    import struct
    import datetime
    import zlib
    import crcmod
    
    '''
    
    latest valid version for device                       http://query.hicloud.com:80/sp_ard_common/v1/onestopCheck.action?verType=true
    QueryServerURL         http://query.hicloud.com:80/sp_ard_common/v2/Check.action?latest=true
    RetrieveAuthInfoURL   http://query.hicloud.com:80/sp_ard_common/v1/authorize.action
    ReportStatusURL         http://query.hicloud.com:80/sp_ard_common/v2/UpdateReport.action
    
    '''
    
    def getauthorizeaction(s, versionId):
        headers1 = {
            'User-Agent': useragent,
            'Host' : "query.hicloud.com",
            'Accept': 'application/json; charset=UTF-8',
            'X-Requested-With': 'XMLHttpRequest',
            'Connection': 'keep-alive'
        }
        url1="http://"+queryServerAddress+"/sp_ard_common/v1/authorize.action"
        data1={
            "deviceId" : "null",
            "imei" : myIMEI,
            "updateToken" : "null",
            "vendor" : "null",
            "ver" : "1",
            "version" : [
              {
                "versionId" : versionId,
               }
              ]
          }
        payload = json.dumps(data1)
        while True :
          try:
              r = s.post(url=url1, data=payload, headers=headers1, allow_redirects=False, timeout=6)
              if r.status_code == 200 :
                reponse=str(r.content, encoding="utf-8")
                rep=re.fullmatch(r'data=(.*?)&sign=(.*?)&cert=(.*?)', reponse)
                if rep is not None :
                  dataout={
                    "data" : json.loads(base64.b64decode(rep.group(1))),
                    "sign" : base64.b64decode(rep.group(2)),
                    "cert" : base64.b64decode(rep.group(3))
                    }
                  return dataout
          except Exception as e:
              print("getauthorizeaction error : "+str(e))
          time.sleep(1)
    
    mystartbytes = 187
    mymagicnum = "187"
    myunknown = "187"
    myunlockcode = "187"
    def extractimg(source, outdir) :
        global mymagicnum, myunknown, myunlockcode, downloadramdisk, mystartbytes
        sourcel = source.tell()
        source.seek(0)
        i = 0
        if sourcel < 20 :
          return None, 0, 20
        startbytes = source.read(4)
        i += 4
        hasstartbytes = False
        while startbytes == b'\x00\x00\x00\x00' :
          hasstartbytes = True
          startbytes = source.read(4)
          i += 4
        if hasstartbytes and mystartbytes != int(i/4) :
          mystartbytes = int(i/4)
          print("Start Bytes  : " + str(b'\x00\x00\x00\x00') + " * " + str(int(i/4)))
        magicnum = startbytes
        while True :
          if not magicnum :
            break
    
          if magicnum != mymagicnum :
            mymagicnum = magicnum
            print("Magic Number : " + str(magicnum))
          j = i-4
          headersize = list(struct.unpack('<L', source.read(4)))[0]
          if j + headersize > sourcel :
            return None, j, j + headersize + 20
          i += 4
          unknown = source.read(4)
          if unknown != myunknown :
            myunknown = unknown
            print("Unkown       : " + str(unknown))
          i += 4
          unlockcode = source.read(8)
          if unlockcode != myunlockcode :
            myunlockcode = unlockcode
            print("Unlockcode   : " + str(unlockcode))
          i += 8
          moduleid = list(struct.unpack('<L', source.read(4)))[0]
          i += 4
          filesize = list(struct.unpack('<L', source.read(4)))[0]
          if j + headersize + filesize > sourcel :
            return None, j, j + headersize + filesize + 20
          i += 4
          date = str(source.read(16), encoding='utf-8').rstrip('\x00')
          date = re.sub(r'(\d\d\d\d)\.(\d\d)\.(\d\d)', r'\3/\2/\1', date)
          i += 16
          time = str(source.read(16), encoding='utf-8').rstrip('\x00')
          time = re.sub(r'(\d\d)\.(\d\d)\.(\d\d)', r'\1:\2:\3', time)
          i += 16
          filename = str(source.read(32), encoding='utf-8').rstrip('\x00').lower()
          i += 32
          headercsum = source.read(2)
          i += 2
          blocksize = list(struct.unpack('<H', source.read(2)))[0]
          i += 2
          blank2 = source.read(2)
          if blank2 != b'\x00\x00' :
            print("blank2 = " % (blank2))
          i += 2
    
          crcdatasize = headersize - (i-j)
          crcdata = source.read(crcdatasize)
          i+=crcdatasize
    
          if len(downloadramdisk) == 0 :
            if filename == "sha256rsa" :
              return date, j, 0
          else :
            crcgood = "success : calculated CRC does match Huawei's"
            with open(outdir+os.sep+filename+'.img', 'wb') as out :
              s = 0
              c = 0
              readl = 4096
              while s < filesize :
                if s + readl > filesize :
                  readl = filesize - s
                readdata = source.read(readl)
                i += readl
                crcv = crc(readdata)
                if crcdata[c] != (crcv & 0xff) or crcdata[c+1] != ((crcv>>8) & 0xff) :
                  crcgood = "ERROR : calculated CRC does not match Huawei's"
                out.write(readdata)
                c += 2
                s += 4096
            print("%12d header %12d  file %12d %32s %12s %8s %8x %4d     %s" % (i-filesize-headersize, headersize, filesize, filename, date, time, moduleid, blocksize, crcgood))
          if len(downloadramdisk) > 0 :
            if filename in downloadramdisk :
              downloadramdisk.remove(filename)
              print(filename + " checked and saved as "+outdir+os.sep+filename+'.img')
              if len(downloadramdisk) == 0 :
                return date, j, 0
    
          alignment_padding = (4 - i % 4) % 4
          if alignment_padding :
            source.seek(alignment_padding, 1)
            i += alignment_padding
    
          if i+4 > sourcel :
            return date, i, 0
    
          magicnum = source.read(4)
          i += 4
        return "2015", 0, 0
    
    def downloadonlypartofzip(s, page, fich, debut, fin, appname) :
      url1="http://"+directDownloadHost+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      headers1 = {
              'Host' : directDownloadHost,
              'User-Agent': useragent,
              'Connection': 'keep-alive',
              'Range': 'bytes='+str(debut)+'-'+str(fin),
      }
      outdir = ""
      if len(downloadramdisk) > 0 :
        outdir = "G"+str(page[0])+"_g"+str(page[1])+"_v"+str(page[2])+"_f"+str(page[3])+os.sep+fich.replace("/", " ")+os.sep+appname
        os.makedirs(outdir, exist_ok=True)
      status = -1
      while True :
        status=0
        filebytesl=0
        r = None
        try :
            r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=60)
            status = r.status_code
        except Exception as e :
          print("\n     downloadonlypartofzip erreur : "+str(e)+" : "+url1)
        if status == 206 :
          needminimum = 8192
          r.raw.decode_content = True
          z = zlib.decompressobj(wbits=-zlib.MAX_WBITS)
          cherchencore = True
          oltime = time.time()
          fout = None
          if len(downloadramdisk) > 0 :
            fout = open("removethis.tmp", "w+b")
          else :
            fout = io.BytesIO(b'')
          while cherchencore :
            buf = z.unconsumed_tail
            if buf == b'' :
                buf = r.raw.read(8192)
                if buf == b'' :
                  cherchencore = False
            extr = z.decompress(buf)
            if extr == b'':
              cherchencore = False
            fout.write(extr)
            currentpos = fout.tell()
            if  time.time() - oltime > 1 :
              oltime = time.time()
              print("%10.1f MB < %.1f MB needed" % (currentpos/1000000.0, needminimum/1000000.0), end="\r")
            if currentpos >= needminimum or not cherchencore :
              foundit, stripuntil, needminimum = extractimg(fout, outdir)
              if foundit is not None :
                if len(downloadramdisk) == 0 :
                  fout.close()
                  return foundit
                else :
                  fout.close()
                  return foundit
    
              fout.seek(stripuntil)
              if len(downloadramdisk) > 0 :
                fout2 = open("removethis2.tmp", "w+b")
              else :
                fout2 = io.BytesIO(b'')
              fout2.write(fout.read())
              fout.close()
              fout2.seek(0)
              if len(downloadramdisk) > 0 :
                fout = open("removethis.tmp", "w+b")
              else :
                fout = io.BytesIO(b'')
              fout.write(fout2.read())
              fout2.close()
    
          fout.close()
        time.sleep(1)
    
    def getzipfilelist(s, page, fich, debut, fin):
      updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
      url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      headers1 = {
              'Host' : updatehost,
              'User-Agent': useragent,
              'Connection': 'keep-alive',
              'Range': 'bytes='+str(debut)+'-'+str(fin),
      }
      status = -1
      while True :
        status=0
        filebytes=b''
        filebytesl=0
        try :
            r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=6)
            status = r.status_code
            if status == 206 :
              for chunk in r.iter_content(chunk_size=8192) :
                if chunk :  # filter out keep-alive new chunks
                  filebytes += chunk
        except Exception as e :
          print("\n     getzipfilelist erreur : "+str(e)+" : "+url1)
        if status == 206 :
          filezipdata={
            "realdate" : "",
            "version" : "",
            "tag" : ""
            }
          i = 0
          filebytesl = len(filebytes) - 1
          while i < filebytesl :
            compressionmethod = list(struct.unpack('<H', filebytes[i+10:i+10+2]))[0]
            lastmodifdate = list(struct.unpack('<H', filebytes[i+14:i+14+2]))[0]
            lastmodifdate = "%02d/%02d/%04d" % ((lastmodifdate>>11), (lastmodifdate>>7)&0b1111, 6+1980+(lastmodifdate&0b1111111))
            compressedsize = list(struct.unpack('<L', filebytes[i+20:i+20+4]))[0]
            uncompressedsize = list(struct.unpack('<L', filebytes[i+24:i+24+4]))[0]
            filenamelength = list(struct.unpack('<H', filebytes[i+28:i+28+2]))[0]
            extrafieldlength = list(struct.unpack('<H', filebytes[i+30:i+30+2]))[0]
            filecommentlength = list(struct.unpack('<H', filebytes[i+32:i+32+2]))[0]
            relativeoffset = list(struct.unpack('<L', filebytes[i+42:i+42+4]))[0]
            filename = str(filebytes[i+46:i+46+filenamelength], encoding="utf-8").rstrip('\x00')
            extrafield = filebytes[i+46+filenamelength:i+46+filenamelength+extrafieldlength]
            filecomment = filebytes[i+46+filenamelength+extrafieldlength:i+46+filenamelength+extrafieldlength+filecommentlength]
            #print("%s : %s ; uncompressed %d ; compressed %d ; offset %d" % (str(filename), lastmodifdate, uncompressedsize, compressedsize, relativeoffset))
            if compressionmethod == 0 :
              if uncompressedsize > 0 :
                if filename == "VERSION.mbn" :
                  myversion = getfilecontent(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+uncompressedsize-1)
                  myversion = str(myversion, encoding="utf-8").rstrip('\x00')
                  if len(myversion) > 0 :
                    if myversion[-1]=='\n' :
                      myversion = myversion[:-1]
                  filezipdata["version"] = myversion
                elif filename == "UPT_VER.tag" :
                  prg=0
                elif filename.endswith(".tag") :
                  mytag = getfilecontent(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+uncompressedsize-1)
                  mytag = str(mytag, encoding="utf-8").rstrip('\x00')
                  if len(mytag) > 0 :
                    if mytag[-1]=='\n' :
                      mytag = mytag[:-1]
                  filezipdata["tag"] +=  mytag.lower() + " "
            elif compressionmethod == 8 :
              if filename == LookForFirmwareInsideAPP :
                filezipdata["realdate"] = downloadonlypartofzip(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+compressedsize-1, filename)
              elif downloadeverything and filename.endswith(".APP") :
                downloadonlypartofzip(s, page, fich, relativeoffset+30+filenamelength, relativeoffset+30+filenamelength+compressedsize-1, filename)
            else :
              print("new compression method : %d" % ())
            i +=46+filenamelength+extrafieldlength+filecommentlength
          return filezipdata
        time.sleep(1)
    
    def getfilecontent(s, page, fich, debut, fin):
      updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
      url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      headers1 = {
              'Host' : updatehost,
              'User-Agent': useragent,
              'Connection': 'keep-alive',
              'Range': 'bytes='+str(debut)+'-'+str(fin),
      }
      status = -1
      while True :
        status=0
        filebytes=b''
        filebytesl=0
        try :
            r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=6)
            status = r.status_code
            if status == 206 :
              for chunk in r.iter_content(chunk_size=8192) :
                if chunk :
                  filebytes += chunk
        except Exception as e :
          print("\n     getfilecontent erreur : "+str(e)+" : "+url1)
        if status == 206 :
          return filebytes
        time.sleep(1)
    
    def getzipinfo(s, page, fich, fichtaille):
      updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
      url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      fin = int(fichtaille)
      debut = fin - 8192
      headers1 = {
              'Host' : updatehost,
              'User-Agent': useragent,
              'Connection': 'keep-alive',
              'Range': 'bytes='+str(debut)+'-'+str(fin),
      }
      status = -1
      while True :
        status=0
        filebytes=b''
        filebytesl=0
        texte=""
        try :
            r = s.get(url=url1, headers=headers1, allow_redirects=False, stream=True, timeout=6)
            status = r.status_code
            if status == 206 :
              for chunk in r.iter_content(chunk_size=8192) :
                if chunk :
                  filebytes += chunk
        except Exception as e :
          print("\n     getzipinfo erreur : "+str(e)+" : "+url1)
        if status == 206 :
          filebytesl = len(filebytes) - 4
          eocd = -1
          i = 0
          while i < filebytesl :
            if filebytes[i:i+4] == b'PK\05\06' :
              eocd = i
              i += 4
            i += 1
          if eocd != -1 :
            cdfh = list(struct.unpack('<L', filebytes[eocd+16:eocd+16+4]))[0]
            cdfhl = list(struct.unpack('<L', filebytes[eocd+12:eocd+12+4]))[0]
            return getzipfilelist(s, page, fich, cdfh, cdfh+cdfhl)
          return []
        time.sleep(1)
    
    def getsechtml(s, page, fich):
      updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
      url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      headers1 = {
              'Host' : updatehost,
              'User-Agent': useragent,
              'Connection': 'keep-alive'
      }
      status = -1
      while True :
        status=0
        texte=""
        try :
            r = s.get(url=url1, headers=headers1, allow_redirects=False, timeout=6)
            status = r.status_code
            if status == 200 :
              texte = str(r.content, encoding="utf-8")
        except Exception as e :
          print("\n     getsechtml erreur : "+str(e)+" : "+url1)
        if status == 200 :
          version=re.search(r'<component .*?version=\"(.*?)\"/>', texte)
          if version is not None :
            version=version.group(1)
          else :
            version=""
          language=re.search(r'<default-language name="(.*?)\"', texte)
          if language is not None :
            language=language.group(1)
          else :
            print(texte[:200])
            language=""
          return version, language
        time.sleep(1)
    
    def gethtml(s, page, fich):
      updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
      url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      headers1 = {
              'Host' : updatehost,
              'User-Agent': useragent,
              'Connection': 'keep-alive'
      }
      status = -1
      while True :
        status=0
        texte=""
        try:
            r = s.get(url=url1, headers=headers1, allow_redirects=False, timeout=6)
            status = r.status_code
            if status == 200 :
              texte = str(r.content, encoding="utf-8")
        except Exception as e :
          print("\n     gethtml erreur : "+str(e)+" : "+url1)
        if status == 200 :
          maxStashInfo=re.search(r'<maxStashInfo>(.*?)</maxStashInfo>', texte)
          if maxStashInfo is not None :
            maxStashInfo=maxStashInfo.group(1)
          else :
            maxStashInfo = ""
          partitionName=re.search(r'<partitionName>(.*?)</partitionName>', texte)
          if partitionName is not None :
            partitionName=partitionName.group(1)
          else :
            partitionName = ""
          value = re.search(r'<value>(.*?)</value>', texte)
          if value is not None :
            value = value.group(1)
          else :
            value = ""
          packagetype=re.search(r'<packagetype>(.*?)</packagetype>', texte)
          if packagetype is not None :
            packagetype=packagetype.group(1)
          else :
            packagetype = ""
          fileinfo=re.finditer(r'<file>.*?<spath>(.*?)</spath>.*?<md5>(.*?)</md5>.*?<size>(.*?)</size>.*?</file>', texte, re.S)
          listefichier={}
          for info in fileinfo :
            zipname=info.group(1)
            if zipname.endswith(".zip") :
              listefichier[zipname]={"md5" : info.group(2) , "size" : info.group(3)}
          vendorinfo=re.finditer(r'<vendorInfo (.*?)>', texte)
          version=""
          language=""
          for info in vendorinfo :
            info = info.group(1)
            vendoritem=re.finditer(r'([^ =]+)=\"(.*?)\"', info)
            listevendorinfodata={"logfile":"", "name":"", "newData":"", "package":""}
            for vendordata in vendoritem :
              listevendorinfodata[vendordata.group(1)]=vendordata.group(2)
            logfilelen=len(listevendorinfodata["logfile"])
            logfile=listevendorinfodata["logfile"]
            subpath=listevendorinfodata["subpath"]
            if len(subpath) > 0 :
              logfile = subpath+"/"+logfile
              listevendorinfodata["logfile"] = logfile
            if listevendorinfodata["package"] in listefichier :
              for vendordata in listevendorinfodata :
                listefichier[listevendorinfodata["package"]][vendordata] = listevendorinfodata[vendordata]
                if vendordata == "package" :
                   if len(subpath) > 0 :
                    listefichier[listevendorinfodata["package"]][vendordata] = subpath+"/"+listevendorinfodata[vendordata]
            if logfilelen > 0 :
              version, language = getsechtml(s, page, logfile)
          authorized = getauthorizeaction(s, str(page[2]))
          approvedstatus=""
          versionNumber=""
          if authorized["data"]["approvedVersionList"][0]["status"] == "0" :
            versionNumber=authorized["data"]["approvedVersionList"][0]["versionNumber"]
            approvedstatus="approved"
          else :
            versionNumber=""
            approvedstatus=""
          zipinfo = {}
          for fichier in listefichier :
            zipinfo[fichier] = getzipinfo(s, page, listefichier[fichier]["package"], listefichier[fichier]["size"])
          with lock :
            with open("scanfound.html", "a") as hout :
              with open("scanfound.txt", "a") as fout :
                mybaseaddress = "http://update.hicloud.com/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"
                strung = "%83s " % (mybaseaddress)
                strong = "<tr><td><a href='"+mybaseaddress+"filelist.xml'>G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/"+"</a></td>"
                print(strung)
                fout.write(strung)
                hout.write(strong)
                strung = "%65s %45s %15s %15s %15s %20s " % (
                  version,
                  versionNumber,
                  packagetype,
                  partitionName,
                  approvedstatus,
                  "size "+value
                )
                strong = "<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>" % (
                  version,
                  versionNumber,
                  packagetype,
                  partitionName,
                  approvedstatus,
                  "size "+value
                )
                print(strung)
                fout.write(strung)
                hout.write(strong)
                premier=True
                for fichier in listefichier :
                  if premier :
                    strung = "%16s %45s " % (zipinfo[fichier]["realdate"], zipinfo[fichier]["version"])
                    strong = "<td>%s</td><td>%s</td>" % (zipinfo[fichier]["realdate"], zipinfo[fichier]["version"])
                    print(strung)
                    fout.write(strung)
                    hout.write(strong)
                  strung = "( %30s %65s %20s %40s %55s %20s %62s ) " % (
                    listefichier[fichier]["name"],
                    listefichier[fichier]["package"],
                    "size "+listefichier[fichier]["size"],
                    "md5 "+listefichier[fichier]["md5"],
                    listefichier[fichier]["logfile"],
                    "newData "+listefichier[fichier]["newData"],
                    zipinfo[fichier]["tag"]
                  )
                  strong = "<td>(</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>)</td>" % (
                    listefichier[fichier]["name"],
                    "<a href='"+mybaseaddress+listefichier[fichier]["package"]+"'>"+listefichier[fichier]["package"]+"</a>",
                    "size "+listefichier[fichier]["size"],
                    "md5 "+listefichier[fichier]["md5"],
                    "<a href='"+mybaseaddress+listefichier[fichier]["logfile"]+"'>"+listefichier[fichier]["logfile"]+"</a>",
                    "newData "+listefichier[fichier]["newData"],
                    zipinfo[fichier]["tag"]
                  )
                  print(strung)
                  fout.write(strung)
                  hout.write(strong)
                  if premier :
                    strung = " %10s %35s " % (language, "maxStashInfo "+maxStashInfo)
                    strong = "<td>%10s</td><td>%s</td>" % (language, "maxStashInfo "+maxStashInfo)
                    print(strung)
                    fout.write(strung)
                    hout.write(strong)
                  if premier :
                    premier=False
                fout.write("\n")
                hout.write("</tr>\n")
          return status
        time.sleep(1)
    
    def gethtmlcode(s, page, fich) :
      updateServerAddress = updateServerAddressList[random.randint(0, len(updateServerAddressList)-1)]
      url1="http://"+updateServerAddress+"/TDS/data/files/p3/s15/G"+str(page[0])+"/g"+str(page[1])+"/v"+str(page[2])+"/f"+str(page[3])+"/full/"+fich
      headers1 = {
              'Host' : updatehost,
              'User-Agent': useragent,
              'Connection': 'keep-alive'
      }
      while True :
        status = 0
        try :
          r = s.get(url=url1, headers=headers1, allow_redirects=False, timeout=6)
          status = r.status_code
        except Exception as e :
          with lock :
            print(".", end="")
        if status == 200 :
          gethtml(s, page, fich)
          return status
        elif status == 404 :
          return status
        time.sleep(1)
    
    def worker() :
      global cpt, lastcheck
      while True :
        page=q.get()
        cpt+=1
        result = 0
        s = requests.Session()
        result = gethtmlcode(s, page, "filelist.xml")
        s.close()
        if result is None :
          with lock :
            print("\nerreur avec : "+url)
        elif result == 200 :
          with lock :
            print("\nfound : %8d %8d %8d %8d                                     " % (page[0], page[1], page[2], page[3]))
        if time.time() - lastcheck > 2 :
          lastcheck = time.time()
          with lock :
            print("%6d : %8d %8d %8d %8d                                     " % (cpt, page[0], page[1], page[2], page[3]), end="\r")
        q.task_done()
      s.close()
    
    downloadeverything = False
    downloadramdisk = []
    sysargvl = len(sys.argv)
    if sysargvl >= 5 :
      NumberOfThreads = 1
      mgg[0] = int(sys.argv[1])
      mgg[1] = mgg[0]
      mg[0] = int(sys.argv[2])
      mg[1] = mg[0]
      mv[0] = int(sys.argv[3])
      mv[1] = mv[0]
      mf[0] = int(sys.argv[4])
      mf[1] = mf[0]
      if sysargvl > 5 :
        for k in range(5, sysargvl, 1) :
          downloadramdisk.append(sys.argv[k])
        print("download image : "+str(downloadramdisk))
      else :
        downloadeverything = True
        downloadramdisk = ["thisfirmwaredoesntexist"]
        print("download and extract everything")
    
    cpt = 0
    lastcheck=time.time()
    useragent="HwOUCDownloadManager"
    lock = threading.Lock()
    crc = crcmod.mkCrcFun(0x11021, initCrc=0x0000, xorOut=0xFFFF)
    
    q = queue.Queue()
    for i in range(NumberOfThreads) :
        t = threading.Thread(target=worker)
        t.daemon = True
        t.start()
    
    moncpt=0
    for ngg in range(mgg[0], 1+mgg[1], 1) :
      for ng in range(mg[0], 1+mg[1], 1) :
        for nv in range(mv[0], 1+mv[1], 1) :
          for nf in range(mf[0], 1+mf[1], 1) :
            moncpt+=1
            q.put([ngg, ng, nv, nf])
            while moncpt > cpt+NumberOfThreads*2 :
              # speed & ram limit
              time.sleep(0.2)
    
    q.join()
    
    if os.path.exists('removethis.tmp') :
      os.remove('removethis.tmp')
    if os.path.exists('removethis2.tmp') :
      os.remove('removethis2.tmp')
    1
    scan output examples

    Code:
    G3776/g1699/v269667/f1/full/                                            CMR-LGRP2-OVS 9.0.1.190                                                          full          system                      size 7289700352       31/05/2019                       CMR-LGRP2-OVS 9.0.1.190            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3461734912     md5 D077E081963D2468EEA15A9F2F815FFE                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v269666/f1/full/                                            CMR-LGRP2-OVS 9.0.1.190                                                     increment          system                      size 7289700352       31/05/2019                       CMR-LGRP2-OVS 9.0.1.190        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 221550478     md5 F795354A07AFDAF4CA3B40E5FF759735                                      changelog_base.xml             newData  )       en-us              maxStashInfo 614690816
    G3776/g1699/v267133/f1/full/                                            CMR-LGRP3-CHN 9.0.1.180                                                          full          system                      size 6098518016       27/05/2019                       CMR-LGRP3-CHN 9.0.1.180            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3152883595     md5 6589C91649EE087AA2F8904B955E794C                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v267132/f1/full/                                            CMR-LGRP3-CHN 9.0.1.180                                                     increment          system                      size 6098518016       27/05/2019                       CMR-LGRP3-CHN 9.0.1.180        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 183785754     md5 37EA74F09026CFD0DF8E0D4DC90BBD75                                      changelog_base.xml             newData  )       en-us              maxStashInfo 554369024
    G3776/g1699/v264701/f1/full/                                            CMR-LGRP3-OVS 9.0.1.188                                                     increment          system                      size 7289700352       20/05/2019                       CMR-LGRP3-OVS 9.0.1.188        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 184531256     md5 7C419C83A173511C79B6773B4229E991                                      changelog_base.xml             newData  )       en-us              maxStashInfo 647573504
    G3776/g1699/v264700/f1/full/                                            CMR-LGRP3-OVS 9.0.1.188                                                          full          system                      size 7289700352       20/05/2019                       CMR-LGRP3-OVS 9.0.1.188            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3431797280     md5 EB4ECBC46DAD5AAE59C96DC92AEA65BD                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v262696/f1/full/                                            CMR-LGRP3-OVS 9.0.1.189                                                          full          system                      size 7289700352       14/05/2019                       CMR-LGRP3-OVS 9.0.1.189            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3439255881     md5 3134BEC7D2F571D6C4AF9045A2EC6E47                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v262695/f1/full/                                            CMR-LGRP3-OVS 9.0.1.189                                                     increment          system                      size 7289700352       14/05/2019                       CMR-LGRP3-OVS 9.0.1.189        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 184440533     md5 94F6496DC6A89426C44CD9007A3EAE97                                      changelog_base.xml             newData  )       en-us              maxStashInfo 622870528
    G3776/g1699/v261844/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                CMR-W09-PRELOAD 9.0.1.2(C10R1)            full         preload        approved         size 8388608       30/04/2019                CMR-W09-PRELOAD 9.0.1.2(C10R1)       ota_package_preloadpkg full_preloadpkg  (                        preload                      update_full_preload_CMR-W09_hw_ru_R1-C10.zip       size 381856112     md5 EF5C9B3ABEE926F87A110FAB13080154                      changelog_preload_hw_ru_R1-C10.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v261843/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                     CMR-W09-CUST 9.0.1.2(C10)            full         version        approved        size 33554432       30/04/2019                     CMR-W09-CUST 9.0.1.2(C10)             ota_package_custpkg full_custpkg  (                           cust                                update_full_cust_CMR-W09_hw_ru.zip           size 24912     md5 C0A44C57F6BE39BD50DD83776CB5C0C9                                changelog_cust_hw_ru.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v261842/f1/full/                                       CMR-W09 9.0.1.185(C10E2R1P2)                       CMR-LGRP3-OVS 9.0.1.185            full          system        approved      size 7289700352       30/04/2019                       CMR-LGRP3-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3444645597     md5 422C68D20C7918327D40CA2150167F03                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v259645/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                       CMR-LGRP2-OVS 9.0.1.186            full          system        approved      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3482862642     md5 F2D87E658FE1A3D2FAE245C299318CF0                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v259644/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                                                     increment          system                      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 565082075     md5 555F408120003B37919FE74095674BC8                                      changelog_base.xml             newData  )       en-us              maxStashInfo 605782016
    G3776/g1699/v259643/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                       CMR-LGRP2-OVS 9.0.1.186       increment          system        approved      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 552410532     md5 081ACADB73A1DB56568BEA2C9D5DDBE3                                      changelog_base.xml             newData  )       en-us              maxStashInfo 722653184
    G3776/g1699/v259642/f1/full/                                            CMR-LGRP2-OVS 9.0.1.186                                                          full          system                      size 7289700352       08/05/2019                       CMR-LGRP2-OVS 9.0.1.186            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3482862597     md5 F2D7BA02E1271ECC0856259408AA0052                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v259594/f1/full/                                     CMR-AL19 9.0.1.186(C636E2R1P2)                                                          full          system                      size 7289700352       07/05/2019                CMR-AL19 9.0.1.186(C636E2R1P2)                                      fullpkg  (                         common                                                        update.zip      size 2753943139     md5 0463C8C300CDB3EFFA671F969FE44DC9                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(            CMR-AL19-hw-spcseas           CMR-AL19_hw_spcseas/update_full_CMR-AL19_hw_spcseas.zip      size 1225528937     md5 D0E820CD78006EABB109FA8284822EC7            CMR-AL19_hw_spcseas/changelog_hw_spcseas.xml   newData 1521486785 ) 
    G3776/g1699/v258594/f1/full/                                            CMR-LGRP1-CHN 9.0.1.180                       CMR-LGRP1-CHN 9.0.1.180       increment          system        approved      size 6098518016       05/05/2019                       CMR-LGRP1-CHN 9.0.1.180        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 213779821     md5 BCE4E33A6E71BD5B2BB595A5A6D4E9F7                                      changelog_base.xml             newData  )       en-us              maxStashInfo 653479936
    G3776/g1699/v258593/f1/full/                                            CMR-LGRP1-CHN 9.0.1.180                       CMR-LGRP1-CHN 9.0.1.180            full          system        approved      size 6098518016       05/05/2019                       CMR-LGRP1-CHN 9.0.1.180            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3182852207     md5 A99A3C22EEE5507C1AA8E473870083D5                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v257477/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                                                     increment         preload                         size 8388608       30/04/2019                CMR-W09-PRELOAD 9.0.1.2(C10R1)                       ota_package_preloadpkg  (                        preload                           update_preload_CMR-W09_hw_ru_R1-C10.zip           size 17596     md5 063B53F0D249347F9457ED41A72E36B3                      changelog_preload_hw_ru_R1-C10.xml             newData  )       en-us               maxStashInfo 52670464
    G3776/g1699/v257476/f1/full/                                       CMR-W09 9.0.1.160(C10E2R1P2)                                                     increment         version                        size 33554432       30/04/2019                     CMR-W09-CUST 9.0.1.2(C10)                          ota_package_custpkg  (                           cust                                     update_cust_CMR-W09_hw_ru.zip           size 17690     md5 2CC2D7DC8A0C1AECE313F8C185AA42C6                                changelog_cust_hw_ru.xml             newData  )       en-us               maxStashInfo 53043200
    G3776/g1699/v257475/f1/full/                                       CMR-W09 9.0.1.185(C10E2R1P2)                                                     increment          system                      size 7289700352       30/04/2019                       CMR-LGRP3-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 513295880     md5 5319331E5EF45B76508A4E299631E69A                                      changelog_base.xml             newData  )       en-us              maxStashInfo 673046528
    G3776/g1699/v257464/f1/full/                                       CMR-W09 9.0.1.185(C10E2R1P2)                  CMR-W09 9.0.1.185(C10E2R1P2)            full          system        approved      size 7289700352       30/04/2019                  CMR-W09 9.0.1.185(C10E2R1P2)                                      fullpkg  (                         common                                                        update.zip      size 2715739139     md5 FC70F533EEEEEDB8732587D9B431BF1B                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                  CMR-W09-hw-ru                       CMR-W09_hw_ru/update_full_CMR-W09_hw_ru.zip      size 1110139200     md5 160C05B56611FD6ADDD0BD7A248AE700                       CMR-W09_hw_ru/changelog_hw_ru.xml   newData 1381223414 ) 
    G3776/g1699/v253990/f1/full/                                     CMR-AL19 9.0.1.185(C185E2R1P2)                CMR-AL19 9.0.1.185(C185E2R1P2)            full          system        approved      size 7289700352       19/04/2019                CMR-AL19 9.0.1.185(C185E2R1P2)                                      fullpkg  (                         common                                                        update.zip      size 2745770445     md5 02D15D77737C4C04407483FF351B0B9A                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(            CMR-AL19-hw-meafnaf           CMR-AL19_hw_meafnaf/update_full_CMR-AL19_hw_meafnaf.zip      size 1217211834     md5 FBA14B935C7A7E2048C2A6C5048FF200            CMR-AL19_hw_meafnaf/changelog_hw_meafnaf.xml   newData 1504457092 ) 
    G3776/g1699/v253965/f1/full/                                     CMR-AL19 9.0.1.185(C185E2R1P2)                                                     increment          system                      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 543244660     md5 EBB77C6A48B69D3667FBD89D21738C7D                                      changelog_base.xml             newData  )       en-us              maxStashInfo 687845376
    G3776/g1699/v253964/f1/full/                                     CMR-AL19 9.0.1.185(C185E2R1P2)                       CMR-LGRP2-OVS 9.0.1.185            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3474587207     md5 B7C2645CC9A600323239DAD9A05643D7                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v253701/f1/full/                                     CMR-AL09 9.0.1.185(C185E3R1P3)                CMR-AL09 9.0.1.185(C185E3R1P3)            full          system        approved      size 7289700352       19/04/2019                CMR-AL09 9.0.1.185(C185E3R1P3)                                      fullpkg  (                         common                                                        update.zip      size 2745770483     md5 99D5CBB3C87677ABE907A4B5480538EA                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(            CMR-AL09-hw-meafnaf           CMR-AL09_hw_meafnaf/update_full_CMR-AL09_hw_meafnaf.zip       size 895131283     md5 7597362653500702158609C3C6501648            CMR-AL09_hw_meafnaf/changelog_hw_meafnaf.xml   newData 1037712644 ) 
    G3776/g1699/v253700/f1/full/                                     CMR-AL09 9.0.1.185(C185E3R1P3)                       CMR-LGRP2-OVS 9.0.1.185            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3474586642     md5 D7E7A22375655A28E6A868B281993DA3                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v253699/f1/full/                                     CMR-AL09 9.0.1.185(C185E3R1P3)                                                     increment          system                      size 7289700352       19/04/2019                       CMR-LGRP2-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 543244571     md5 726099A636E761F802A189FA326A5895                                      changelog_base.xml             newData  )       en-us              maxStashInfo 687845376
    G3776/g1699/v253283/f1/full/                                            CMR-LGRP3-OVS 9.0.1.183                       CMR-LGRP3-OVS 9.0.1.183       increment          system        approved      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.183        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 204052001     md5 4EAA1DE94BB165B159A1296CCE02CF6E                                      changelog_base.xml             newData  )       en-gb              maxStashInfo 628301824
    G3776/g1699/v253282/f1/full/                                            CMR-LGRP3-OVS 9.0.1.183                       CMR-LGRP3-OVS 9.0.1.183            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.183            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3439290465     md5 3C600C259D59B82EC0FE255FF18E468A                                      changelog_base.xml             newData  )       en-gb               maxStashInfo 52428800
    G3776/g1699/v253215/f1/full/                                                           请自行修改             CMR-AL19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290029309     md5 8F074AA9FE2D03A22FDB2228E55E23DD                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL19-all-cn                   CMR-AL19_all_cn/update_full_CMR-AL19_all_cn.zip      size 1474795447     md5 E9B787AD28B8BE4E8A5413AAD2A28BD2                    CMR-AL19_all_cn/changelog_all_cn.xml   newData 1900498683 ) 
    G3776/g1699/v253214/f1/full/                                                           请自行修改             CMR-AL19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290028891     md5 F115BA529F577658E8C2D1724307D856                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL19-all-cn                   CMR-AL19_all_cn/update_full_CMR-AL19_all_cn.zip      size 1474795483     md5 84DD6939681A71253F054DD6C5A98B2D                    CMR-AL19_all_cn/changelog_all_cn.xml   newData 1900498683 ) 
    G3776/g1699/v253213/f1/full/                                                           请自行修改             CMR-AL09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290029074     md5 182D5D32D9176DC46393A23D031DE21D                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL09-all-cn                   CMR-AL09_all_cn/update_full_CMR-AL09_all_cn.zip      size 1151605928     md5 55698FC45CEC34D4E1CD7957DA50C069                    CMR-AL09_all_cn/changelog_all_cn.xml   newData 1432107436 ) 
    G3776/g1699/v253212/f1/full/                                                           请自行修改             CMR-AL09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019             CMR-AL09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2290029258     md5 75E1E60E3317D80AE1488FDE20D2D7A0                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                CMR-AL09-all-cn                   CMR-AL09_all_cn/update_full_CMR-AL09_all_cn.zip      size 1151605893     md5 0D02769A3BBD0E268095553225FBC259                    CMR-AL09_all_cn/changelog_all_cn.xml   newData 1432107436 ) 
    G3776/g1699/v253211/f1/full/                                                           请自行修改              CMR-W19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227664     md5 346FB91B7165E746F3FEB0538FA96ECC                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W19-all-cn                     CMR-W19_all_cn/update_full_CMR-W19_all_cn.zip      size 1474888974     md5 C164676F7E7FB8F34BA0660D3A737356                     CMR-W19_all_cn/changelog_all_cn.xml   newData 1900594503 ) 
    G3776/g1699/v253210/f1/full/                                                           请自行修改              CMR-W09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227576     md5 3F8289C11352DA8802960BC04496F618                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W09-all-cn                     CMR-W09_all_cn/update_full_CMR-W09_all_cn.zip      size 1151698618     md5 01BE45B08C581762D419CACF7EED42C4                     CMR-W09_all_cn/changelog_all_cn.xml   newData 1432203256 ) 
    G3776/g1699/v253209/f1/full/                                                           请自行修改              CMR-W09 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W09 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227546     md5 6130D558753CA58479C32D5A3D910177                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W09-all-cn                     CMR-W09_all_cn/update_full_CMR-W09_all_cn.zip      size 1151698584     md5 C9A164F3D9B5325BE761919417860284                     CMR-W09_all_cn/changelog_all_cn.xml   newData 1432203256 ) 
    G3776/g1699/v253208/f1/full/                                                           请自行修改              CMR-W19 9.0.1.179(C00E160R1P160)            full          system        approved      size 6098518016       15/04/2019              CMR-W19 9.0.1.179(C00E160R1P160)                                      fullpkg  (                         common                                                        update.zip      size 2260227636     md5 F1C1CA7AEC41FF821D546AD946600585                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-W19-all-cn                     CMR-W19_all_cn/update_full_CMR-W19_all_cn.zip      size 1474889010     md5 87A0DD7F500C34F94713442BEC3C166F                     CMR-W19_all_cn/changelog_all_cn.xml   newData 1900594503 ) 
    G3776/g1699/v252998/f1/full/                                      CMR-W19 9.0.1.185(C636E2R1P2)                       CMR-LGRP3-OVS 9.0.1.185            full          system        approved      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.185            ota_package_basepkg full_basepkg1  (                           base                                              update_full_base.zip      size 3444645101     md5 B6181B91745E146073A0E1C35E9C0C42                                      changelog_base.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v252997/f1/full/                                      CMR-W19 9.0.1.185(C636E2R1P2)                                                     increment          system                      size 7289700352       19/04/2019                       CMR-LGRP3-OVS 9.0.1.185        ota_package_basepkg full_base_datapkg  (                           base                                                   update_base.zip       size 513295857     md5 B4735E994B7023CF60A5620CE831C2E0                                      changelog_base.xml             newData  )       en-us              maxStashInfo 673046528
    G3776/g1699/v252994/f1/full/                                         CMR-W19-CUST 9.0.1.2(C636)                    CMR-W19-CUST 9.0.1.2(C636)            full         version        approved        size 33554432       11/03/2019                    CMR-W19-CUST 9.0.1.2(C636)             ota_package_custpkg full_custpkg  (                           cust                           update_full_cust_CMR-W19_hw_spcseas.zip       size 323453826     md5 A000F89CBB403EFB90BB881A6FA35A88                           changelog_cust_hw_spcseas.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v252991/f1/full/                                    CMR-W19-PRELOAD 9.0.1.2(C636R1)               CMR-W19-PRELOAD 9.0.1.2(C636R1)            full         preload        approved         size 8388608       11/03/2019               CMR-W19-PRELOAD 9.0.1.2(C636R1)       ota_package_preloadpkg full_preloadpkg  (                        preload                update_full_preload_CMR-W19_hw_spcseas_R1-C636.zip       size 143544125     md5 81CED48D114A3951FE1DCDB2B6EFBC98                changelog_preload_hw_spcseas_R1-C636.xml             newData  )       en-us               maxStashInfo 52428800
    G3776/g1699/v252938/f1/full/                                      CMR-AL19 9.0.1.185(C10E3R1P3)                 CMR-AL19 9.0.1.185(C10E3R1P3)            full          system        approved      size 7289700352       18/04/2019                 CMR-AL19 9.0.1.185(C10E3R1P3)                                      fullpkg  (                         common                                                        update.zip      size 2745770509     md5 1BC29EBDEBBCCA1A9A878F1FC53170F4                                           changelog.xml             newData  )       en-us              maxStashInfo 104857600(                 CMR-AL19-hw-ru                     CMR-AL19_hw_ru/update_full_CMR-AL19_hw_ru.zip      size 1433382839     md5 2CFD3642551915E30C8FA8C7547ABA65                      CMR-AL19_hw_ru/changelog_hw_ru.xml   newData 1849601500 )
    1
    Notes

    - firmware image CRC checksums are verified and printed out directly while downloading
    - all details about the current firmware are appended in an scanfound.txt document