Unix and Linux Discussions Tagged with exe |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
3,429 |
Debian |
|
|
|
3 |
15,978 |
Shell Programming and Scripting |
|
|
|
8 |
8,806 |
Programming |
|
|
|
0 |
1,063 |
Software Releases - RSS News |
|
|
|
0 |
887 |
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 |
804 |
Software Releases - RSS News |
|
|
|
0 |
868 |
Software Releases - RSS News |
|
|
|
0 |
740 |
Software Releases - RSS News |
|
|
|
0 |
901 |
Software Releases - RSS News |
|
|
|
4 |
8,060 |
Linux |
|
|
|
0 |
683 |
Software Releases - RSS News |
|
|
|
0 |
759 |
Software Releases - RSS News |
|
|
|
0 |
652 |
Software Releases - RSS News |
|
|
|
4 |
2,330 |
Programming |
|
|
|
0 |
916 |
Software Releases - RSS News |
|
|
|
2 |
9,093 |
UNIX and Linux Applications |
|
|
|
0 |
936 |
Software Releases - RSS News |
|
|
|
0 |
1,142 |
Software Releases - RSS News |
|
|
|
0 |
1,027 |
Software Releases - RSS News |
|
|
|
0 |
1,412 |
Security Advisories (RSS) |
|
|
|
5 |
9,670 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,499 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,580 |
Windows & DOS: Issues & Discussions |
|
|
|
1 |
3,735 |
Shell Programming and Scripting |
|
|
|
3 |
2,956 |
UNIX for Advanced & Expert Users |
|
|
|
6 |
4,382 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
7,887 |
Programming |
|
|
|
2 |
3,596 |
Programming |
|
|
|
2 |
4,433 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,087 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,521 |
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)