2017 © Pedro Peláez
 

library systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

image

hhvm/systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

  • Friday, May 4, 2018
  • by fredemmott
  • Repository
  • 7 Watchers
  • 1 Stars
  • 1,212 Installations
  • Hack
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 22 % Grown

The README.md

Systemlib Extractor Build Status

Parts of HHVM are implemented in Hack, and are embedded in the HHVM binary as additional ELF PROGDATA sections. This library extracts them from the binary., (*1)

There are two kinds of sections that this library extracts:, (*2)

  • systemlib: Pure Hack code
  • ext: built-in extensions. These are a mix of normal Hack code, and functions annotated with the <<__Native>> user attribute, which are implemented in the C++ runtime

Sections with different names or aren't PROGDATA can not be examined with this library., (*3)

Requirements

This package requires the readelf binary; on Debian-like systems, this is in the elfutils package., (*4)

Installation

Assuming your project uses Composer:, (*5)

composer require hhvm/systemlib-extractor

Usage

hphpd> require('vendor/autoload.php')
require('vendor/autoload.php')
hphpd> $extractor = new HHVM\SystemlibExtractor\SystemlibExtractor()
$extractor = new HHVM\SystemlibExtractor\SystemlibExtractor()
hphpd> =$extractor->getSectionNames()
=$extractor->getSectionNames()
HH\Vector Object
(
    [0] => "ext.6eedc03a68a6"
    [1] => "ext.a0e7b2a56511"
    [2] => "ext.7c82e855b041"
...
    [119] => "ext.a6be8a33b7c9"
    [120] => "systemlib"
)

hphpd> =$extractor->getSectionContents('systemlib')
=$extractor->getSectionContents('systemlib')
"<?hh\n// {@}generated\n\nnamespace {\n\n// default base\nclass stdClass {\n}\n\n// used in unserialize() for unknown classes\nclass __PHP_Incomplete_Class {\n  public \$__PHP_Incomplete_Class_Name;\n
There are more characters. Continue? [y/N]n
n
hphpd>

The constructor accepts two optional parameters:, (*6)

  • a path to an HHVM binary
  • a path to READELF

License

Systemlib-Extractor is BSD-licensed. We also provide an additional patent grant., (*7)

Contributing

Please see CONTRIBUTING.md, (*8)

The Versions

04/05 2018

dev-master

9999999-dev https://github.com/hhvm/systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

  Sources   Download

BSD-3-Clause

The Requires

  • hhvm *

 

The Development Requires

hack hhvm

09/02 2018

v1.2

1.2.0.0 https://github.com/hhvm/systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

  Sources   Download

BSD-3-Clause

The Requires

  • hhvm *

 

The Development Requires

hack hhvm

05/01 2018

v1.1

1.1.0.0 https://github.com/hhvm/systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

  Sources   Download

BSD-3-Clause

The Requires

  • hhvm *

 

The Development Requires

hack hhvm

26/06 2017

v1.0

1.0.0.0 https://github.com/hhvm/systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

  Sources   Download

BSD-3-Clause

The Requires

  • hhvm *

 

The Development Requires

hack hhvm

12/08 2015

v0.1

0.1.0.0 https://github.com/hhvm/systemlib-extractor

Extract the PHP, Hack, and HNI files embedded in HHVM

  Sources   Download

BSD-3-Clause

The Requires

  • hhvm *

 

The Development Requires

hack hhvm