systemMain.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #include <phpcpp.h>
  2. #include <string.h>
  3. #include <string>
  4. #include <unistd.h>
  5. #include <errno.h>
  6. #include<sys/time.h>
  7. #include <fcntl.h>
  8. #include <sys/types.h>
  9. #include <sys/stat.h>
  10. #include <stdio.h>
  11. #include "MainLogic.h"
  12. using namespace std;
  13. int __ImageBase=0;
  14. // Mitigator-Public-Key:
  15. extern "C" {
  16. // export the "get_module" function that will be called by the Zend engine
  17. PHPCPP_EXPORT void *get_module()
  18. {
  19. // create extension
  20. static Php::Extension extension("decryptor_la_setup_and_decryption","1.0");
  21. MainLogic nativeMainLogic;
  22. Php::Class<MainLogic> myMainLogic("MainLogic");
  23. myMainLogic.method<&MainLogic::get_mitigator_header>("get_mitigator_header");
  24. myMainLogic.method<&MainLogic::deployment_stage>("deployment_stage");
  25. myMainLogic.method<&MainLogic::php_decrypt_wrapper>("php_decrypt_wrapper", { Php::ByVal("string", Php::Type::String), Php::ByVal("string", Php::Type::String) } );
  26. std::function<void()> startup_callback_fn = std::bind(&MainLogic::deployment_stage, nativeMainLogic); //nativeMainLogic.deployment_stage;
  27. extension.onStartup(startup_callback_fn);
  28. // return the extension module
  29. extension.add(myMainLogic);
  30. return extension.module();
  31. }
  32. }