I believe I've found and fixed a bug with axc_unpackall(). I noticed recently that the modified time when unpacking files was always the moment they were unpacked, rather than the date stored in the AxC² header... The changes in red below seem to fix it:
Code:
axc_unpackall( packfile,dir="",progress="axm_progress" ) {
ifequal,dir,,setenv,dir,%a_workingdir%
u:="uint",i:="int",s:="str",h:=dllcall("_lopen",s,packfile,i,0),varsetcapacity(x,4,0)
varsetcapacity(hdr,24),dllcall("_lread",u,h,s,hdr,i,24),fls=numget(hdr,8),f:=0
if (h<1||(numget(hdr)<>0xB2437841)||(numget(hdr,4)<>0x3F800000)||fls<1)
{ dllcall("_lclose",u,h)
return -1
} varsetcapacity(z,1),dllcall("_lread",u,h,s,z,i,1),z:=asc(z),varsetcapacity(crc,z)
dllcall("_lread",u,h,s,crc,i,z),csvof:=numget(hdr,12),csvsz:=numget(hdr,16)
dllcall("_llseek",u,h,i,csvof,i,0),varsetcapacity(csv,csvsz)
dllcall("_lread",u,h,s,csv,i,csvsz)
if ( dllcall(&CRC,s,csv,u,csvsz,i,-1,u,0x04C11DB7,"cdecl uint") <> numget(hdr,20) )
{ dllcall("_lclose",u,h)
return -2
} loop,parse,csv,`n
{ loop, parse, a_loopfield, csv
f%A_Index%:=a_loopfield
dllcall("_llseek",u,h,i,f3,i,0),varsetcapacity(bin,f2),dllcall("_lread",u,h,s,bin,i,f2)
If ((e:=dllcall(&CRC,s,bin,u,f2,i,-1,u,0x04C11DB7,"cdecl uint")+0)<>f4)
{ msgbox,16,Checksum Error!,CRC32 failed on %f1% %e%
continue
} ifnotexist,% (tf:=dir "\" f7),filecreatedir,%tf%
ifnotequal,progress,,setenv,dummy,% %progress%(f1,a_index,fls,packfile)
h2:=dllcall("_lcreat",s,tf "\" f1,i,0),f:=f+1
dllcall("_lwrite",u,h2,s,bin,u,f2),dllcall(lc,u,h2)
filesettime,%f5%,%tf%\%f1%,c
filesettime,%f5%,%tf%\%f1%,m
filesetattrib,+%f6%,%tf%\%f1%
} Return f+dllcall("_lclose",u,h)
}