--[[@title dump ROM for any cam to file--]]binstr=require'binstr'function getsig(addr) return binstr.pack({peek(addr),peek(addr+4)})endfunction printf(...) print(string.format(...))endfunction errf(...) error(string.format(...),2)endif (type(call_event_proc) ~= "function" ) then error("your CHDK does not support native calls")endif (call_event_proc("System.Create") == -1) then error("System.Create failed")endlocal startaddr,os,lcdmsg,msgstr,romsize,xx,XXstartaddr=0os="unk"lcdmsg=0msgstr=0romsize=0if (getsig(0xFFC00004)=="gaonisoy") then startaddr = 0xFFC00000 os = "dry"elseif (getsig(0xFFC00008)=="Copyrigh") then startaddr = 0xFFC00000 os = "vx"elseif (getsig(0xFF810004)=="gaonisoy") then startaddr = 0xFF810000 os = "dry"elseif (getsig(0xFF820004)=="gaonisoy") then startaddr = 0xFF810000 os = "dry"elseif (getsig(0xFF810008)=="Copyrigh") then startaddr = 0xFF810000 os = "vx"elseif (getsig(0xFF000004)=="gaonisoy") then startaddr = 0xFF000000 os = "dry"elseif (getsig(0xFF020004)=="gaonisoy") then startaddr = 0xFF010000 os = "dry"elseif (getsig(0xFC020004)=="gaonisoy") then startaddr = 0xFC000000 os = "dry" romsize = 0x2000000elseif (getsig(0xE0020004)=="gaonisoy") then startaddr = 0xE0000000 os = "dry" romsize = 0x2000000endif (romsize==0) then romsize = 0xFFFFFFFC - startaddrendDUMPFILE="A/PRIMARY.BIN"f=call_event_proc("Fopen_Fut",DUMPFILE,"wb")if (f==0 or f==-1) then errf("Fopen_Fut %s failed %d",DUMPFILE,f)endr=call_event_proc("Fwrite_Fut",startaddr,romsize,1,f)if (r ~= 1) then printf("Fwrite_Fut return %d expect 1",romsize)endcall_event_proc("Fclose_Fut",f)
As a file maybe better... Now working.
if call_event_proc('SystemEventInit') == -1 then if call_event_proc("System.Create") == -1 then error("System.Create failed") endend
ren PRIMARY.BIN PRIMARY-IXUS980_SD990-100e.bin
For older cams (vxworks era), you may need SystemEventInit instead of System.Create to register the _Fut functions.
... 0xFE020004
but I do not get the batch file.
XX="-"..string.upper(bi.platform) XX=XX.."-"..bi.platsub stw="set x="..XX..crLf.."set s=%1"..crLf.."set s=%s:~0,-4%"..crLf.."set e=%s:~-4,4%"..crLf.."set t=%s:~3,123%%x%" bat="A/#Ren2Cam.Bat" txt=io.open(bat,'w') txt:write(stw..crLf) stw="if %~x1?==? (cmd /T:4E/Kdir/b/ad/s/on %1) else (cmd /T:1F/K ren %1 %t%.*)" txt:write(stw..crLf) txt:close()
set x=-SX270HS-102bset s=%1set s=%s:~0,-4%set e=%s:~-4,4%set t=%s:~3,222%%x%if %~x1?==? (cmd /T:4E/Kdir/b/ad/s/on %1) else (cmd /T:1F/K ren %1 %t%.*)
Started by fudgey General Discussion and Assistance
Started by RonCam General Help and Assistance on using CHDK stable releases
Started by Old Farseeing Art General Help and Assistance on using CHDK stable releases
Started by Vishnuisgod General Help and Assistance on using CHDK stable releases
Started by Mauro900 General Help and Assistance on using CHDK stable releases