EXFAT boot support? Who can fix the offsets "???"

245 views
Skip to first unread message

lichtjaar

unread,
Jan 2, 2011, 6:45:14 PM1/2/11
to ml-d...@googlegroups.com
Here is my early attempt of EXFAT aka FAT64 patch. see attachment.
As I'm on Linux only I'm having trouble setting the disk label to EOS_DEVELOP.
Perhaps someone can help me with, fixing the correct offset1 and offset2 For EXFAT?

I want to help Linux users with EXFAT support:
sudo add-apt-repository ppa:relan/exfat
This driver is the first free exFAT file
sudo apt-get install fuse-exfat

This is my early attempt:

#! /bin/bash 
# patch the SD/CF card bootsector to make it bootable on Canon DSLR
# See http://chdk.setepontos.com/index.php/topic,4214.0.html
#     http://en.wikipedia.org/wiki/File_Allocation_Table#Boot_Sector

# change this  e.g. /dev/mmcblk0p1 or /dev/sdb1
dev=/dev/some_partition

if [[ $OSTYPE == darwin* ]]; then
  diskutil unmount $dev
fi

# read the boot sector to determine the filesystem version
DEV64=`dd if=$dev bs=1 skip=3 count=8`
DEV32=`dd if=$dev bs=1 skip=82 count=8`
DEV16=`dd if=$dev bs=1 skip=54 count=8`

if [ "$DEV16" != 'FAT16   ' -a "$DEV32" != 'FAT32   ' -a 'EXFAT   ']; then
  echo "Error: "$dev" is not a FAT16 or FAT32 or EXFAT device"
  echo debug $dev $DEV16 $DEV32 $DEV64
  exit
fi
if [ "$DEV16" = 'FAT16   ' ]; then
  offset1=43
  offset2=64
  FS='FAT16'
elif [ "$DEV32" = 'FAT32   ' ]; then
  offset1=71
  offset2=92
  FS='FAT32'
elif [ "$DEV64" = 'EXFAT   ' ]; then
  offset1="???"
  offset2="???"
  FS='EXFAT'
else
  echo "Error: "$dev" is not a FAT16 or FAT32 or EXFAT device"
  exit
fi
echo "Applying "$FS" parameters on "$dev" device:"
echo " writing EOS_DEVELOP at offset" $offset1 "(Volume label)"
echo EOS_DEVELOP | dd of="$dev" bs=1 seek=$offset1 count=11
echo " writing BOOTDISK at offset" $offset2 "(Boot code)"
echo BOOTDISK | dd of="$dev" bs=1 seek=$offset2 count=8

make_bootable.sh

pel

unread,
Jan 2, 2011, 7:35:01 PM1/2/11
to ml-d...@googlegroups.com

--
http://magiclantern.wikia.com/
 
To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

lars heijdeman

unread,
Jan 3, 2011, 12:43:05 PM1/3/11
to ml-d...@googlegroups.com

Tanks Pel!

I'll make a new zip post to night.
Greetings

arm.indy

unread,
Jan 3, 2011, 2:43:06 PM1/3/11
to Magic Lantern firmware development
elif [ "$DEV64" = 'EXFAT ' ]; then
offset1="130"
offset2="122"
FS='EXFAT'

please tell if it is working

Indy

Renny Hayes

unread,
Jan 3, 2011, 5:40:13 PM1/3/11
to Magic Lantern firmware development
If ExFAT is successfully implemented, will this inherently remove the
4gb limit, or is there something still in the firmware that cuts files
off? If there is, how hard would it be to remove?

arm.indy

unread,
Jan 3, 2011, 6:20:36 PM1/3/11
to Magic Lantern firmware development

On 3 jan, 23:40, Renny Hayes <jergl...@gmail.com> wrote:
> If ExFAT is successfully implemented, will this inherently remove the
> 4gb limit,
NO

> or is there something still in the firmware that cuts files
> off?
YES, Alex found it if I remember.

>If there is, how hard would it be to remove?
code must be copied to RAM, patched and 'activated', which is not
trivial.

I suggest other unlock features like call("StudioOn") with password
AAAA or AAAAAAAA.
and call("LimitLangOther") to remove the language limitation on
Japanese cameras.

I have not tested it, but must be simpler to implement.

Indy

lichtjaar

unread,
Jan 4, 2011, 2:31:27 PM1/4/11
to ml-d...@googlegroups.com
Sorry to drunk yesterday......
I've made a nice thingie:
MagicLantern card patcher & Installer                     
                                                          
             Current         Pached                       
volumelabel= "�����������"   "EOS_DEVELOP"                
bootcode   = "
��������"      "BOOTDISK"                   
Applying EXFAT parameters on /dev/mmcblk0p1 device:       
                                                          
 Writing "EOS_DEVELOP" at offset 130 (Volume label):    OK
 Writing "BOOTDISK" at offset 122 (Boot code):          OK
                                                          
 Do you want to copy MagicLantern files from /home/user?                                                             
