Tutorial How to modify Firmware file

MagicalUnicorn

Moderator
Staff member
Moderator
Contributor
Joined
Jul 4, 2018
Messages
2,170
Likes
1,752
Points
158
#1
How to modify Firmware file ?

At your own risk...
We aren't responsible for bricked devices...

Required :
Any Hex Editor with UTF-8 support (Free : wxMEdit).
Firmware file (Mili_wuhan.fw for Mi band 3 | Mili_chongqing.fw for Mi band 3 NFC).

In the tutorial, I use wxMEdit.
Open your Firmware file with wxMEdit.
Be sure you use the UTF-8 encoding.

Find what you want modify. In my case, I want modify "Connect to app to update".

Next steps are really important, if you don't respect all I wrote, you will brick in most cases !


At your own risk...
We aren't responsible for bricked devices...


Rules
⤳ Never use the "Delete" touch or "Copy/Paste" !
After your new translation, add a 0x00 byte !


First case
Instead "Connect to app to update", I want write "I like unicorn".
Like you can see, my new translation is more short than the original.


It's good, but we can do something better, add a 0x00 bytes until the end of the original translation.


Second case
Instead "Connect to app to update", I want write "I like unicorns and teddy bears".
Like you can see, my new translation is more long than the original. Isn't a problem, I can write over the other languages translations :). Write only over the translations !

Because it's really important, here is a example
Connect to app to update : 24 characters.
I like unicorn : 14 characters.
I like unicorns and teddy bears : 31 characters.

0 : Original 0x00 byte.
0 : 0x00 byte added.

★ Original :
Connect to app to update0Conecta con app para...

