Unix and Linux Discussions Tagged with exe |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
3,260 |
Debian |
|
|
|
3 |
15,185 |
Shell Programming and Scripting |
|
|
|
8 |
8,579 |
Programming |
|
|
|
0 |
736 |
Software Releases - RSS News |
|
|
|
0 |
672 |
Software Releases - RSS News |
|
|
|
2 |
4,953 |
Shell Programming and Scripting |
|
|
|
0 |
777 |
Software Releases - RSS News |
|
|
|
0 |
648 |
Software Releases - RSS News |
|
|
|
0 |
975 |
Software Releases - RSS News |
|
|
|
0 |
673 |
Software Releases - RSS News |
|
|
|
0 |
693 |
Software Releases - RSS News |
|
|
|
0 |
621 |
Software Releases - RSS News |
|
|
|
0 |
774 |
Software Releases - RSS News |
|
|
|
4 |
7,870 |
Linux |
|
|
|
0 |
614 |
Software Releases - RSS News |
|
|
|
0 |
612 |
Software Releases - RSS News |
|
|
|
0 |
560 |
Software Releases - RSS News |
|
|
|
4 |
2,205 |
Programming |
|
|
|
0 |
767 |
Software Releases - RSS News |
|
|
|
2 |
8,717 |
UNIX and Linux Applications |
|
|
|
0 |
779 |
Software Releases - RSS News |
|
|
|
0 |
838 |
Software Releases - RSS News |
|
|
|
0 |
844 |
Software Releases - RSS News |
|
|
|
0 |
1,176 |
Security Advisories (RSS) |
|
|
|
5 |
9,411 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,329 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,279 |
Windows & DOS: Issues & Discussions |
|
|
|
1 |
3,509 |
Shell Programming and Scripting |
|
|
|
3 |
2,444 |
UNIX for Advanced & Expert Users |
|
|
|
6 |
3,817 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
7,277 |
Programming |
|
|
|
2 |
3,036 |
Programming |
|
|
|
2 |
4,118 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
1,916 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
3,932 |
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)