def.hpp 1019 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include <tchar.h>
  3. #include <windows.h>
  4. #include <string>
  5. #include "RSACipher.hpp"
  6. #pragma comment(lib, "version.lib") // GetFileVersionInfoSize, GetFileVersionInfo, VerQueryValue are in this lib
  7. namespace std {
  8. #ifdef UNICODE
  9. typedef wstring Tstring;
  10. #else
  11. typedef string Tstring;
  12. #endif // UNICODE
  13. }
  14. namespace patcher {
  15. std::string EncryptPublicKey(const char* public_key, size_t len);
  16. namespace Solution0 {
  17. BOOL Init(const std::Tstring& Path);
  18. BOOL CheckKey(RSACipher* cipher);
  19. BOOL FindTargetFile();
  20. BOOL CheckFile();
  21. BOOL BackupFile();
  22. BOOL Do(RSACipher* cipher);
  23. BOOL GetVersion(LPDWORD lpMajorVer, LPDWORD lpMinorVer);
  24. VOID Finalize();
  25. }
  26. namespace Solution1 {
  27. BOOL Init(const std::Tstring& Path);
  28. BOOL CheckKey(RSACipher* cipher);
  29. BOOL FindTargetFile();
  30. BOOL FindOffset();
  31. BOOL BackupFile();
  32. BOOL Do(RSACipher* cipher);
  33. VOID Finalize();
  34. }
  35. }