想要解出官方BIN包中system.img,有些固件會報如下錯誤:
"E:\mstar-bin-tool-master\unpack.py", line 91, in <module>
utils.copyPart(inputFile, outputFile, int(offset, 16), int(size, 16))
ValueError: invalid literal for int() with base 16: '$(imageOffset)'
捕獲.PNG (59.68 KB, 下載次數(shù): 34)
下載附件
保存到相冊
2018-10-1 20:33 上傳
- E:\mstar-bin-tool-master>unpack.py LetvUpgrade938.bin
- [i] Analizing header ...
- [i] Saving header script to unpacked\~header_script ...
- [i] Parsing script ...
- Traceback (most recent call last):
- File "E:\mstar-bin-tool-master\unpack.py", line 91, in <module>
- utils.copyPart(inputFile, outputFile, int(offset, 16), int(size, 16))
- ValueError: invalid literal for int() with base 16: '$(imageOffset)'
復(fù)制代碼
解決方法:
用Notepad++編輯打開unpack.py,刪除第91行所在如下兩段,即可順利解出system.img
- if params["action"] == "write.boot":
- outputFile = utils.generateFileName(outputDirectory, params, ".img")
- utils.copyPart(inputFile, outputFile, int(offset, 16), int(size, 16))
- print ("[i] Partition: {}\tOffset: {}\tSize {} ({}) -> {}".format(params["partition_name"], offset, size, utils.sizeStr(int(size, 16)), outputFile))
- if params["action"] == "write.p":
- outputFile = os.path.join(outputDirectory, params["partition_name"] + ".img")
- utils.copyPart(inputFile, outputFile, int(offset, 16), int(size, 16))
- print ("[i] Partition: {}\tOffset: {}\tSize {} ({}) -> {}".format(params["partition_name"], offset, size, utils.sizeStr(int(size, 16)), outputFile))
復(fù)制代碼
捕獲1.PNG (94.06 KB, 下載次數(shù): 34)
下載附件
保存到相冊
2018-10-1 20:40 上傳
|