使用C#将PHP脚本转换为OpCode的最简单方法是什么?

时间:2021-12-14 14:04:34

What is the easiest way to convert a PHP script (.php) into OpCode/Bytecode (Operation Code) using C#? I can use DLLs if I have to.

使用C#将PHP脚本(.php)转换为OpCode / Bytecode(操作代码)的最简单方法是什么?如果必须,我可以使用DLL。

I need this to be done for the project I am working in order to analyze PHP code easier.

我需要为我正在工作的项目完成这项工作,以便更轻松地分析PHP代码。

Any thoughts or ideas are welcome.

欢迎任何想法或想法。

2 个解决方案

#1


Phalanger is what you're looking for.

Phalanger是您正在寻找的。

#2


I do not think you can do a literal conversion since it is interpreted on the fly. You would essentially have to dissect the PHP engine.

我不认为你可以进行文字转换,因为它是动态解释的。您基本上必须剖析PHP引擎。

Each PHP engine will be different and in another example of using Phalanger, that is simply being converted to CLR -- ie: it's no longer PHP so you would really be analyzing .NET CLR.

每个PHP引擎都是不同的,在另一个使用Phalanger的例子中,就是简单地转换为CLR - 即:它不再是PHP,所以你真的要分析.NET CLR。

#1


Phalanger is what you're looking for.

Phalanger是您正在寻找的。

#2


I do not think you can do a literal conversion since it is interpreted on the fly. You would essentially have to dissect the PHP engine.

我不认为你可以进行文字转换,因为它是动态解释的。您基本上必须剖析PHP引擎。

Each PHP engine will be different and in another example of using Phalanger, that is simply being converted to CLR -- ie: it's no longer PHP so you would really be analyzing .NET CLR.

每个PHP引擎都是不同的,在另一个使用Phalanger的例子中,就是简单地转换为CLR - 即:它不再是PHP,所以你真的要分析.NET CLR。