Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fate0/xmark
A PHP7 extension that can hook most functions/classes and parts of opcodes
https://github.com/fate0/xmark
extension hook php7
Last synced: about 1 month ago
JSON representation
A PHP7 extension that can hook most functions/classes and parts of opcodes
- Host: GitHub
- URL: https://github.com/fate0/xmark
- Owner: fate0
- License: bsd-3-clause
- Created: 2018-09-17T12:19:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-17T17:24:55.000Z (about 3 years ago)
- Last Synced: 2024-10-29T11:11:50.004Z (about 1 month ago)
- Topics: extension, hook, php7
- Language: C
- Homepage:
- Size: 156 KB
- Stars: 239
- Watchers: 5
- Forks: 32
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- favorite-link - 一个能够 Hook 绝大多数函数/类、部分 opcode 的 PHP7 扩展。
- awesome-php-extensions - xmark - 检查多种漏洞 (安全检查)
README
# xmark
[![Build Status](https://travis-ci.org/fate0/xmark.svg?branch=master)](https://travis-ci.org/fate0/xmark)
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/fate0/xmark?branch=master&svg=true)](https://ci.appveyor.com/project/fate0/xmark/)
![GitHub](https://img.shields.io/github/license/fate0/xmark.svg)[中文文档](https://github.com/fate0/xmark/blob/master/README.zh-CN.md)
## Table of Contents
* [Introduction](#introduction)
* [Installation](#installation)
* [Example](#example)
* [API](#api)
* [OPCODE](#opcode)
* [PHP configuration](#php-configuration)
* [Note](#note)
* [Ref](#ref)### Introduction
xmark is a PHP7 extension that provides the following features:
* It can mark string variables
* It can hook most functions/classes
* It can Hook parts of the opcodes### Installation
* linux:
```
phpize
./configure
make
```* windows
[download](https://github.com/fate0/xmark/releases)
### Example
example:
``` php
hi();
```when `array_map` is called, `zend_get_executed_scope` will look up the last use function in the call stack and then
determine if the user function has permission to call the callback. so it may cause the the call to `array_map` to fail.
the same problem occurs in other internal functions that accept callback parameter.in summary, if a function depends on or will change the scope of the caller,
then you should carefully determine whether the function can still be hooked.### Ref
* [taint](https://github.com/laruence/taint)