bcompiler_write_exe_footer -- Writes the the start pos, and sig to the end of a exe type file
Description
Warnung |
Diese Funktion ist EXPERIMENTELL. Das bedeutet, dass sich das Verhalten der Funktion, ihr Name, und ALLES andere, das hier dokumentiert ist, in zukünftigen Versions des Pakets OHNE WARNUNG ändern kann. Seien Sie gewarnt und nutzen Sie das Paket auf eigenes Risiko. |
An EXE (or self executable) file consists of 3 parts,
The Executable code (eg. a compiled C program that can initiate call the php bcompiler) |
The Bzip encoded Bytecodes |
The bcompiler exe footer |
The startpos is the position of in the file at which the Bzip encoded bytecodes start, and can be obtained using
ftell($fh),
Beispiel 1. bcompiler_write_footer() example <?php
$fh = fopen("/tmp/example.exe","w");
$size = filesize("/tmp/base.exe");
$fr = fopen("/tmp/base.exe","r");
fwrite($fh,fread($fr,$size),$size);
$startpos = ftell($fh);
/* write bytecodes compressed */
$fz = bzopen($fh,"w");
bcompiler_write_header($fz);
bcompiler_write_class($fz,"DB");
bcompiler_write_class($fz,"DB_common");
bcompiler_write_footer($fz);
/* write footer exe uncompressed */
bcompiler_write_exe_footer($fh,$startpos);
fclose($fh);
?> |
|
See also:bcompiler_write_header() bcompiler_write_class(), bcompiler_write_footer().