BRICK :
I like unicorn0Conecta con app para... (Here I deleted " to update", so I will brick !).
I like unicorns and teddy bears0Conecta con app para...(Here I copied and pasted my new translation at the place of the original, the length isn't same, so I will brick !).

GOOD :
I like unicorn0to update0Conecta con app para...
I like unicorn00000000000Conecta con app para...
I like unicorns and teddy bears0 con app para...


After modifications
⤳ Verify you didn't write over other things than the languages translations !
⤳ Verify you didn't forget a 0x00 byte !
⤳ Verify if the size of your Modified Firmware is the same of the Original.


The end of the Original Firmware and the Modified Firmware are at the same place, all is good :D !

More
If you want add a specific letter, you can use Alt codes : Usefulshortcuts.
⤳ A letter with accent like "Ž" take two bytes ("C5 BD") !
You want make a Mi Band 3 Firmware in your language ? You can translate over the English translations of my English Firmware | Bold Font (You can find the latest English Firmware | Bold Font in the Custom Firmware subforum).


Download
English Translations (MB3/MB3 NFC)


At your own risk...
We aren't responsible for bricked devices...


Post only in English, else it will be deleted.
 

Attachments

Last edited:
Joined
Sep 19, 2018
Messages
39
Likes
11
Points
8
#4
Thanks a lot MagicalUnicorn! Please, would it be possible for a tutorial on how to capture the firmware and resources of the Mi Fit updates?
 

MagicalUnicorn

Moderator
Staff member
Moderator
Contributor
Joined
Jul 4, 2018
Messages
2,170
Likes
1,752
Points
158
#5
Thanks a lot MagicalUnicorn! Please, would it be possible for a tutorial on how to capture the firmware and resources of the Mi Fit updates?
In "assets" folder of Mi Fit. There is already lot of tutorials for decompile an apk on internet.
 

metaathron

New member
Joined
Aug 15, 2018
Messages
22
Likes
22
Points
3
#9
Thank You, @MagicalUnicorn for this tutorial. I would like to ask, if you know, where in the firmware is information about corresponding resources version. I want to increase firmware version number, so it won't be updated by Mi Fit. I know how to do it and I know how to increase resources version number, but then I can't make them work together.

e.g. I take fw 2.0.0.4 with res 44, change them to 9.0.0.4 and res 244 and Mi Fit will see them as newer than current 2.2.0.14 and 46 and will not force update.
 

MagicalUnicorn

Moderator
Staff member
Moderator
Contributor
Joined
Jul 4, 2018
Messages
2,170
Likes
1,752
Points
158
#10
Thank You, @MagicalUnicorn for this tutorial. I would like to ask, if you know, where in the firmware is information about corresponding resources version. I want to increase firmware version number, so it won't be updated by Mi Fit. I know how to do it and I know how to increase resources version number, but then I can't make them work together.

e.g. I take fw 2.0.0.4 with res 44, change them to 9.0.0.4 and res 244 and Mi Fit will see them as newer than current 2.2.0.14 and 46 and will not force update.
Isn't a good idea... Don't update Mi Fit if you don't want your firmware be updated.
its very difficult !!!!!! i tried to translate but i have been found it very complex!!
I never said it's easy :).
 

metaathron

New member
Joined
Aug 15, 2018
Messages
22
Likes
22
Points
3
#11
Isn't a good idea... Don't update Mi Fit if you don't want your firmware be updated..
Is there any reason not to change fw version? I have updated localized firmware to my friends who aren't technically skilled and explaining them, that they shouldn't update Mi Fit is quite difficult, so they come to me after every fw update with chinese band. I think this would be easy solution also for Apple users.
 

MagicalUnicorn

Moderator
Staff member
Moderator
Contributor
Joined
Jul 4, 2018
Messages
2,170
Likes
1,752
Points
158
#12
Is there any reason not to change fw version? I have updated localized firmware to my friends who aren't technically skilled and explaining them, that they shouldn't update Mi Fit is quite difficult, so they come to me after every fw update with chinese band. I think this would be easy solution also for Apple users.
Mi Fit is adapted for one firmware version, if you have an older firmware with the latest Mi Fit, latest functions will not work, also you can have bugs.
Isn't difficult to say "Disable Mi Fit auto-update". If Mi Fit auto-update the firmware, maybe there is a reason :).

So, if you want change the firmware and/or resources version, I will not help you.
 
Joined
Jul 19, 2018
Messages
12
Likes
2
Points
8
#13
@MagicalUnicorn Thank you for the tutorial, really nice. Easily understandable. Really appreciate it.

Though it would be nice to have a list of strings from the english firmware to use as a search list, for translating to other languages.
 

ViBE

Member
Joined
Jul 6, 2018
Messages
71
Likes
20
Points
18
#14
if i grab a Mili_chongqing_EN firmware and follow the rules above can i go wrong?
 

MagicalUnicorn

Moderator
Staff member
Moderator
Contributor
Joined
Jul 4, 2018
Messages
2,170
Likes
1,752
Points
158
#15
@MagicalUnicorn Thank you for the tutorial, really nice. Easily understandable. Really appreciate it.

Though it would be nice to have a list of strings from the english firmware to use as a search list, for translating to other languages.
I will add a list of strings, maybe this weekend, else in the next week.

if i grab a Mili_chongqing_EN firmware and follow the rules above can i go wrong?
Like I said, if you one wrong modification you will brick in the most cases, with original or custom firmware, no difference :).

So yes you can take Mili_chongqing_EN.
 

ViBE

Member
Joined
Jul 6, 2018
Messages
71
Likes
20
Points
18
#19
i need some details to make things clear. so as i understand 00 bites on the hex side marks the end of the strings, right? here's the example what i understand:

if i overwrite it with a shorter text it should looks like these:
The original text00Another translation
My translation00000000Another translation

(those zeroes in my translation goes to the hex side. each character takes 2 zeroes if i'm right(?))

if i overwrite it with a longer text it should looks like these:
The original text00Another translation
My longer translation00her translation

and it should looks like this in the editor i guess:


am i get it?
 

MagicalUnicorn

Moderator
Staff member
Moderator
Contributor
Joined
Jul 4, 2018
Messages
2,170
Likes
1,752
Points
158
#20
i need some details to make things clear. so as i understand 00 bites on the hex side marks the end of the strings, right? here's the example what i understand:

if i overwrite it with a shorter text it should looks like these:
The original text00Another translation
My translation00000000Another translation

(those zeroes in my translation goes to the hex side. each character takes 2 zeroes if i'm right(?))

if i overwrite it with a longer text it should looks like these:
The original text00Another translation
My longer translation00her translation

and it should looks like this in the editor i guess:
View attachment 3206

am i get it?
It's good :).
 
Top