Let's make it easier. Here's a Lua script (to be used from CHDK):
call_event_proc("System.Create")
f=call_event_proc("Fopen_Fut","A/PRIMARY.BIN","w")
call_event_proc("Fwrite_Fut",0xff000000,0x1000000,1,f)
call_event_proc("Fclose_Fut",f)
Native calls are necessary to run this.