> MkImg v1.12 Pctrl%127,name%79,zp%9:A$=OS_GetEnv:in%=0:out%=0:inc%=0:os%=32:Win_TextIO :quit$=cl(" -qu",1):debug%=cl("-de",0):::exit() (Dcl("-help",0):"MkImg v1.12a (C)J.G.Harston 2005-2020":A$="-?" 2cl("-?",0):"Syntax: MkImg outfile inpath -c num -fs type -@ -i@file -o opt -p -q -R root -r -s size -t title -quit command":exit(0) 17):Close_All:exit() (X%=ctrl%:Y%=X%256:cycle%=0:files%=0 etype$=uc(type$):fstype%="HADFS24",type$):fstype%=0:fstype%=3*"DFS31",type$)+4*"DFS62",type$) =fstype%<1fstype%>4:"Unsupported filesystem":exit(220) type$,2)=24:fstype%=0 &fstype%=1:size%>&10000:fstype%=0 (fstype%=1:size%=&10000:size%=&FFFF ,fstype%=0:size%=&1000000:size%=&FFFFFF @fstype%=0:tln%=16:dsz%=23:fsz%=32:root%=&47:dmax%=&01000000 @fstype%=1:tln%=16:dsz%=31:fsz%=24:root%=&47:dmax%=&00010000 @fstype%=2:tln%=19:dsz%=47:fsz%=26:root%=&02:dmax%=&00200000 @fstype%=3:tln%=12:dsz%=31:fsz%=16:root%=&01:dmax%=&00000400 @fstype%=4:tln%=12:dsz%=62:fsz%=16:root%=&01:dmax%=&00000400 size%:dmax%=size% "side%=0:dskid%=(65535) ,fstype%<3:ex%= 6/A%-1:max%=-A%-4096:mem% max%:wr%=2:rd%=4 @&out$="":"Destination file: "out$ JCout%=f_openout(out$):out%=0:"Can't open '"out$"'":exit(192) T)title$=title$+20," "),tln%):dskHdr ^:#out%:out%=0:X%!2=&FFFB2200:fstype%=2:X%!2=&FFFFCE00 h7A%=file(out$,2):out%=f_openup(out$):#out%=#out% r7A%=0:idate%=0:in$<>"":A%=f_info(in$):idate%=X%!15 |Sin$=""inc$<>""stdin%:Enter:A%=2A%=2:cd(in$):ChkDir:Scan("",root%):A%=2 !A%=1:ChkDir:p$="":Add:A%=2 ,A%<>2:"Dir. '"in$"' not found"setFSM >pad%:size%:#out%""stdin%:"Exec "+inc$:inc%=byte(198,0,255):os%=32:inc%=!540 in$<>"":cd(in$) ChkDir:inc%:#inc%=0: ":inc%=0:"Enter filename: "; 2""in$:stdin%:11;(16+in$);16+in$,127) 8leaf$="":Add:A%=0:inc%:A%=#inc%(#inc%-#inc%<2) in$=""A%:inc$<>"":*Exec   Add Hleaf$="":leaf$=in$:A%=in$,","):A%:leaf$=in$,A%+1):in$=in$,A%-1) &=t%=0:in$<>"":in$<>124:t%=f_info(in$):inc%stdin%:11 0=t%:A%=addin$<>"":in$<>124:"File '"in$"' not found" : DChkDir:fs%=fs:rc%=0: Nf_scan(0)<>"0": X(A$=f_scan(X%!9):A$<>"1":A$<>"2": b rc%=-2: l.Scan(p$,dir%):p%,r%:fstype%<=2:files% v1:in$=f_scan(p%):r%=in$:p%=X%!9:r%:RdName  r%=0: RdName:in$=46:os%<8: cycle%=X%?0:t%=f_info(in$) -leaf$=in$:os%-24:leaf$=fn_unbbc(leaf$) sec%=add:t%<>2: rc%=0sec%=0: -cd(in$):Scan(p$+in$+d$,sec%):cd("^"):  ݤadd !t%=2:fstype%>2:side2:=dir% t%=2:rc%=0:=dir% Kload%=X%!2:exec%=X%!6:fsize%=X%!10:attr%=X%?14:fs%<>16:attr%=attr%&7F Gmdate%=X%!15:mtime%=X%!17:cdate%=X%!20:ctime%=X%!22:acc%=X%!25:inf $vb%:"Adding ";p$;in$;"... "; +#out%=#out%:align:ptr0%=#out%-side%  +ptr0%+fsize%>dmax%*256:"disk full":=0 /fsz%=24:fsize%>&7FFFF:"file too long":=0  +files%>=dsz%:fstype%>1:"cat full":=0 *files%>=dsz%:extend 4;A%=leaf$,"."):A%:leaf$=leaf$,A%-1)+"/"+leaf$,A%+1) >RA%=0:ex%:A%=leaf$,"/",3):A%:leaf$=uc(leaf$+" ",A%+1,1))+"/"+leaf$,A%-1) H0ex%:leaf$,2,1)<>"/":leaf$=root$+"/"+leaf$ R>t%<>2:in%=f_openin(in$):in%=0:"Can't open '"in$"'.":=0 \$t%<>2:trans:#in%:in%=0mkdir f7align:sect%=ptr0%256:ptr0%=#out%:files%=files%+1 pfstype%>2:addDFS zfstype%=2:addADFS fstype%<2:addHADFS #out%=#out% vb%:8,8,8:"Done."  =sect% inf:(os%-24)=0: [A$=in$:f_info(A$+s$+"inf")=0:A$,".")::A$=A$,A$-1):A$,1)=s$A$="":A$=A$,A$-1) LA$=A$+s$+"inf":f_info(A$)=1:X%!10<80:in%=(A$):A$=#in%:#in%:in%=0 4A%=A$,"BOOT="):A%:opt%=A$,A%+5):A$=A$,A%-1) #A%=A$,"CRC="):A%:A$=A$,A%-1) copyend%:len%=copyend%-ptr% >f_gbpb(rd%,in%,mem%,len%,0):f_gbpb(wr%,out%,mem%,len%,0) $ptr%=ptr%+len%:ptr%>=copyend%: #align:A%=02554:mem%!A%=0: ;A%=256-(#out%255):A%<256:f_gbpb(wr%,out%,mem%,A%,0)  -dskHdr:files%=0:A%=05114:mem%!A%=0: fstype%>2:dfsHdr "fstype%=2:adfsHdr ,fstype%<2:hadfsHdr 6ptr0%=#out%: @HdfsHdr:$mem%=title$,8):mem%!8=0:$(mem%+256)=title$,9):mem%!260=0 J&f_gbpb(wr%-1,out%,mem%,512,side%) Tafstype%=4:!mem%=&AAAAAAAA:mem%!4=&AAAAAAAA:mem%!256=0:f_gbpb(wr%-1,out%,mem%,512,side%+512) ^ hEhadfsHdr:$mem%=title$:$(mem%+16)=0+"(C)JGH"+0:mem%!&18=dskid% r;mem%!&1C=dmax%:mem%?31=(fsz%=32)&80:fsz%=24:mem%?30=1 |&f_gbpb(wr%-1,out%,mem%,256,&4600)  adfsHdr :dir%=root%:leaf$="$":#out%=root%*256:mkdir:title$=""  :setFSM:idate%=h_date(idate%):stp%=2:fsz%=32:stp%=3 size%=0:size%=ptr0%256 2:mem%?&106=opt%*16+size%256:mem%?&107=size% 255:S%=(S%+1)255 0S%=S%+mem%?A%::=S%255 :!side2:in$<>"1":in$<>"2": Drc%<>-2p$<>"": NCsize%:#out%=side%+256+6:#out%,opt%*16+size%256:#out%,size% X=#out%>&32000:"Side 0 too full":Close_All:exit(128-2) b1#out%=#out%:A%=02554:mem%!A%=&E5E5E5E5: l2:f_gbpb(wr%,out%,mem%,256,0):#out%>=&32000 vside%=&32000:dskHdr: 1ݤh_date(A%)=(A%&FF00)+(A%31)*8+(A%&E0)32 8ݤsofar(A%,B%):8,8,8:d0(A%/(B%+1)*100,2);"%";:="" cd(A$):"DIR "+A$: #ݤfn_unbbc(B$):(os%-24)=0:=B$ B%:A$="#?./$<^>&+@=%; " !A%=1B$:B%=A$,B$,A%,1))-1 4B%>:B$=B$,A%-1)+A$+"_",(B%1)+1,1)+B$,A%+1)  :=B$ $ݤd0(A%,N%):="00000000"+A%,N%) )ݤbyte(A%,X%,Y%)=((&FFF4)&FF00)256 Close_All:*EXEC "in%=in%:in%:A%=in%:in%=0:#A% 'out%=out%:out%:A%=out%:out%=0:#A%   :ݤOS_GetEnv:A$,A%,X%,Y%:X%=1:os%=((&FFF4)&FF00)256 Mos%>31:>&FFFFF:X%256:ș"GetModuleFileName",0,X%,255:run$=$$X%:=@cmd$  \A%=(>&FFFF)&900:?(P-3):A%=((>&9FFF)A%)((&1400-)(A%=0))A%=((A%-&500)&200)&FFF *iA$=$(-&E00+A%):A%=0:run$=A$:ș16A$,,A%:ș72,"",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=run$ 4*Y%=-10:A$=" "+A$:A$=A$,2):A$<>32 >4Y%:A$=34:A%=A$,"""",2)+1Y%:A%=A$+" "," ") HCY%:run$=A$,1-(A$=34),A%-1+2*(A$=34)):run$<>"":A$=A$,A%+1) R :=A$ \$os(A$):A$=42:A$A$<>"":A$ f pFexit(A%):"FX1,"+(A%255):quit$=quit$:A$=quit$:quit$="":os(A$) z>&FFFFF:ȘA% os%<6:*Quit  cݤcl(l$,n%):l$="":A$=s(A$):A$=34:A%=A$+" "" ",""" ",2):l$=A$,2,A%-2):A$=s(A$,A%+1)):=l$ "":A%=A$,l$):A%:A$=s(A$,A%-1)+A$,A$," ",A%)+1))+" ":= n%=0:l$<>"":= %A%=" ",l$=32)+A$,l$):A%=0:="" 'A$=A$,A%-1)+s(A$,A$," ",A%)+1)) Cl$=32:l$=A$,A%):A$=A$,A%-1):=l$,1-(l$=34),l$+2*(l$=34)) PA$,A%,1)<>34:l$=A$,A%,A$+" "," ",A%)-A%):A$=A$,A%-1)+A$,A%+l$+1):=l$ Jl$=A$,A%+1,A$+""" ",""" ",A%+1)-A%-1):A$=A$,A%-1)+A$,A%+l$+3):=l$ /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ ݤuc(A$):B$:A$="":="" 5B$=B$+(A$((A$<"@")&DF)):A$=A$,2):A$="":=B$ $ ݤfs:A%,Y%,E%:=(&FFDA)&FF .Vf_gbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:&FFD1: 8ݤf_openin(A$)=(A$) Bݤf_openout(A$)=(A$) Lݤf_openup(A$)=(A$) VXݤf_scan(p%):fs%>127:ș12,9,"",name%,1,p%,32,,,A%,X%!9:X%!5=1-A%:ș70,name%A$:=A$ `5X%!1=name%:X%!5=1:X%!9=p%:A%=8:&FFD1:X%!5=1:="" j7A%=name%+1:A%!(A%?-1)=&D20:A%?($A%," ")-1)=13:=$A% tBݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF ~Fݤf_info(A$):T%,L%,E%,S%,F%,U%,P%:X%!14=0:T%=file(A$,5):T%=0:=0 5X%!17=0:X%!21=0:X%!25=0:F%=fs:F%<>16:F%<>5:=T% %L%=X%!2:E%=X%!6:S%=X%!10:P%=X%!14 LF%=16:A%=file(A$,&FD):X%!6=E%:X%!10=S%:X%!6=0:X%!10=0:X%!8=P%:X%?8=0 RF%=16:X%!14=P%:X%!17=X%!6:X%!21=X%!10:X%!25=X%!2:X%!2=L%:X%!6=E%:X%!10=S%:=T% %NetFS_OpN(18,65,8,A$)=0:U%=X%!5 mNetFS_OpN(18,64,8,A$)=0:X%!15=X%!10:X%?19=X%?14:X%!20=X%!5:X%?24=X%?9X%!14=P%:X%!19=P%:X%?19=0:X%!22=0 2X%!2=L%:X%!6=E%:X%!10=S%:X%?14=P%:X%!25=U%:=T% 8ݤNetFS_OpN(A%,T%,O%,A$):!X%=0:X%?1=O%+1+A$:X%!3=A% Q>&FFFF:X%?4=T%:$(X%+O%-3)=A$:ș&60048,A%,X%+4,O%+A$,120A%:A%=0:X%?3=0:=0 ;>&FFFF:A%>&FFFF:X%?3=?A%:ș&2002B,A%+4$(X%+4):=X%?3 2X%!4=0:X%?7=T%:$(X%+O%)=A$:A%=&14:&FFF1:=X%?3   ?{   "  X{L{LQ%=PA.:CH."* BASIC s{l{t{R{R{`m{`` X{,z0ȱ J{` ee  { { J{{꩏ `