Giter VIP home page Giter VIP logo

Comments (2)

Wiz-IO avatar Wiz-IO commented on September 6, 2024

from platform-quectel.

rurban avatar rurban commented on September 6, 2024

Apparently it is EC20 as reverse engineered here:
https://penthertz.com/blog/mobile-iot-modules-FOTA-backdooring-at-scale.html
and described here: https://osmocom.org/projects/quectel-modems/wiki/EC20_DFOTA

But you are supposed use the DFOTA diff generation service. See Quectel_BC66&BC66-NA-OpenCPU_DFOTA_Tool_User_Guide_V1.0.pdf
This is a webservice which creates the delta for your APP update.
Haven't checked Georgi's bc66.py makeFota() functionality yet. Looks simple enough though.

def makeFotaInfo(dst, offset, start, size):
    dst.write( struct.pack('<i',     offset) )      # m_bin_offset
    dst.write( struct.pack('<i', 0x08292000) )      # m_bin_start_addr
    dst.write( struct.pack('<i',       size) )      # m_bin_length
    dst.write( struct.pack('<i', 0x000BF000) )      # m_partition_length
    dst.write( struct.pack('<i', 0x00000000) )      # m_sig_offset
    dst.write( struct.pack('<i', 0x00000000) )      # m_sig_length
    dst.write( struct.pack('<i', 0x00000000) )      # m_is_compressed 
    for i in range(16):
        dst.write( struct.pack('<i', i) )  # m_version_info[16]    
    dst.write( struct.pack('<i', 0x00000000) )      # m_bin_type       
    dst.write( struct.pack('<i', 0x00000000) )      # m_bin_reserved[4]         

def makeFota(src):
    print( "FOTA SRC:", src )
    #print( "FOTA DIR:", os.path.dirname(src) )
    binfile = "FOTA_" + os.path.basename(src)
    print( "FOTA BIN:", binfile )
    print( "FOTA SIZ:", os.path.getsize(src) )

    binSize = os.path.getsize(src)
    dst = open(os.path.dirname(src) + "/" + binfile, "wb")
    arr = [0x4D,0x4D,0x4D,0x00,   0x01,0x00,0x00,0x00,] # m_magic_ver, m_bin_num, m_bin_info[4]
    data = bytearray(arr)
    dst.write(data)
    makeFotaInfo(dst, 0x6C, 0x08292000, binSize)
    bin = open(src, "rb")
    dst.write( bin.read() )
    bin.close()
    dst.close()

from platform-quectel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.