patch_solution_since_16.0.7.0.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <string>
  3. #include "patch_solution_since.hpp"
  4. #include "elf64_interpreter.hpp"
  5. #include "amd64_emulator.hpp"
  6. namespace nkg {
  7. template<>
  8. class patch_solution_since<16, 0, 7, 0> final : public patch_solution {
  9. private:
  10. static inline std::string_view official_encoded_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw1dqF3SkCaAAmMzs889IqdW9M2dIdh3jG9yPcmLnmJiGpBF4E9VHSMGe8oPAy2kJDmdNt4BcEygvssEfginva5t5jm352UAoDosUJkTXGQhpAWMF4fBmBpO3EedG62rOsqMBgmSdAyxCSPBRJIOFR0QgZFbRnU0frj34fiVmgYiLuZSAmIbs8ZxiHPdp1oD4tUpvsFci4QJtYNjNnGU2WPH6rvChGl1IRKrxMtqLielsvajUjyrgOC6NmymYMvZNER3htFEtL1eQbCyTfDmtYyQ1Wt4Ot12lxf0wVIR5mcGN7XCXJRHOFHSf1gzXWabRSvmt1nrl7sW6cjxljuuQawIDAQAB";
  11. elf64_interpreter& m_libcc_interpreter;
  12. elf64_interpreter::va_t m_va_CSRegistrationInfoFetcher_LINUX_vtable;
  13. elf64_interpreter::va_t m_va_CSRegistrationInfoFetcher_LINUX_GenerateRegistrationKey;
  14. elf64_interpreter::va_t m_va_pltgot_std_string_append;
  15. uint64_t _emulator_append_external_api_impl(amd64_emulator& x64_emulator, std::string_view api_name, const std::vector<uint8_t>& api_impl);
  16. uint64_t _emulator_malloc(amd64_emulator& x64_emulator, size_t alloc_size);
  17. void _emulator_free(amd64_emulator& x64_emulator, uint64_t alloc_p);
  18. bool _emulator_page_fault_handler(amd64_emulator& x64_emulator, uc_mem_type access, uint64_t address, size_t size, int64_t value);
  19. void _emulator_dl_runtime_resolve_handler(amd64_emulator& x64_emulator, uint64_t address, size_t size);
  20. void _emulator_malloc_handler(amd64_emulator& x64_emulator, uint64_t address, size_t size);
  21. void _emulator_free_handler(amd64_emulator& x64_emulator, uint64_t address, size_t size);
  22. static std::string _build_encoded_key(const rsa_cipher& cipher);
  23. public:
  24. patch_solution_since(elf64_interpreter& libcc_interpreter);
  25. [[nodiscard]]
  26. virtual bool find_patch() override;
  27. [[nodiscard]]
  28. virtual bool check_rsa_privkey(const rsa_cipher& cipher) override;
  29. virtual void make_patch(const rsa_cipher& cipher) override;
  30. };
  31. }