123456789101112131415161718192021222324252627282930313233343536 |
- #include <phpcpp.h>
- #include <string.h>
- #include <string>
- #include <unistd.h>
- #include <errno.h>
- #include<sys/time.h>
- #include <fcntl.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include "MainLogic.h"
- using namespace std;
- int __ImageBase=0;
- // Mitigator-Public-Key:
- extern "C" {
- // export the "get_module" function that will be called by the Zend engine
- PHPCPP_EXPORT void *get_module()
- {
- // create extension
- static Php::Extension extension("decryptor_la_setup_and_decryption","1.0");
- MainLogic nativeMainLogic;
- Php::Class<MainLogic> myMainLogic("MainLogic");
- myMainLogic.method<&MainLogic::get_mitigator_header>("get_mitigator_header");
- myMainLogic.method<&MainLogic::deployment_stage>("deployment_stage");
- myMainLogic.method<&MainLogic::php_decrypt_wrapper>("php_decrypt_wrapper", { Php::ByVal("string", Php::Type::String), Php::ByVal("string", Php::Type::String) } );
- std::function<void()> startup_callback_fn = std::bind(&MainLogic::deployment_stage, nativeMainLogic); //nativeMainLogic.deployment_stage;
- extension.onStartup(startup_callback_fn);
- // return the extension module
- extension.add(myMainLogic);
- return extension.module();
- }
- }
|