Update the docs with details on how extracting the ISO contents works.

This also documents the new .extract make targets and moves the direct
loopback mount option entirely into the documentation.  It has been
moved because I want to discourage people from using it - I consider
it to be a higher risk with no good return for this risk.
pull/36/head
Hamish Coleman 7 years ago
parent 32a071e67f
commit f28d0a1984

@ -275,15 +275,6 @@ $(DEPSDIR)/slice.insert.deps: Makefile
%.dosflash.exe.orig: %.iso.orig
mcopy -m -i $^@@$(FAT_OFFSET) ::FLASH/DOSFLASH.EXE $@
MOUNT_POINT ?= /mnt
MOUNT_OPTIONS ?= loop,ro
# Mount the "embedded" fat file system from a given iso.
%.iso.mount: %.iso
sudo mount -o $(MOUNT_OPTIONS),offset=$(FAT_OFFSET) $< $(MOUNT_POINT)
%.iso.orig.mount: %.iso.orig
sudo mount -o $(MOUNT_OPTIONS),offset=$(FAT_OFFSET) $< $(MOUNT_POINT)
# Extract the "embedded" fat file system from a given iso.
%.iso.extract: %.iso
mcopy -s -i $^@@$(FAT_OFFSET) :: $@

@ -21,8 +21,8 @@ Then start radare with one of these projects:
radare -p x230.G2HT35WW
Makefile targets:
-----------------
Makefile targets for patching:
------------------------------
If you expect to do development work, the following make targets are
probably useful:
@ -65,6 +65,42 @@ probably useful:
make patched.x230.img.test
Extracting the ISO images:
--------------------------
While examining a new ISO image, it is often useful to extract its
entire contents. Due to the way these images are constructed, it is
not straight forward to get the data out.
The Lenovo ISO image is a iso9660 filesystem image with /no/ files
in it! There is a El-Torrito standard boot descriptor in this image,
and it defines a hard drive image for booting. This hard drive image
is a DOS MBR partitioned disk, with one partition. The partition is a
FAT16 filesystem, containing the actual files used in the BIOS update.
To access the FAT16 filesystem, the byte offset of the filesystem
is calculated (via a process of unwrapping and decoding each layers
described above). So far, every ISO image file from Lenovo that has been
checked has used the same offset, so this has been hardcoded in the
Makefile as the "FAT_OFFSET" variable.
To extract the files for examination, a make target is available which
can be used on any *.iso.orig or *.iso file. e.g:
make g2uj25us.iso.orig.extract
make patched.x230.iso.extract
In the case where a file needs to be modified inside the image, it is
highly recommended to use the mtools "mcopy" utility to copy files back
into the image - this is the safest method and does not require any
elevated priviledges or run the risks of mounting foreign filesystems.
If you find you do need to directly mount the filesystem, the following
command can be used as a starting point:
sudo mount -o loop,offset=$FAT_OFFSET $ISOFILE $MNTPNT
References:
-----------
http://forum.thinkpads.com/viewtopic.php?f=69&t=120776

Loading…
Cancel
Save