Unix and Linux Discussions Tagged with exe |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
3,430 |
Debian |
|
|
|
3 |
15,989 |
Shell Programming and Scripting |
|
|
|
8 |
8,808 |
Programming |
|
|
|
0 |
1,065 |
Software Releases - RSS News |
|
|
|
0 |
890 |
Software Releases - RSS News |
|
|
|
2 |
5,148 |
Shell Programming and Scripting |
|
|
|
0 |
1,076 |
Software Releases - RSS News |
|
|
|
0 |
754 |
Software Releases - RSS News |
|
|
|
0 |
1,239 |
Software Releases - RSS News |
|
|
|
0 |
805 |
Software Releases - RSS News |
|
|
|
0 |
870 |
Software Releases - RSS News |
|
|
|
0 |
742 |
Software Releases - RSS News |
|
|
|
0 |
901 |
Software Releases - RSS News |
|
|
|
4 |
8,066 |
Linux |
|
|
|
0 |
683 |
Software Releases - RSS News |
|
|
|
0 |
760 |
Software Releases - RSS News |
|
|
|
0 |
653 |
Software Releases - RSS News |
|
|
|
4 |
2,334 |
Programming |
|
|
|
0 |
917 |
Software Releases - RSS News |
|
|
|
2 |
9,102 |
UNIX and Linux Applications |
|
|
|
0 |
936 |
Software Releases - RSS News |
|
|
|
0 |
1,145 |
Software Releases - RSS News |
|
|
|
0 |
1,029 |
Software Releases - RSS News |
|
|
|
0 |
1,414 |
Security Advisories (RSS) |
|
|
|
5 |
9,673 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,506 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,586 |
Windows & DOS: Issues & Discussions |
|
|
|
1 |
3,736 |
Shell Programming and Scripting |
|
|
|
3 |
2,968 |
UNIX for Advanced & Expert Users |
|
|
|
6 |
4,392 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
7,897 |
Programming |
|
|
|
2 |
3,608 |
Programming |
|
|
|
2 |
4,447 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,098 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,531 |
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)