bcompiler_write_exe_footer -- Writes the the start pos, and sig to the end of a exe type file
Description
Warning |
This function is
EXPERIMENTAL. That means, that the behaviour of this
function, the function name, in concreto ANYTHING documented here can
change in a future release of this package WITHOUT NOTICE. Be warned, and
use this function at your own risk. |
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),
Example 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().