PHPackages                             hhvm/systemlib-extractor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hhvm/systemlib-extractor

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

hhvm/systemlib-extractor
========================

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

v1.2(8y ago)11.2k2[1 PRs](https://github.com/hhvm/systemlib-extractor/pulls)1BSD-3-ClauseHack

Since Aug 12Pushed 7y ago5 watchersCompare

[ Source](https://github.com/hhvm/systemlib-extractor)[ Packagist](https://packagist.org/packages/hhvm/systemlib-extractor)[ Docs](https://github.com/hhvm/systemlib-extractor)[ RSS](/packages/hhvm-systemlib-extractor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (1)

Systemlib Extractor [![Build Status](https://camo.githubusercontent.com/16208af8d9b77669a2437dbca26c96aec493cf1748c6445648e539a090fa74eb/68747470733a2f2f7472617669732d63692e6f72672f6868766d2f73797374656d6c69622d657874726163746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hhvm/systemlib-extractor)
===========================================================================================================================================================================================================================================================================================================================

[](#systemlib-extractor-)

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.

There are two kinds of sections that this library extracts:

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

Sections with different names or aren't PROGDATA can not be examined with this library.

Requirements
------------

[](#requirements)

This package requires the `readelf` binary; on Debian-like systems, this is in the `elfutils` package.

Installation
------------

[](#installation)

Assuming your project uses Composer:

```
composer require hhvm/systemlib-extractor

```

Usage
-----

[](#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')
"
