ubi_reader icon indicating copy to clipboard operation
ubi_reader copied to clipboard

Accept file objects

Open AT0myks opened this issue 1 year ago • 1 comments

This gives more flexibility when using ubireader as a library and fixes the behavior mentioned in https://github.com/onekey-sec/ubi_reader/pull/89#issuecomment-1573199832.

For example this is now possible:

with ZipFile("ubi.zip") as myzip:
    with myzip.open("ubi.bin") as ubi:
        block_size = guess_peb_size(ubi)
        ufile_obj = ubi_file(ubi, block_size)
        ...

Admittedly this is not the best use case right now if you need walk.index() because it takes an extremely long time when the file is zipped, but that's a separate issue.

AT0myks avatar Dec 02 '24 20:12 AT0myks

This looks decent but I'll wait for my more Python experienced colleagues to have a look :)

qkaiser avatar Dec 03 '24 21:12 qkaiser