amnemonic / Quansheng_UV-K5_Firmware

Quansheng UV-K5 Firmware
696 stars 131 forks source link

modded firmware for UV-5R Plus #87

Closed marusc1 closed 1 year ago

marusc1 commented 1 year ago

The modded firmware can not be loaded to Quansheng UV-5R Plus. The error message is "The file version is not match".

RE3CON commented 1 year ago

On UV-5R Plus is fw version 4.001 present. A version check block attemps to "downgrade". You need to spoof after extract/decode by modded fw 2.x this version number. replace in fw version bin file in temp folder inside the small bin in a hex editor number 2 with 4 or just put a instead. Continue with build it encode together as one single bin to upload. Instructions are here to found. Another way use uvmod select universal version build which place a over 2 so v4 accept it. Here you can choose custom firmware submit/upload and only apply w/o any more patches this to flash.

marusc1 @.***> schrieb am Mo., 28. Aug. 2023, 11:22:

The modded firmware can not be loaded to Quansheng UV-5R Plus. The error message is "The file version is not match".

— Reply to this email directly, view it on GitHub https://github.com/amnemonic/Quansheng_UV-K5_Firmware/issues/87, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOBTKJRTJGWWUPCEGLIXMDXXRPOXANCNFSM6AAAAAA4BD6JAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

marusc1 commented 1 year ago

I am trying to do what you have described and get the error: C:\MOJE RZECZY\uvmod_kitchen_1>qsfirm.py pack temp\fw.dec.bin temp\fw.ver.bin k5_v4.01.26_publish.bin_MODDED.bin Traceback (most recent call last): File "C:\MOJE RZECZY\uvmod_kitchen_1\qsfirm.py", line 70, in decoded_firmware = open(sys.argv[2],'rb').read() ^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'temp\fw.dec.bin' C:\MOJE RZECZY\uvmod_kitchen_1>

The files were in temp when I run build with qsfirm.py pack.

RE3CON commented 1 year ago
  1. run python qsfirm.py unpack k5_v4.01.26_publish.bin_MODDED.bin temp\fw.dec.bin temp\fw.ver.bin
  2. edit with hexeditor in temp\fw.ver.bin version 2. to 3 or * for universal
  3. run python qsfirm.py pack k5_v4.01.26_publish.bin_MODDED.bin temp\fw.dec.bin temp\fw.ver.bin

not try to pack a packed file. Run Unpack fist to get these two bin files.

egzumer commented 1 year ago

create a mod_universal_version.py file with a content:

import os,sys,struct print('Running',os.path.basename(sys.argv[0]),'mod...')

fw = bytearray(open(sys.argv[1],'rb').read())

print('Setting universal version...') fw[0x0:0x0+1] = b'*'

open(sys.argv[1],'wb').write(fw)

add a line to build script: python mod_universal_version.py temp\fw.ver.bin

amnemonic commented 1 year ago

Added mod_universal_version.py to repo in c6b759b