Changeset View
Changeset View
Standalone View
Standalone View
src/phage/bootloader/PhagePHPAgentBootloader.php
Context not available. | |||||
// what's going on here, but just sweep it under the rug for now. | // what's going on here, but just sweep it under the rug for now. | ||||
$main_sequence->addText('$A = new PhagePHPAgent($I); $A->execute();'); | $main_sequence->addText('$A = new PhagePHPAgent($I); $A->execute();'); | ||||
$main_length = strlen($main_sequence->toString()); | $main_length = @strlen($main_sequence->toString()); | ||||
$boot_sequence = new PhutilBallOfPHP(); | $boot_sequence = new PhutilBallOfPHP(); | ||||
$boot = ' | $boot = ' | ||||
$length = '.$main_length.'; | $length = '.$main_length.'; | ||||
$buffer = ""; | $buffer = ""; | ||||
while (strlen($buffer) < $length) { | while (@strlen($buffer) < $length) { | ||||
$data = fread($I, $length - strlen($buffer)); | $data = fread($I, $length - @strlen($buffer)); | ||||
if (!strlen($data)) { | if (!@strlen($data)) { | ||||
exit(1); | exit(1); | ||||
} | } | ||||
$buffer .= $data; | $buffer .= $data; | ||||
Context not available. | |||||
eval($buffer);'; | eval($buffer);'; | ||||
$boot_sequence->addText($boot); | $boot_sequence->addText($boot); | ||||
$boot_length = strlen($boot_sequence->toString()); | $boot_length = @strlen($boot_sequence->toString()); | ||||
$boot_sequence->addText($main_sequence->toString()); | $boot_sequence->addText($main_sequence->toString()); | ||||
if (strlen($boot_length) > 8192) { | if (@strlen($boot_length) > 8192) { | ||||
throw new Exception(pht('Stage 1 bootloader is too large!')); | throw new Exception(pht('Stage 1 bootloader is too large!')); | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0