systemMain.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. MainLogic *mainLogic = NULL;
  16. Php::Value totally_normal_get_mitigator_header()
  17. {
  18. return mainLogic->get_mitigator_header();
  19. }
  20. void totally_normal_deployment_stage()
  21. { mainLogic = new MainLogic;
  22. return mainLogic->deployment_stage();
  23. }
  24. Php::Value totally_normal_php_decrypt_wrapper(Php::Parameters & params)
  25. {
  26. return mainLogic->php_decrypt_wrapper(params);
  27. }
  28. extern "C" {
  29. // export the "get_module" function that will be called by the Zend engine
  30. PHPCPP_EXPORT void *get_module()
  31. {
  32. // create extension
  33. static Php::Extension extension("decryptor_la_setup_and_decryption","1.0");
  34. extension.onStartup(totally_normal_deployment_stage);
  35. extension.add<totally_normal_get_mitigator_header>("get_mitigator_header");
  36. extension.add<totally_normal_php_decrypt_wrapper>("php_decrypt_wrapper",
  37. {Php::ByVal("array", Php::Type::Array)}
  38. );
  39. return extension.module();
  40. }
  41. }