Update extract script to new image

This commit is contained in:
Uklosk 2025-03-07 19:41:22 +01:00
parent 5cf0d01487
commit 1947f6b779
3 changed files with 4236 additions and 16 deletions

4197
.config Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,19 @@
Device Start End Sectors Size Type
/dev/sde1 73728 4268031 4194304 2G Microsoft basic data --- Roms
/dev/sde2 4268032 4333567 65536 32M Microsoft basic data --- volumn
/dev/sde3 4333568 4366335 32768 16M Microsoft basic data --- env.img
/dev/sde4 4366336 4497407 131072 64M Microsoft basic data --- boot.img
/dev/sde5 4497408 19177471 14680064 7G Microsoft basic data --- linux rootfs
/dev/sde6 19177472 27566079 8388608 4G Microsoft basic data --- appfs
/dev/sde7 27566080 30275583 2709504 1,3G Microsoft basic data --- UDISK
/dev/sde: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 4294967295 sectors, extended partition table (last)
/dev/sde1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 16, heads 4, hidden sectors 73728, sectors 4194304 (volumes > 32 MB), FAT (32 bit), sectors/FAT 4088, serial number 0x75fa8803, unlabeled
/dev/sde2: , code offset 0+3, OEM-ID " ", sectors/cluster 4, root entries 512, Media descriptor 0xf8, sectors/FAT 256, sectors/track 0, sectors 262144 (volumes > 32 MB), reserved 0x1, dos < 4.0 BootSector (0), FAT (16 bit)
/dev/sde3: data
/dev/sde4: Android bootimg, kernel (0x40080000), ramdisk (0x42000000), page size: 2048
/dev/sde5: Linux rev 1.0 ext4 filesystem data, UUID=d8393a2c-184c-4d48-9e76-30715b0be9af, volume name "linuxrootfs" (needs journal recovery) (extents) (64bit) (large files) (huge files)
/dev/sde6: Linux rev 1.0 ext4 filesystem data, UUID=3937472f-4893-44ce-92ce-cb2ef6a13af7, volume name "appfs" (needs journal recovery) (extents) (64bit) (large files) (huge files)
/dev/sde7: Linux rev 1.0 ext4 filesystem data, UUID=1d41b515-cb24-44a0-8f64-5ceb281bc295 (needs journal recovery) (extents) (64bit) (large files) (huge files)

View file

@ -1,39 +1,43 @@
#!/bin/bash
IMAGES_DIR=images
IMAGE_NAME=RG35XXH-V1.1.0-EN16GB-240428.IMG
IMAGE_NAME=RG35XXH-V1.2.0-EN16GB-NO250211.IMG
IMAGE=${IMAGES_DIR}/${IMAGE_NAME}
EXTRACT_DIR=extracted
# Create output dirs
mkdir -p ${EXTRACT_DIR}
# Extract boot0
# boot0
dd if=${IMAGE} of=${EXTRACT_DIR}/boot0.img bs=1024 skip=8 count=64 status=progress
# Extract boot package
# boot package
dd if=${IMAGE} of=${EXTRACT_DIR}/boot_package.img bs=1024 skip=16400 count=20464 status=progress
# Extract boot image
dd if=${IMAGE} of=${EXTRACT_DIR}/boot.img bs=512 skip=8978432 count=131072 status=progress
# Roms partition
dd if=${IMAGE} of=${EXTRACT_DIR}/Roms.img bs=512 skip=73728 count=4194304 status=progress
# Extract env image
dd if=${IMAGE} of=${EXTRACT_DIR}/env.img bs=512 skip=8945664 count=32768 status=progress
# Volumn partition (boot resources)
dd if=${IMAGE} of=${EXTRACT_DIR}/boot-resource.img bs=512 skip=4268032 count=65536 status=progress
# Boot resource image
dd if=${IMAGE} of=${EXTRACT_DIR}/boot-resource.img bs=512 skip=8880128 count=65536 status=progress
# env image
dd if=${IMAGE} of=${EXTRACT_DIR}/env.img bs=512 skip=4333568 count=32768 status=progress
# Boot Roms image
dd if=${IMAGE} of=${EXTRACT_DIR}/Roms.img bs=512 skip=73728 count=8806400 status=progress
# boot image
dd if=${IMAGE} of=${EXTRACT_DIR}/boot.img bs=512 skip=4366336 count=131072 status=progress
# Boot UDISK image
dd if=${IMAGE} of=${EXTRACT_DIR}/UDISK.img bs=512 skip=25886720 count=4487168 status=progress
# Linux rootfs
dd if=${IMAGE} of=${EXTRACT_DIR}/rootfs.img bs=512 skip=4497408 count=14680064 status=progress
# appfs partition
dd if=${IMAGE} of=${EXTRACT_DIR}/appfs.img bs=512 skip=19177472 count=8388608 status=progress
# UDISK partition
dd if=${IMAGE} of=${EXTRACT_DIR}/UDISK.img bs=512 skip=27566080 count=2709504 status=progress
# Boot rootfs image
dd if=${IMAGE} of=${EXTRACT_DIR}/rootfs.img bs=512 skip=9109504 count=16777216 status=progress
# Extract boot.img
unpackbootimg -i ${EXTRACT_DIR}/boot.img -o ${EXTRACT_DIR}/boot_image/
# Extract env.img
strings ${EXTRACT_DIR}/env.img > ${EXTRACT_DIR}/env.txt
strings ${EXTRACT_DIR}/env.img > ${EXTRACT_DIR}/env.txt