Copying:                                                  
`autoexec.bin' -> `./your_card/autoexec.bin'              
`CineScop.bmp' -> `./your_card/CineScop.bmp'              
`fish8r.bmp' -> `./your_card/fish8r.bmp'                  
`hd_ta.bmp' -> `./your_card/hd_ta.bmp'                    
`magic.cfg' -> `./your_card/magic.cfg'                    
/dev/mmcblk0p1 Successful unmounted                       
Bye bye!                                                  


MagicLantern works oke however the card cannot be accessed.
While keeping 550d on the card can be low-level formatted but somehow the MagicLantern files will stay?
And you can use
MagicLantern till reboot.
After reboot the 550d does not start MagicLantern.

Currently this patching method corrupts the exfat file system. perhaps we have to write also in the exfat backup table
make_bootable2.sh

lichtjaar

unread,
Jan 4, 2011, 5:24:52 PM1/4/11
to ml-d...@googlegroups.com
Either setting the volume label or the boot code makes the 550d not accepting the exfat anymore.
Card cannot be accessed.
i repeat  "can be low-level formatted and somehow the MagicLantern files will stay?
And you can use
MagicLantern till reboot."

lichtjaar

unread,
Jan 4, 2011, 10:25:00 PM1/4/11
to Magic Lantern firmware development
EXFAT SDXC 64GB We need some Russian help

added video on http://magiclantern.wikia.com/wiki/Bootdisk

Video about a typical EXFAT ERROR

pel

unread,
Jan 5, 2011, 12:23:38 AM1/5/11
to ml-d...@googlegroups.com

My guess is changing the boot sector is not enough we have to change the checksum too...

 

From: ml-d...@googlegroups.com [mailto:ml-d...@googlegroups.com] On Behalf Of lichtjaar


Sent: Tuesday, January 04, 2011 5:25 PM
To: ml-d...@googlegroups.com

--

pel

unread,
Jan 5, 2011, 1:09:15 AM1/5/11
to ml-d...@googlegroups.com

The newest EOScard is able to change the checksum and the backup VBR of the exFAT filesystem.

 

Download: http://pel.hu/down/EOScard.exe

 

Please test it.

 

Regards,

 

pel

lichtjaar

unread,
Jan 5, 2011, 11:14:51 AM1/5/11
to ml-d...@googlegroups.com
Hi Pel,

Nice but perhaps you can provide some source on how the checksum and the backup VBR works.
As I'm on Linux only, I'll try wine.
I've already looked inside de .exe but it was too much scrambled.

bye


pel

unread,
Jan 5, 2011, 11:37:32 AM1/5/11
to ml-d...@googlegroups.com

I'm waiting some feedback from somebody who can test it.

I'll share the source if it works.

 

I've found all the necessary information in this pdf:

http://www.sans.org/reading_room/whitepapers/forensics/reverse-engineering-microsoft-exfat-file-system_33274

 

regards,

 

pel

arm.indy

unread,
Jan 5, 2011, 12:33:37 PM1/5/11
to Magic Lantern firmware development
Hi
Here is the C code
http://code.google.com/p/exfat/source/diff?spec=svn183&r=183&format=side&path=/trunk/mkfs/vbr.c

On 5 jan, 17:37, "pel" <p...@pel.hu> wrote:
> I'm waiting some feedback from somebody who can test it.
>
> I'll share the source if it works.
>
> I've found all the necessary information in this pdf:
>
> http://www.sans.org/reading_room/whitepapers/forensics/reverse-engine...
> icrosoft-exfat-file-system_33274
>
> regards,
>
> pel
>
> From: ml-d...@googlegroups.com [mailto:ml-d...@googlegroups.com] On Behalf
> Of lichtjaar
> Sent: Wednesday, January 05, 2011 11:15 AM
> To: ml-d...@googlegroups.com
> Subject: Re: RE: [ML] Re: Card cannot be accessed.
>
> Hi Pel,
>
> Nice but perhaps you can provide some source on how the checksum and the
> backup VBR works.
> As I'm on Linux only, I'll try wine.
> I've already looked inside de .exe but it was too much scrambled.
>
> bye
>
> --http://magiclantern.wikia.com/

Alex

unread,
Jan 5, 2011, 3:45:30 PM1/5/11
to ml-d...@googlegroups.com
For make_bootable, I think it's better to accept the /dev/sdcard as parameter.

Or (like EOSCard does), run "mount | grep EOS_DIGITAL" to guess the SD
card. If the card was formatted from camera, it will have this label.
This will make it "plug and pray" :)

> --

Alex

unread,
Jan 5, 2011, 3:56:07 PM1/5/11
to ml-d...@googlegroups.com
lichtjaar, were you able to run any Canon Basic script? or did you
find these strings (extend.m, script.req...) in Canon FW?

I remember trying a few months ago, without success.

pel

unread,
Jan 5, 2011, 7:20:06 PM1/5/11
to ml-d...@googlegroups.com

You can find the necessary steps here:

http://magiclantern.wikia.com/wiki/EXFAT_rerated_stuf

lichtjaar

unread,
Jan 6, 2011, 7:07:46 PM1/6/11
to ml-d...@googlegroups.com
Nope I have no confirmation that it works, I found it at the CHK..... forum.
Reply all
Reply to author
Forward
0 new messages