Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Twel12/c860caca1961d0d71a1484b846dba6f3 to your computer and use it in GitHub Desktop.
Save Twel12/c860caca1961d0d71a1484b846dba6f3 to your computer and use it in GitHub Desktop.
import io
offset0 = 0x4000
offset1 = 0x5000
offset2 = 0x740000
offset3 = 0xD2F000
offset4 = 0x146A000
outpt = open("logo_new_mi9t.img", "wb")
emptyContent = [0 for i in range(0x1A59000)]
mi9offset = [0x4C, 0x4F, 0x47, 0x4F, 0x21, 0x21, 0x21, 0x21, 0x05, 0x00, 0x00, 0x00,
0x3B, 0x07, 0x00, 0x00, 0x40, 0x07, 0x00, 0x00, 0xEF, 0x05, 0x00, 0x00,
0x2F, 0x0D, 0x00, 0x00, 0x3B, 0x07, 0x00, 0x00, 0x6A, 0x14, 0x00, 0x00,
0xEF, 0x05]
outpt.write(bytearray(emptyContent))
#export in photoshop as 24bit windows bmps
outpt.seek(offset0)
outpt.write(bytearray(mi9offset))
#Locked pic has to be 1080x2340
outpt.seek(offset1)
img = open("pic1.bmp", "rb")
outpt.write(img.read())
#Fastboot pic has to be 1080x1920
outpt.seek(offset2)
img = open("pic2.bmp", "rb")
outpt.write(img.read())
#Unlocked pic has to be 1080x2340
outpt.seek(offset3)
img = open("pic3.bmp", "rb")
outpt.write(img.read())
#Error pic has to be 1080x1920
outpt.seek(offset4)
img = open("pic4.bmp", "rb")
outpt.write(img.read())
outpt.close()
@Arun-ez
Copy link

Arun-ez commented Oct 2, 2021

hello sir , please can you make a py script for Mi 11x/poco F3 to make logo.img

@Twel12
Copy link
Author

Twel12 commented Oct 2, 2021

hello sir , please can you make a py script for Mi 11x/poco F3 to make logo.img

I have just forked the repo rather ask the guy who made originally https://gist.github.com/GarnetSunset/87209a481c7dd52e40bb08d38737812e

@whyredfire
Copy link

hello sir , please can you make a py script for Mi 11x/poco F3 to make logo.img

I have just forked the repo rather ask the guy who made originally https://gist.github.com/GarnetSunset/87209a481c7dd52e40bb08d38737812e

Hi sir, can you please make a py script for Xiaomi 11 Lite NE to make logo.img

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment