Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazfit Midong and res2img - adaptation #42

Open
tomurbanowicz opened this issue Oct 17, 2017 · 12 comments
Open

Amazfit Midong and res2img - adaptation #42

tomurbanowicz opened this issue Oct 17, 2017 · 12 comments

Comments

@tomurbanowicz
Copy link

tomurbanowicz commented Oct 17, 2017

Is any chance for adaptation res2img to Amazfit Band?

Mili_tempo.zip

@ArcTuruS02
Copy link

Amazfit Band A1702 (midong). I also join with Tom!

@tomurbanowicz
Copy link
Author

Amazfit Band - sorry.

@dpeddi
Copy link
Contributor

dpeddi commented Oct 19, 2017

I've tried to pass the Mili_tempo.res into the tool, but it hangs... by forcing to go over some resouces are extracted. I've tried to figure out the format but currently i have no time to identify it.

@tomurbanowicz
Copy link
Author

tomurbanowicz commented Oct 19, 2017 via email

@niclet
Copy link

niclet commented Nov 3, 2017

I had a look at the last Mili_tempo.res from 3.1.2

  • some bytes before HMRES signature
  • seems to be 811 offsets, no idea where they point to (the last one is 989215 but file size is 305353...)
  • seems to be 241 'BM' sections whose content is quite similar / quite different to Mili_chaohu.res ones

@dpeddi
Copy link
Contributor

dpeddi commented Nov 7, 2017

The file is compressed with an unknown algorithm that remove redundancy. There are blocks of compressed data with dynamic size.
The header meaning should be: 1 byte of flag, 4 bytes of compressed size, 4 bytes as uncompressed size.
When uncompressed the size of the data should become at the same size of the size declared in the header.
The first and the last chunk of data on the new res file format seems uncompressed.

Inside each chunk there are other "chunk" header that explain the uncompressor where and how many time put the data.

@niclet
Copy link

niclet commented Nov 7, 2017

When you talk about header, do you mean the bytes before HMRES ? or inside each BM section ?

@tomurbanowicz
Copy link
Author

The newest RES is quite different
Mili_tempo-newest.zip

@niclet
Copy link

niclet commented Nov 7, 2017

@tomurbanowicz, yes, this is the one we are analysing

@niclet
Copy link

niclet commented Nov 7, 2017

Ok, so, here is what I understand, according to @dpeddi comment

  • first block : 0x4E / compressed size (4 bytes) / uncompressed size (4 bytes)
  • other blocks : 0x4F / compressed size (4 bytes) / uncompressed size (4 bytes)
  • near the end : 0x00 followed by unknown data, maybe last uncompressed block

There is 242 blocks of 4096 bytes (uncompressed size) plus 3311 bytes

@dpeddi
Copy link
Contributor

dpeddi commented Nov 7, 2017

seems correct... then there are block header, and chunk header. the chunk reader seems parsed and depending on some bit the firmware decide how to use the data near to it however depending.

I'm still trying to figure the relation between the header and the data

@Eth3rkni6ht
Copy link

Eth3rkni6ht commented Jan 21, 2018

Hi,
Since last week there are new faces available. I got the bin file of one of them. I'm interested in doing custom faces, hope you can help. I tried the script but of course it fails:

python dial2img.py -i f7752fb940506ae816ae75569a54c898.bin -u
file is a Haumi resource file
version 0
-177
number of resources: 44
resource 0 | addr: ffffffff | pos on file: fffffffe
ERROR: 0 isn't a bitmap resource
resource 1 | addr: ffffffff | pos on file: fffffffe
ERROR: 1 isn't a bitmap resource
resource 2 | addr: ffffffff | pos on file: fffffffe
ERROR: 2 isn't a bitmap resource
......

Best regards
Face_Midong.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants