Unix and Linux Discussions Tagged with exe |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
3,217 |
Debian |
|
|
|
3 |
14,859 |
Shell Programming and Scripting |
|
|
|
8 |
8,562 |
Programming |
|
|
|
0 |
728 |
Software Releases - RSS News |
|
|
|
0 |
669 |
Software Releases - RSS News |
|
|
|
2 |
4,727 |
Shell Programming and Scripting |
|
|
|
0 |
771 |
Software Releases - RSS News |
|
|
|
0 |
643 |
Software Releases - RSS News |
|
|
|
0 |
970 |
Software Releases - RSS News |
|
|
|
0 |
669 |
Software Releases - RSS News |
|
|
|
0 |
687 |
Software Releases - RSS News |
|
|
|
0 |
613 |
Software Releases - RSS News |
|
|
|
0 |
769 |
Software Releases - RSS News |
|
|
|
4 |
7,833 |
Linux |
|
|
|
0 |
607 |
Software Releases - RSS News |
|
|
|
0 |
605 |
Software Releases - RSS News |
|
|
|
0 |
558 |
Software Releases - RSS News |
|
|
|
4 |
2,191 |
Programming |
|
|
|
0 |
758 |
Software Releases - RSS News |
|
|
|
2 |
8,679 |
UNIX and Linux Applications |
|
|
|
0 |
778 |
Software Releases - RSS News |
|
|
|
0 |
832 |
Software Releases - RSS News |
|
|
|
0 |
841 |
Software Releases - RSS News |
|
|
|
0 |
1,170 |
Security Advisories (RSS) |
|
|
|
5 |
9,392 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,291 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,211 |
Windows & DOS: Issues & Discussions |
|
|
|
1 |
3,458 |
Shell Programming and Scripting |
|
|
|
3 |
2,397 |
UNIX for Advanced & Expert Users |
|
|
|
6 |
3,690 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
7,192 |
Programming |
|
|
|
2 |
2,929 |
Programming |
|
|
|
2 |
4,103 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
1,897 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
3,868 |
UNIX for Dummies Questions & Answers |
BCOMPILER_WRITE_EXE_FOOTER(3) 1 BCOMPILER_WRITE_EXE_FOOTER(3)
bcompiler_write_exe_footer - Writes the start pos, and sig to the end of a exe type file
SYNOPSIS
bool bcompiler_write_exe_footer (resource $filehandle, int $startpos)
DESCRIPTION
An EXE (or self executable) file consists of 3 parts:
o The
stub (executable code, e.g. a compiled C program) that loads PHP interpreter, bcompiler extension, stored Bytecodes and initiates
a call for the specified function (e.g. main) or class method (e.g. main::main)
oThe Bytecodes (uncompressed only for the moment)
oThe bcompiler EXE footer
To obtain a suitable stub you can compile php_embed-based stub phpe.c located in the examples/embed directory on bcompiler's CVS.
PARAMETERS
o $filehandle
- A file handle as returned by fopen(3).
o $startpos
- The file position at which the Bytecodes start, and can be obtained using ftell(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
bcompiler_write_exe_footer(3) example
<?php
/* creating the output file (example.exe) */
$fh = fopen("example.exe", "w");
/* 1) writing a stub (phpe.exe) */
$size = filesize("phpe.exe");
$fr = fopen("phpe.exe", "r");
fwrite($fh, fread($fr, $size), $size);
$startpos = ftell($fh);
/* 2) writing bytecodes */
bcompiler_write_header($fh);
bcompiler_write_class($fh, "myclass");
bcompiler_write_function($fh, "main");
bcompiler_write_footer($fh);
/* 3) writing EXE footer */
bcompiler_write_exe_footer($fh, $startpos);
/* closing the output file */
fclose($fh);
?>
NOTES
Warning
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in
a future release of PHP. This function should be used at your own risk.
SEE ALSO
bcompiler_write_header(3), bcompiler_write_class(3), bcompiler_write_footer(3).
PHP Documentation Group BCOMPILER_WRITE_EXE_FOOTER(3)