diff -ur rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.pas 2004-03-15 22:31:54.000000000 +0100 +++ rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.pas 2004-02-16 22:00:19.000000000 +0100 @@ -31,7 +31,6 @@ s : string[255]; c : string[255]; p : string[255]; - b : array[0..10000000] of byte; h : header; t : tail; teller : longint; @@ -87,6 +86,72 @@ end; +procedure bufferxor(var b: array of byte); + +var + i : longint; + +begin + + for i := 0 to sizeof(b)-1 do begin + b[i] := 123 xor b[i]; + end; + +end; + + +procedure blockeat(var infile: file; inlength: longint); + +var + b : array[0..99999] of byte; + l : longint; + c : longint; + n : longint; + +begin + + c := trunc(inlength/sizeof(b)); + + while (c >= 0) do begin + if (c = 0) then l := inlength-(trunc(inlength/sizeof(b))*sizeof(b)) + else l := sizeof(b); + + blockread(infile, b, l, n); + + dec(c); + end; + +end; + + +procedure blockcopy(var infile: file; var outfile: file; inlength: longint; encrypt: boolean); + +var + b : array[0..99999] of byte; + l : longint; + c : longint; + n : longint; + +begin + + c := trunc(inlength/sizeof(b)); + + while (c >= 0) do begin + if (c = 0) then l := inlength-(trunc(inlength/sizeof(b))*sizeof(b)) + else l := sizeof(b); + + blockread(infile, b, l, n); + if (encrypt) then begin + bufferxor(b); + end; + blockwrite(outfile, b, n); + + dec(c); + end; + +end; + + procedure pakin; begin @@ -100,8 +165,8 @@ if (paramcount > 2) then assign(infile, paramstr(3)) else assign(infile, paramstr(0)); reset(infile, 1); - blockread(infile, b, sizeof(b), t.length); - blockwrite(outfile, b, t.length); + t.length := filesize(infile); + blockcopy(infile, outfile, t.length, false); close(infile); t.number := 0; @@ -122,11 +187,9 @@ assign(infile, h.tekst); reset(infile, 1); h.length := filesize(infile); - blockread(infile, b, sizeof(b), h.length); - close(infile); - blockwrite(outfile, h, sizeof(h)); - blockwrite(outfile, b, h.length); + blockcopy(infile, outfile, h.length, true); + close(infile); end; if (klasse = ´c´) then begin @@ -181,7 +244,7 @@ assign(infile, paramstr(0)); reset(infile, 1); - blockread(infile, b, t.length); + blockeat(infile, t.length); try @@ -208,8 +271,7 @@ assign(outfile, workdir + ´\´ + h.tekst); rewrite(outfile, 1); - blockread(infile, b, h.length); - blockwrite(outfile, b, h.length); + blockcopy(infile, outfile, h.length, true); close(outfile); end; @@ -263,7 +325,7 @@ assign(infile, paramstr(0)); reset(infile, 1); - blockread(infile, b, filesize(infile)-sizeof(t)); + blockeat(infile, filesize(infile)-sizeof(t)); blockread(infile, t, sizeof(t)); close(infile); Binary files rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eeew.exe differ